aboutsummaryrefslogtreecommitdiff
path: root/src/js_ast.zig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-28Get Next.js Pages Router to work (#6095)Gravatar dave caruso 1-0/+1
* 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-20add `emitDecoratorMetadata` (#5777)Gravatar Dylan Conway 1-0/+7
* 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-5/+2
This reverts commit 32664df254be225dd195fcaf46994f0c550f9d22.
2023-09-13decode regex if needed (#5167)Gravatar Dylan Conway 1-2/+5
* decode regex if non-ascii * make it comptime * add test * use `bun.BabyList(u16)`
2023-09-11Fix error message typo in js_ast.zig (#4937)Gravatar Ben Jervis 1-1/+1
2023-09-10Support named imports for json & toml files at runtime (#4783)Gravatar Jarred Sumner 1-0/+8
* Support named exports in json imports * Support named imports for `*.json` files * Remove stale comments * Don't export arrays as non-default * Add test for default exports * Don't break webpack --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-03initialize JSC for macros from cliGravatar Dylan Conway 1-0/+4
2023-08-24fix buildGravatar Dylan Conway 1-23/+22
2023-08-24update zig to 0.11.0 (#4233)Gravatar Jason 1-47/+47
* 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-21Fix memory leak in `buffer.toString("hex")` (#4235)Gravatar Jarred Sumner 1-0/+1
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-2771/+0
`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-11/+6
* 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-07implement fetching data urls (#4000)Gravatar Dylan Conway 1-3/+3
* fetch data urls * `byteSlice` * deinit slice * allocate `mime_type` string if needed * `content_type_allocated` and uncomment tests * `str_` * createAtom and slice decode result
2023-08-07WASM test analyzer (#4043)Gravatar Jarred Sumner 1-10/+25
* 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-05Remove Bun.plugin transpiler hook, encourage usage of `--preload` instead ↵Gravatar dave caruso 1-8/+0
(#3987) * Remove Bun.plugin transpiler hook * one missing case
2023-08-04fix macro string escaping (#3967)Gravatar Dylan Conway 1-7/+10
* handle macro escaping * remove printer * use `js_lexer.decodeEscapeSequences`
2023-07-30Fix memory leak in response.clone(), further reduce memory usage of Request ↵Gravatar Jarred Sumner 1-1/+0
& Response (#3902) * Atomize respsone.url & response.statusText * Fix warning * Atomize Request & Response URLs when possible * Fix memory leak in response.clone() bun/bench/snippets on  jarred/atomize ❯ mem bun --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.2 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 77.3 ns/iter (40.35 ns … 222.64 ns) 91.53 ns 128.11 ns 172.78 ns resp.clone().url 162.43 ns/iter (116 ns … 337.77 ns) 177.4 ns 232.38 ns 262.65 ns Peak memory usage: 60 MB bun/bench/snippets on  jarred/atomize ❯ mem bun-0.7.1 --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.1 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 115.85 ns/iter (80.35 ns … 247.39 ns) 128.19 ns 181.93 ns 207.23 ns resp.clone().url 252.32 ns/iter (202.6 ns … 351.07 ns) 266.56 ns 325.88 ns 334.73 ns Peak memory usage: 1179 MB * Update tests * Update js_ast.zig * Update test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-26fix decorator and declare (#3828)Gravatar Dylan Conway 1-0/+1
* return the prop if there are decorators * test and comment
2023-07-24fix rope string push (#3796)Gravatar Dylan Conway 1-1/+3
* push to next next * couple more tests * end
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