aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-30Fix issue with file loader (#3889)Gravatar Jarred Sumner 1-3/+22
* Fix issue with file loader * Update jest-extended.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30remove unnecessary moveGravatar Jarred Sumner 1-1/+1
2023-07-30Fix memory leak (#3887)Gravatar Jarred Sumner 9-78/+182
* Fix memory leak * Remove an extra copy * Further fixes --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30Fix coredump when reading an empty file(`node:stream:createReadStream`) (#3882)Gravatar Ai Hoshino 1-0/+4
* Fix coredump when reading an empty file. Close: #3607 * It seems that the fd is closed when `auto_close` is true.
2023-07-30Improv. (#3885)Gravatar Tiramify (A.K. Daniel) 1-13/+16
2023-07-29Make `bun:jsc` memoryUsage more accurate (#3876)Gravatar Jarred Sumner 6-68/+61
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28Defer task destructionbun-v0.7.1Gravatar Jarred Sumner 1-1/+17
2023-07-28markBindingGravatar Dylan Conway 1-0/+1
2023-07-28Fixes #3868Gravatar Jarred Sumner 1-2/+3
Fixes #3868 Fixes #849
2023-07-28`MessageChannel` and `MessagePort` (#3860)Gravatar Dylan Conway 52-246/+3336
* copy and format * copy * copy * cleanup * some tests * spellcheck * add types * don't lock getting contextId * array buffer test
2023-07-28feat(bun/test): Impl. expect().pass() & expect().fail() (#3843)Gravatar Tiramify (A.K. Daniel) 4-0/+178
* Impl. pass & fail * fix * fix 2 * smol
2023-07-28Support file: URLs in `fetch` (#3858)Gravatar Jarred Sumner 3-183/+262
* Support file: URLs in `fetch` * Update url.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28fix(tls) exposes native canonicalizeIP and fix rootCertificates (#3866)Gravatar Ciro Spaciari 1-2/+14
* exposes native canonicalizeIP * remove unintended duplicate * add tests * add tests for debug builds * add rootCertificates test and fix len * just randomize test ids on prisma * remove work around and bump usockets with the actual fix * fix case * bump uws
2023-07-28Fixes #3795 (#3856)Gravatar Jarred Sumner 8-6/+83
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Fix bug with // @bun annotation in main thread (#3855)Gravatar Jarred Sumner 1-2/+16
* Uncomment test * Fix bug with // @bun + async transpiler --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Add `Bun.isMainThread`Gravatar Jarred Sumner 2-0/+11
2023-07-27Resolve watch directories outside main thread + async iterator and symlink ↵Gravatar Ciro Spaciari 3-176/+350
fixes (#3846) * linux working pending tests with FSEvents * add more tests, fix async iterator * remove unnecessary check * fix macos symlink on directories * remove indirection layer * todos * fixes and some permission test * fix opsie and make prisma test more reliable * rebase with main * add comptime check for macOS * oops * oops2 * fix symlinks cascade on FSEvents * use JSC.WorkPool * use withResolver, createFIFO and fix close event on async iterator * remove unused events --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-27Make readFile() async (#3850)Gravatar Jarred Sumner 3-170/+297
* less leaky * async readfile * Update types.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Fix hot reloading in canary (#3848)Gravatar Jarred Sumner 1-0/+19
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Use putDirectIndex instead of initializeIndex (#3839)Gravatar Jarred Sumner 1-6/+6
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Make readdir() async, fix crash in large directory trees (#3838)Gravatar Jarred Sumner 5-196/+338
* Fix unsafe GC behavior on large arrays returned by fs * Fix crash in large arrays of strings * async readdir * Add tests for large number of files returned by readdir * Move this down * Fix encoding edgecase in path.join * Async stat & lstat * add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Remove lstat call in fs.watch (#3836)Gravatar Jarred Sumner 1-23/+19
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-26Enable `Promise.withResolvers()`Gravatar Jarred Sumner 1-0/+2
https://github.com/tc39/proposal-promise-with-resolvers Thanks @dcrousso
2023-07-26Start time performance improvements to build tools (#3797)Gravatar Jarred Sumner 6-321/+689
* Make os.cpus() faster on Linux * Fix crash See https://github.com/ziglang/zig/issues/16540 * Handle watcher_count == 0 * Add assertion * Clean up lifetimes of fs watcher a little * :scissors: * Use `errdefer` * Make the error better * Make os.cpus() more lazy * Please don't translate-c on the entire C standard library * immediately closing works correctly is still bug * ops * fmt+fixeup * add back verbose * free instead of destroy * remove destroy option for watcher tasks * flush verbose and add debug log * fixup files * use log for debug --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-07-26Disable concurrent transpiler in macrosGravatar Jarred Sumner 2-1/+4
2023-07-26Don't hoist bun plugin in concurrent transpilerGravatar Jarred Sumner 1-1/+2
2023-07-26Concurrent Transpiler (#3816)Gravatar Jarred Sumner 5-22/+539
* Concurrent Transpiler * Fix bug with some improts and add jsc alias * Some comments * Fix crash * Update module_loader.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-25fix the encoding of `dirname`'s return value. (#3799)Gravatar Ai Hoshino 1-1/+1
2023-07-25fix some cases in the `dirname` function. (#3785)Gravatar Ai Hoshino 1-2/+83
Close: #3782
2023-07-24Merge import.meta.require and require to be the same thing (#3732)Gravatar dave caruso 10-260/+192
* Merge import.meta.require and require to be the same thing * support `require` and BunPlugin (runtime plugin) * plugins * unused code * revert launch.json
2023-07-24bun:sqlite gets 10% faster (#3780)Gravatar Jarred Sumner 1-73/+126
* bun:sqlite gets 10% faster ❯ bun-debug bun.js # After [0.03ms] ".env" cpu: Apple M1 Max runtime: bun 0.7.1_debug (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------------------------- ----------------------------- SELECT * FROM "Order" 13.65 ms/iter (12.79 ms … 15.41 ms) 13.69 ms 15.41 ms 15.41 ms SELECT * FROM "Product" 31.02 µs/iter (27.08 µs … 1.33 ms) 30.33 µs 42.33 µs 45.25 µs SELECT * FROM "OrderDetail" 140.2 ms/iter (127.97 ms … 172.31 ms) 144.02 ms 172.31 ms 172.31 ms bun/bench/sqlite on  jarred/faster-sqlite took 5s ❯ bun bun.js # Before [0.52ms] ".env" cpu: Apple M1 Max runtime: bun 0.7.1 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------------------------- ----------------------------- SELECT * FROM "Order" 15.44 ms/iter (14.36 ms … 17.94 ms) 15.59 ms 17.94 ms 17.94 ms SELECT * FROM "Product" 36.89 µs/iter (31.54 µs … 3.18 ms) 37.25 µs 49.75 µs 54.88 µs SELECT * FROM "OrderDetail" 156.63 ms/iter (151.68 ms … 175.93 ms) 157.63 ms 175.93 ms 175.93 ms * Handle empty just incase * GCDeferral scope is unnecessary * Make this code more careful --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-23Upgrade WebKit (#3777)Gravatar Jarred Sumner 17-380/+262
* Upgrade to latest WebKit * Upgrade WebKit * hm * Fix failing tests * Delete utf8-encoding-fixture.bin.cmp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-23Fix bugs with connecting to localhost (#3758)Gravatar Jarred Sumner 2-31/+56
* Fix bugs with connecting to localhost * Update uws * More logs * Allow not setting a hostname * Make server.hostname & server.protocol faster * Fixup * normalize listening host * Fix test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22Explicitly ref/unref blobs before extracting the value (#3755)Gravatar Jarred Sumner 1-0/+36
* Explicitly ref/unref blobs before extracting the value * :scissors: --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22in Bun.write(), defer creating the Promise until we're just about to ↵Gravatar Jarred Sumner 1-4/+6
schedule the task
2023-07-22[install] improve workspace substitution of npm dependencies (#3754)Gravatar Alex Lam S.L 1-1/+1
- respect semver ranges
2023-07-22ref() before creating the JSPromiseGravatar Jarred Sumner 1-9/+14
2023-07-22Fixes ↵Gravatar Jarred Sumner 1-6/+8
https://discord.com/channels/876711213126520882/1131175053409656833/1131175053409656833 @tr1ckydev this fixes the issue you ran into, see the diff for an example usage of a Bun.plugin that makes a network request on import.
2023-07-22fix path.format for `vite build` (#3734)Gravatar dave caruso 1-5/+5
* fix path.format for vite * Update path.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22Fix `writeFileSync` when the mode is greater than 0o777. (#3747)Gravatar Ai Hoshino 1-3/+3
Close: #3740
2023-07-22Fixes #3744Gravatar Jarred Sumner 1-15/+125
2023-07-22Unified event loop (#3741)Gravatar Jarred Sumner 14-31/+189
* Unified event loop * Update WebKit, add test for es-module-lexer * Update README.md * Use async wasm * Explicitly set whether concurrenttask should be deinit'd * Update package.json --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-21Use WebKit's URL parser in fetch() and `bun install` (#3730)Gravatar Jarred Sumner 3-46/+249
* Use WebKit's URL parser in fetch() and `bun install` * Allocate less memory * Fix test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-21handle `latin1` in `Bun__encoding__toString`. (#3739)Gravatar Ai Hoshino 1-0/+1
Close: #3738
2023-07-21fix `isFIFO` (#3715)Gravatar Dylan Conway 1-3/+3
* check poll ref flags * Update WebCoreJSBuiltins.cpp
2023-07-20fix process.exit status code handling (#3714)Gravatar dave caruso 6-593/+617
2023-07-20fix directory caching with workaround (#3710)Gravatar dave caruso 1-1/+4
* ok * test
2023-07-20Pass constructor arguments to TextDecoder (#3692)Gravatar Julian 1-15/+50
* Make TextDecoder constructor use options parameter The constructor now actually sets TextDecoder properties using the options parameter. * Defer decoder allocation to end of constructor * Verify types of TextDecoder options * TextDecoder throw TypeError on failure * Tidying
2023-07-20set `_preload_modules` to empty array (#3709)Gravatar Dylan Conway 2-2/+2
2023-07-20fix start delay on Worker (#3707)Gravatar Ciro Spaciari 2-2/+14
* fix start delay on Worker * fmt * add delay test