aboutsummaryrefslogtreecommitdiff
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-05-30Fixes #3115Gravatar Jarred Sumner 2-30/+33
2023-05-30More commentsGravatar Jarred Sumner 1-0/+8
2023-05-30Add a commentGravatar Jarred Sumner 1-0/+4
2023-05-30Handle `Object.defineProperty(module, "exports", {get: getter})`Gravatar Jarred Sumner 1-1/+24
2023-05-30BumpGravatar Jarred Sumner 1-1/+1
2023-05-29Cleanup CommonJS changes (#3112)bun-v0.6.5Gravatar Jarred Sumner 7-49/+238
* Add more GC in test * Fix handling of functions and re-assignments in CommonJS * Increase timeout --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-29Natively support CommonJS at runtime (#3104)Gravatar Jarred Sumner 16-498/+996
* 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-28[node:net] fix createConnection options passing (#3101)Gravatar Ciro Spaciari 2-23/+10
* fixup createConnection * fix comment * fixup comment * also fix it on tls
2023-05-27Fixes #2356 (#3098)Gravatar Jarred Sumner 2-24/+11
2023-05-27Implement process.env.npm_lifecycle_event (#3097)Gravatar Tiramify (A.K. Daniel) 1-0/+1
* Update run_command.zig * Update env.test.ts * Add files via upload * Update run-process-env.test.ts * Update env.test.ts * Update harness.ts
2023-05-27Fixes #3091 (#3092)Gravatar Jarred Sumner 2-3/+1
* Fixes #3091 * Update build-id --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26Fix crash in `Server.prototype.fetch()` helper functionbun-v0.6.4Gravatar Jarred Sumner 1-3/+9
cc @cirospaciari, if you use `mimalloc-debug` it catches things like this
2023-05-26Add more debug safety checksGravatar Jarred Sumner 1-0/+18
2023-05-26Implement `expect().toBeEmpty()` (#3060)Gravatar Ashcon Partovi 5-9/+176
* Implement `expect().toBeEmpty()` * Fix formatting on test * Finish up expect().toBeEmpty() * Update expect.test.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26Pretty formatter for `Headers` & `URLSearchParams` (#3081)Gravatar Jarred Sumner 9-29/+147
* Pretty formatter for `Headers` & `URLSearchParams` * cleanup * console.log on Headers, FormData, URLSearchParams will always quote the keys now --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26[fetch] change response allocator (#3086)Gravatar Ciro Spaciari 1-1/+1
* change allocator * cleanup
2023-05-26Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)Gravatar Jarred Sumner 27-364/+599
* 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-25avoid using null valueGravatar Dylan Conway 1-2/+4
2023-05-25[install] fix `.bin` linking (#3067)Gravatar Alex Lam S.L 1-3/+3
- causes intermittent `bun install` failures on `bun-types`
2023-05-25jsx runtime from env (#3076)Gravatar Dylan Conway 1-0/+3
* use `NODE_ENV` for jsx mode * check env after `configureRouter` * get `NODE_ENV` from `options.production`
2023-05-25[stream] fix flush (#3073)Gravatar Ciro Spaciari 1-2/+1
* fix flush * remove logs
2023-05-24BumpGravatar Jarred Sumner 2-2/+2
2023-05-24Support `with { type: "macro"}` in `bun build` (#3059)Gravatar Jarred Sumner 4-51/+160
* [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-24Load `.env.test`, set NODE_ENV=test in `bun test`, load ↵Gravatar Jarred Sumner 11-73/+134
`.env.{test,production,development}.local` (#3037) * Support `.env.test` & `.env.{test,production,development}.local` * Fix bug preventing inlining of process.env.NODE_ENV by default * Update env_loader.zig * add env tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net>
2023-05-24[server.fetch] call when using Request object (#3051)Gravatar Ciro Spaciari 1-13/+9
* patch server.fetch * add tests and fix types
2023-05-24fix setting `jsxImportSource`, `jsxFactory`, and `jsxFragmentFactory` (#3057)Gravatar Dylan Conway 6-80/+37
* default automatic, merge jsx flags from multiple tsconfigs * use entire package name * some tests * more tests
2023-05-24[bun:FileSystemRouter] add more validations on parameters (#3053)Gravatar Ciro Spaciari 1-2/+28
* add validations and allow relative path on dir * remove unneed things * add origin/dir validation tests * remove workaround * add back relative path resolution
2023-05-24Add commentGravatar Jarred Sumner 1-0/+4
2023-05-24Remove that fieldGravatar Jarred Sumner 1-1/+0
2023-05-24Fix string checkGravatar Jarred Sumner 1-1/+2
2023-05-24Fixes #3031 (#3041)Gravatar Jarred Sumner 1-2/+61
* Fixes #3031 * Leave original input in there --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24Implement `require.cache` (#3045)Gravatar Jarred Sumner 6-1/+148
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-23Implement `bun test --timeout` (#3040)Gravatar Ashcon Partovi 3-6/+14
You can change the default per-test timeout in `bun test`: > bun test --timeout 10 The default timeout is 5000.
2023-05-23too noisyGravatar Jarred Sumner 1-1/+1
2023-05-23fix bun init and update node vm docs (#3014)Gravatar dave caruso 2-4/+3
2023-05-23check if key from `exports` can be printed as an identifier (#3032)Gravatar Dylan Conway 1-2/+8
* check if key can be printed as an identifier * possibly escape
2023-05-23[bun:test] Don't schedule the GC aggressively on every fileGravatar Jarred Sumner 1-1/+10
We already run the GC automatically whenever heap size grows, so this is mostly unnecessary In one benchmark, this is an 83% performance improvement at a cost of 9% more memory
2023-05-23[bun:test] Fix async/done-based test.todo (#3015)Gravatar Jarred Sumner 1-6/+27
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-23Support setting a timezone with `process.env.TZ` and `Bun.env.TZ` (#3018)Gravatar Jarred Sumner 7-0/+144
* Support setting a timezone via `process.env.TZ` * Implement `setTimeZone` in `bun:jsc` module * [breaking] `bun:test` now defaults to `Etc/UTC` timezone --------- 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-22fix marking requestCert (#3012)Gravatar Ciro Spaciari 1-3/+12
2023-05-22[node:http] Fix return type for `getHeader()` (#3007)Gravatar Jarred Sumner 1-6/+11
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22Write out builtins with TypeScript + Minify them (#2999)Gravatar dave caruso 121-24978/+16310
* start work drafting how builtins will work * work on ts builtin * builtins stuff so far * builtins * done for today * continue work * working on it * bindings so far * well, it builds. doesnt run * IT RUNS * still lots of ts errors but it is functional * sloppy mode
2023-05-22443 should default to https when no protocol is informed (#3008)Gravatar Ciro Spaciari 1-1/+10
2023-05-22[node:buffer] Add missing `inspect` functionbun-v0.6.3Gravatar Jarred Sumner 4-0/+30
cc @paperdave
2023-05-22[node:vm] Accept undefined in `createContext`Gravatar Jarred Sumner 1-0/+5
2023-05-22fixup (#3001)Gravatar Ciro Spaciari 1-8/+7
2023-05-22[breaking] ServerWebSocket.publish no longer publishes to self by defaultGravatar Jarred Sumner 1-1/+1
This changes `publishToSelf` to be `false` by default instead of `true`. This is a breaking change because it means that `ws.publish("foo", "bar")` will exclude `ws` from the list of websockets to broadcast. We are making this change because many people asked for this and were confused by the status quo - that `w.publish` publishes to self.
2023-05-22[ServerWebSocket] `binaryType` now defaults to `"nodebuffer"`Gravatar Jarred Sumner 1-5/+5
Previously, this defaulted to "uint8array", so this shouldn't be a breaking change unless you make use of `.slice()` in which case it will now be a reference to the same ArrayBuffer rather than a clone. The rationale for this change is most usages of Uint8Array on the server need a little more than just the bytes. Many npm packages expect Buffer rather than Uint8Array. Directly returning it for binary websocket messages is faster than creating another one.