aboutsummaryrefslogtreecommitdiff
path: root/src/js_parser.zig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-28Get Next.js Pages Router to work (#6095)Gravatar dave caruso 1-130/+86
* hell * make it so bun-debug-src * teag * wild * yippee * fas * fix async hooks assertions * yap * yeah that's wild * aa * a * increase time allowed * so trivial
2023-09-27fix typescript metadata for import identifiers (#6130)Gravatar Dylan Conway 1-6/+24
* handle import identifiers * a test * handle dot case
2023-09-27`deadCodeElimination` toggle for Bun.Transpiler (#5932)Gravatar jhmaster 1-46/+66
* add Bun.Transpiler DCE option * mark DCE toggle experimental + tests * full (hopefully) DCE toggle * update DCE toggle tests * add DCE option to types * run fmt * Removed uws submodule
2023-09-21decorator metadata defaults and rest argsGravatar Dylan Conway 1-9/+20
2023-09-20add `emitDecoratorMetadata` (#5777)Gravatar Dylan Conway 1-86/+804
* some progess * needs more tests * make tests easier to debug * get metadata for constructor arg decorators * fix some things * merge `emitDecoratorMetadata` option * remove `^` * bundler tests and get option from tsconfig earlier * remove spaces * fix tests
2023-09-15Revert "decode regex if needed (#5167)"Gravatar Jarred Sumner 1-29/+3
This reverts commit 32664df254be225dd195fcaf46994f0c550f9d22.
2023-09-13decode regex if needed (#5167)Gravatar Dylan Conway 1-3/+29
* decode regex if non-ascii * make it comptime * add test * use `bun.BabyList(u16)`
2023-09-01keep export star as (#4451)Gravatar Dylan Conway 1-14/+0
2023-08-24Disable minifying "str".length until ↵Gravatar Jarred Sumner 1-4/+7
https://github.com/oven-sh/bun/issues/4217 is fixed
2023-08-24update zig to 0.11.0 (#4233)Gravatar Jason 1-19/+19
* WIP * backup * more change * json related error sovled * number related issue solved * revert WriterType changed before * destroy -> free * jsonStringify related issues solved * fix mem.free expected []T or *[_]T, passed [*]const u8 * fix expected []T or *[_]T, passed [*:0]const u8 * fix build script * fix build script, for real * replace 0.11.0-dev.4006+bf827d0b5 to 0.12.0-dev.161+6a5463951 * fix build on macOS, COPYFILE.DATA -> COPYFILE_DATA * fix the last destroy on [*]ptr issue --------- Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-08-23Fix `<const T>() =>` (#4278)bun-v0.8.0Gravatar dave caruso 1-0/+3
2023-08-22fix yield (#4264)Gravatar dave caruso 1-1/+1
2023-08-20Implement `--inspect-brk` (#4222)Gravatar Jarred Sumner 1-0/+14
* Implement `--inspect-brk` * Bump WebKit --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-18Remove most C API usages, add debugger pretty printers for `Headers`, ↵Gravatar Jarred Sumner 1-126/+10
`URLSearchParams`, `FormData`, `Worker`, `EventTarget` (#4187) * Add pretty printers for `Headers`, `URLSearchParams`, and `FormData` * [untested] Add way to code generate getInternalProperties * bump * Bump Webkit * Ref the event loop while loaded * wip * checkpoint * another checkpoint * The code has been written * Fixup exports * Fix all the errors * Fix bug * [console.log] Fix bug when printing non-reified types missing values * Fix loading hash table * fix plugin * Fix ref & unref * auto-unref * various fixes * Update bun.zig * Set toStringTag * Delete code for macro JSX * Delete code for `bun dev` HTTP JS * Move Bun.serve to C++ API * Delete JSC C API code * :scissors: :skull: code * Use JSC C++ for `confirm`, `Crypto`, `prompt`, `alert` * more dead code * Update exports.zig * Use JSC C++ API for FFI * Remove remaining usages * Remove remaining usages * Update ffi.ts * Update InternalModuleRegistryConstants.h * draw the rest of the owl * Update webcore.zig * bind it * Fix performance regression in crypto.randomUIUD() * Update js_parser.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-11Deprecate loading `node_modules.bun` (#4131)Gravatar Jarred Sumner 1-651/+2
* Deprecate loading `node_modules.bun` * realpath * regenerate schema * More * more * Update cli.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-11Support TypeScript's `export type * as Foo from 'bar'` (#4125)Gravatar Jarred Sumner 1-9/+30
* [TypeScript] Support `export type * as Foo from 'bar'` * Update js_parser.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-08Remove unintentional logs from #4043Gravatar Jarred Sumner 1-69/+1
2023-08-07WASM test analyzer (#4043)Gravatar Jarred Sumner 1-5/+140
* wasm * WASM test scanner * Update Makefile * Update Makefile * Configurable heap limit * slightly better error * Update js_parser.zig * Update path.test.js * Update node.mjs --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06Bind require.resolve() (#4030)Gravatar Jarred Sumner 1-6/+38
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-05Remove Bun.plugin transpiler hook, encourage usage of `--preload` instead ↵Gravatar dave caruso 1-84/+0
(#3987) * Remove Bun.plugin transpiler hook * one missing case
2023-07-26fix decorator and declare (#3828)Gravatar Dylan Conway 1-1/+10
* return the prop if there are decorators * test and comment
2023-07-21string escape edgecase (#3717)bun-v0.7.0Gravatar Dylan Conway 1-1/+4
* fix edgecase when joining rope strings with backtick * bonus bugfix in ts decorator * Update transpiler.test.js * Fix test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-20`resolveRopeIfNeeded` (#3708)Gravatar Dylan Conway 1-0/+1
2023-07-19set `did_panic` flag (#3687)Gravatar Dylan Conway 1-1/+5
2023-07-18zig upgrade (#3667)Gravatar Dylan Conway 1-34/+34
* upgrade * more fixes * Bump Zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08Handle case with TS decorators and export default anonymous class (#3578)Gravatar Jarred Sumner 1-1/+11
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08Fix bug with decorators not being generated in `export default class` (#3577)Gravatar Jarred Sumner 1-1/+12
* Fix bug with decorators not being generated in `export default class` * Update decorator-export-default-class-fixture.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-06Fixes #3537 (#3539)Gravatar Jarred Sumner 1-10/+41
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-05don't unwrap react below version `18.0.0` (#3538)Gravatar Dylan Conway 1-5/+20
* don't unwrap react below version 18 * empty string * also `react-dom`
2023-06-29Fixes #3462 (#3465)Gravatar Jarred Sumner 1-0/+24
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-29[bundler] avoid printing unnecessary declarations (#3456)Gravatar Dylan Conway 1-58/+16
* skip declarations without values * tests * deoptimize cjs when decls are needed
2023-06-24Rewrite Bun's runtime CommonJS loader (#3379)Gravatar Jarred Sumner 1-26/+63
* wip changes for CommonJS * this rewrite is almost complete * even more code * wip * Remove usages of `import.meta.require` from builtins * Remove usages of require * Regenerate * :scissors: builtin rewrite commonjs in printer * Use lazy custom getters for import.meta * fixups * Remove depd * ugh * still crashing * fixup undici * comment out import.meta.require.resolve temporarily not a real solution but it stops the crashes * Redo import.meta.primordials * Builtins now have a `builtin://` protocol in source origin * Seems to work? * Finsih getting rid of primordials * switcharoo * No more function * just one more bug * Update launch.json * Implement `require.main` * :scissors: * Bump WebKit * Fixup import cycles * Fixup improt cycles * export more things * Implement `createCommonJSModule` builtin * More exports * regenerate * i broke some stuff * some of these tests work now * We lost the encoding * Sort of fix zlib * Sort of fix util * Update events.js * bump * bump * bump * Fix missing export in fs * fix some bugs with builtin esm modules (stream, worker_threads, events). its not perfect yet. * fix some other internal module bugs * oops * fix some extra require default stuff * uncomment this file but it crsahes on my machine * tidy code here * fixup tls exports * make simdutf happier * Add hasPrefix binding * Add test for `require.main` * Fix CommonJS evaluation order race condition * Make node:http load faster * Add missing exports to tls.js * Use the getter * Regenerate builtins * Fix assertion failure in Bun.write() * revamp dotEnv parser (#3347) - fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042 * fix tests for `expect()` (#3384) - extend test job time-out for `darwin-aarch64` * `expect().resolves` and `expect().rejects` (#3318) * Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * fixup min/memcopy (#3388) * Fix crash in builtins * Don't attempt to evaluate modules with no source code * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Fix crash * cleanup * Fix test cc @paperdave * Fixup Undici * Fix issue in node:http * Create util-deprecate.mjs * Fix several bugs * Use the identifier * Support error.code in `util.deprecate` * make the CJs loader slightly more resilient * Update WebCoreJSBuiltins.cpp * Fix macros --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 1-55/+52
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20record jsx factory symbols in classic mode (#3360)Gravatar Dylan Conway 1-1/+7
* record jsx factory symbols * merge factory/fragment when more than one part * update test * use existing functions, use, `memberListToComponentsIfDifferent` * missing file * fix defaults
2023-06-19Fix bug that breaks `bunx prisma init` when node is not installed (#3362)Gravatar Jarred Sumner 1-2/+35
* tweak cjs * Handle more cases, add a test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-16don't remove const if referenced before declaration (#3337)Gravatar Dylan Conway 1-3/+3
2023-06-15Tweak CommonJS output (#3320)Gravatar Jarred Sumner 1-6/+8
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-14Workaround issue with module.require =Gravatar Jarred Sumner 1-8/+64
2023-06-12handle unwrapping `require` in any expression (#3292)Gravatar Dylan Conway 1-5/+25
2023-06-09Fixes #3206 (#3262)Gravatar Jarred Sumner 1-47/+75
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-09Implement mocks in bun:test (#3252)Gravatar Jarred Sumner 1-0/+2
* wip * wip * most of the code for mocks in bun:test * finishing up * Implement `toHaveBeenCalled` and `toHaveBeenCalledTimes(1)` * Test * visit * results, not returnValues * exact * Update jest.zig * A couple more tests * Add jest.fn * support resetting mocks * Implement spyOn --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01Implement `__dirname` and `__filename`, allow direct eval in CommonJS (#3164)Gravatar Jarred Sumner 1-19/+27
* Implement `__dirname` and `__filename`, allow direct eval in CommonJS * Fixup dirname and add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01only add cjs export name if it is assigned (#3159)Gravatar Dylan Conway 1-1/+1
2023-05-31don't rewrite `module.exports` if assign target is `update` or `replace` (#3147)bun-v0.6.6Gravatar Dylan Conway 1-9/+16
* don't rewrite `module.exports` if assign target is `update` or `replace` * missing `is_delete_target`, check de-opt before rewriting
2023-05-31set `optional_chain` instead of `optional_start` (#3142)Gravatar Dylan Conway 1-1/+1
2023-05-31`--no-macros` flag, disable macros in node_modulesGravatar Jarred Sumner 1-0/+23
2023-05-30[CommonJS] Handle `this` betterGravatar Jarred Sumner 1-5/+19
2023-05-29Natively support CommonJS at runtime (#3104)Gravatar Jarred Sumner 1-491/+570
* Natively support CommonJS at runtime * cleanup how getters are handled, add fast path * more consistent with node * use * As * Remove thrown modules on exception * Handle exception better --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-28Convert `module.exports = { foo: 'bar'}` to ESM in `bun build` (#3103)Gravatar Jarred Sumner 1-1/+164
* Convert `module.exports = { foo: 'bar'}` to ESM in `bun build` * De-opt for `module.exports = {}` --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-27Fixes #3091 (#3092)Gravatar Jarred Sumner 1-2/+0
* Fixes #3091 * Update build-id --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>