aboutsummaryrefslogtreecommitdiff
path: root/src/js_ast.zig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-18zig upgrade (#3667)Gravatar Dylan Conway 1-56/+53
* upgrade * more fixes * Bump Zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16Add `--smol` flagGravatar Jarred Sumner 1-0/+1
2023-07-16Fixes #3641 (#3643)Gravatar Jarred Sumner 1-3/+28
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-06Remove unnecessary `@setRuntimeSafety(false)`Gravatar Jarred Sumner 1-8/+8
2023-06-29Fixes #3462 (#3465)Gravatar Jarred Sumner 1-0/+8
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-27add todo commentGravatar Dylan Conway 1-0/+2
2023-06-27fix macrosGravatar Dylan Conway 1-1/+1
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 1-61/+61
* 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-01Implement `__dirname` and `__filename`, allow direct eval in CommonJS (#3164)Gravatar Jarred Sumner 1-0/+4
* 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-05-29Natively support CommonJS at runtime (#3104)Gravatar Jarred Sumner 1-0/+9
* 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-26Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)Gravatar Jarred Sumner 1-2/+2
* Fix crash in test.todo * remove usages of JSC C API in bun:test * Remove additional JSC-C API usages * fix `make headers` * URLSearchParams.length * FormData length * URLSearchParams length * Fix `make headers` * very fancy length * Fix bug with exceptions being ignored sometimes * Add tests for extension toHaveLength --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24Support `with { type: "macro"}` in `bun build` (#3059)Gravatar Jarred Sumner 1-37/+120
* [bun macro] Support `assert { type: "macro" }` and `with {type: "macro"}` * [bun macro] Pass through input as arguments instead of a JSNode * Fix hang when loading many entry points simultaneously with macros * do not clone --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22fix extra/ArbitraryModuleNamespaceIdentifiers2 (#3016)Gravatar dave caruso 1-2/+0
* fix extra/ArbitraryModuleNamespaceIdentifiers2 * remove assert
2023-05-19resolve rope string for multipart template (#2963)Gravatar Dylan Conway 1-3/+2
* resolve rope for multipart template * fix tests * clone template part if it is `e_string` and folded * clone string only * don't clone data again
2023-05-18use raw template contents for tagged templates (#2937)Gravatar Dylan Conway 1-16/+35
* use raw template contents when tagged * use union for template contents * pointer to cooked contents * raw if suffix * fix and don't skip test
2023-05-17Make `BuildError` and `ResolveError` use C++ instead of JSC C APIGravatar Jarred Sumner 1-4/+3
Fixes memory leak with private data never being cleared Fixes a case where a ResolveError could actually be a BuildError
2023-05-16resolve rope before pushing to previous string (#2909)Gravatar Dylan Conway 1-5/+6
2023-05-15handle printing missing expressions and add tests (#2872)Gravatar Dylan Conway 1-0/+4
* handle missing expressions and add tests * minify missing expression blocks in parser
2023-05-11Fix our tree shaking optimizationGravatar Jarred Sumner 1-0/+1
2023-05-11bundler tests and improve `Bun.build` return type (#2833)Gravatar dave caruso 1-1/+1
* importstar_ts * tests * run acorn test suite * bench tweaks * test * bun.build tests very incomplete * remove dataurl and base64 loaders from tests since they dont work yet * tests * stuff * stuff * add errors and array of blobs * work so far * docs * requested changes * fix overwrite docs * remove this file
2023-05-10make sure vars can be hoisted in catch scope (#2847)Gravatar Dylan Conway 1-1/+1
2023-05-09fix catch scope var declarations (#2839)Gravatar Dylan Conway 1-0/+1
* use `catch_binding` kind and report errors * make hash optional
2023-05-09resolve rope string before returning (#2838)Gravatar Dylan Conway 1-1/+1
2023-05-09Fix regression with `bun test` not recursively scanning the directory treeGravatar Jarred Sumner 1-1/+8
2023-05-08Fix bug with float minificationGravatar Dylan Conway 1-5/+3
2023-05-07Reduce the size of the JS AST to attempt to resolve the linux performance issueGravatar Jarred Sumner 1-7/+192
2023-05-07Add tracy (#2817)Gravatar Jarred Sumner 1-0/+2
* Add tracy * RTLD * Linux needs LD_PRELOAD * More tracing * Inline this --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-07experiment to try to fix linux bundler perf regressionGravatar Jarred Sumner 1-1/+3
2023-05-06[minifier] Rewrite equality check logicGravatar Jarred Sumner 1-23/+123
2023-05-06Fixes https://github.com/oven-sh/bun/issues/2810Gravatar Jarred Sumner 1-2/+2
2023-05-04parse and visit catch body scope (#2796)Gravatar Dylan Conway 1-0/+1
2023-05-03Implement synthetic default exportGravatar Jarred Sumner 1-2/+2
2023-05-02Add missing functionGravatar Jarred Sumner 1-1/+16
2023-05-01Small improvement to minifierGravatar Jarred Sumner 1-0/+4
2023-05-01Fix some splitting bugsGravatar Jarred Sumner 1-0/+2
2023-04-30Implement source maps (#2770)Gravatar Dylan Conway 1-1/+5
* wip * Begin computing source map tables * source map progress * external source maps * fix merge * remove `@as` coercion * inline source maps and output source map shifts * fix `codeWithSourceMapShifts()` after merge * remove second call to `findReachableFiles()` * use `worker.allocator`, remove comment * don't reuse memory for source and sourceContents * don't reuse `quote_buf` * fix writing to stdout * Add comment * Don't include a sourcemap if the text was empty * Make the parser faster * +16% faster sourcemap generation @dylan-conway I'll need you to look this over to make sure I didn't mess anything up Though it currently doesn't generate the offsets in the right order... * 30% performance improvement to Bun.build() * Print `debugId` in source maps cc @mitsuhiko @notzeeg --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-29Fix a load order issueGravatar Jarred Sumner 1-3/+41
2023-04-28bundler tests: rest of default.test.ts and starting jsx tests (#2765)Gravatar dave caruso 1-3/+2
2023-04-28Improves Body.Value life cycle and Signal life cycle on server.zig (#2752)Gravatar Ciro Spaciari 1-1/+1
* reestruct request body value and signal * revert react-hello-world * fix constructInto and test * fmt * fix body nullable * Request can outlive RequestContext * fmt * BodyValue is now HiveRef * hasDecl for Ref and HiveRef * fix deinit call on Ref/HiveRef * adds InlineBlob * fix Bun.inspect when using InlineBlob * revert InlineBlob * Fix mimalloc-debug * Add TODO note * fix: make node:crypto Hash.copy work correctly (#2761) This commit will also: - add a CryptoHasher.copy function - make CryptoHasher.digest reset the hasher so it can be reused Resolves #2651 * :nail_care: * address unicode issue (#2763) * Fix an oopsie * Another oopsie * use inline for * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * Request can outlive RequestContext * fmt * garantee to have the abort signnal attached to the server before abort the client on bun-server test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Silver <14016168+silversquirl@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-04-26Inline spreads of array literalsGravatar Jarred Sumner 1-0/+41
2023-04-26ensure `super()` is not merged with adjacent statements (#2757)Gravatar Dylan Conway 1-0/+4
* ensure `super()` is not merged with adjacent statements * add TODO
2023-04-26Implement `file` loader in `Bun.build` (#2745)Gravatar Jarred Sumner 1-1/+1
* Update bundle_v2.zig * Implement `file` loader * Hash in parallel * Implement `publicPath` * simplify * Update bundle_v2.zig * Implement `#!` * Remove unnecessary optional --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-22Make `Bun.build` more reliable (#2718)Gravatar Jarred Sumner 1-10/+53
* One possible implementation to make `Bun.build` work better * Pass allocator in * Make our temporary buffers a little safer * rename * Fix memory corruption in symbol table * Add support for deferred idle events in ThreadPool * Free more memory * Use a global allocator FS cache * more `inline` * Make duping keys optional in StringMap * Close file handles more often * Update router.zig * wip possibly delete this commit * Fix memory issues and reduce memory usage * > 0.8 * Switch to AsyncIO.Waker and fix memory leak in JSBundleCompletionTask * We don't need to clone this actually * Fix error * Format * Fixup * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-20Fix bug with merging adjacent varsGravatar Jarred Sumner 1-0/+5
2023-04-20append if the previous part is not UTF8 (#2705)Gravatar Dylan Conway 1-6/+9
2023-04-20Symbol minification (#2695)Gravatar Dylan Conway 1-4/+192
* minify * Update renamer.zig * --minify-whitespace * Speed up minification a little * handle private names * 5% faster minification * use helper function * fix nested scope slots * `bun build --minify` gets another +8% faster * print semicolons afterwards * print semicolon after checking error * after all error checking * Delete code for generating legacy bundes * remove extra whitespace around if statements * print space before import identifier * Use `@constCast` * Make `S.Local#decls` use `BabyList(Decl)` * Add `fromSlice` helper to `BabyList` * Remove unnecessary optional chains * minify `undefined, true, false` * Another @constCast * Implement merge adjacent local var * Support --minify in `bun build --transform` * skip comments when counting character frequencies * Don't wrap commonjs with --transform on (unless targeting bun) * Support --minify in the runtime * Fix edgecase with import * as * don't infinite loop * --trnasform shouldn't mess with require * Only track comments when minifying --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-19Fix broken autocompleteGravatar Jarred Sumner 1-5/+5
2023-04-17Fix template string folding bugGravatar Jarred Sumner 1-3/+3
2023-04-17make sure `with` is parsed as a block (#2680)Gravatar Dylan Conway 1-1/+0
2023-04-16Attempt to automatically handle some cyclical import issues with ESMGravatar Jarred Sumner 1-0/+15
Fixes https://github.com/kysely-org/kysely/issues/412