Lukas Kastern
751ff68268
feat: Add async support to Bun.serve onError ( #8233 )
...
* WIP
* Support not immediately fullfilled promises
* Typo
* Add tests
* Fix test
* Rename test
* Remove file
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-19 16:01:09 -03:00
Jarred Sumner
3c785c88fb
Fix issue with perf_hooks in canary ( #8279 )
...
* Update perf_hooks.ts
* Update perf_hooks.test.ts
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-19 05:22:06 -08:00
Dylan Conway
8efa01bd62
fix(bun:test): toContain and toContainEqual string fix ( #8270 )
...
* update toContain, toContainEqual, and tests
* fix build, use cursor
* `strings.indexOf` and `jsType` once
2024-01-18 20:13:57 -08:00
Ashcon Partovi
e17709a2d3
Fix bun --inspect with fully-qualified URL ( #8267 )
2024-01-18 18:32:51 -08:00
Alexandre Seo
c50400e186
Fix bug in string handling in toContain and return undefined in all matchers ( #7692 )
...
Co-authored-by: dave caruso <me@paperdave.net >
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com >
2024-01-18 14:14:16 -08:00
Jarred Sumner
e197b7c3a0
Fix crash in socket ( #8241 )
...
* Fix crash in socket
* Fix Socket timeout issue
* Add test for socket timeout
* Update socket.test.ts
* Fix linux tests
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-18 02:19:58 -08:00
dave caruso
41dda11802
fix: upgrade_command compilation error
2024-01-17 22:08:02 -08:00
dave caruso
8ba332b43a
fix(windows): Implement bun.sys.renameat on Windows and fix crash during bun upgrade ( #8242 )
...
* fix #7989
* doc
* oops
2024-01-17 22:01:53 -08:00
Michael H
52894121ea
bun run: "package.json scripts" at bottom (#8224 )
...
* `bun run`: put "package.json" scripts at bottom & better errors
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-01-17 18:18:40 -08:00
Jarred Sumner
a5e83189df
Stub more of perf_hooks ( #8239 )
...
* Stub more of perf_hooks
* Update perf_hooks.ts
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-17 17:41:47 -08:00
dave caruso
405e2d1517
windows: implement os.hostname ( #8223 )
...
* windows: implement os.hostname
* oops
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-01-17 17:33:02 -08:00
Meghan Denny
483b73c4bf
absorb bun.fdcast into FileDescriptor and remove ( #8240 )
2024-01-17 17:32:03 -08:00
dave caruso
08aa40c570
fix windows CI (use -MD again) ( #8220 )
...
* chore: upgrade webkit again
* fix submodules
2024-01-16 19:26:32 -08:00
dave caruso
82fcb38005
fix(windows): support utf16-le files in the bundler and in Bun.file ( #8219 )
...
* support utf16-le files
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-16 17:15:16 -08:00
Jarred Sumner
fc80683256
In fs.ReadStream, use $isObject to check options ( #8218 )
...
* In fs.ReadStream, use `$isObject` to check if function or object rather than typeof options === "object"
* Update fs.js
* Add test
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-16 16:41:24 -08:00
Jarred Sumner
54be1d7705
Fix decimal -> integer conversion bug in process.exit & process.exitCode ( #8216 )
...
* Fix process.exit to allow numbers which were previously decimals
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-16 16:19:33 -08:00
Emre Cakiroglu
7eed9d893e
fix: handle encoding deconstruction in node:fs ( #8212 )
2024-01-16 15:56:02 -08:00
Lukas Kastern
5a6ef045aa
fix: Hang when recursively logging via ConsoleObject.messageWithTypeAndLevel ( #8213 )
...
* Avoid deadlock in messageWithTypeAndLevel by adding a recursion counter
* Add test for recursive logs
* Do not rely on output of console-recursive.test.js
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-16 15:26:23 -08:00
Aarav Juneja
9350f6bc0b
fix: match node's path.parse on dotfiles. ( #8142 )
...
* Fix #8090
* Fix bug from modification order.
2024-01-16 14:12:18 -08:00
Jarred Sumner
83f2432da6
Update prettier ( #8198 )
...
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-15 23:47:13 -08:00
Meghan Denny
a064ae71ad
make node:fs/promises.open return a FileHandle and expose fdatasync ( #8141 )
...
* make node:fs/promises.open return a FileHandle and expose fdatasync
* node_fs: add fn spacing
* fix this assert usage too
* move primordial preservation higher
* use expect().toBe() instead of assert
* ensure top level node:fs/promises functions always receive fd's as a number
* add needed fixture
* [autofix.ci] apply automated fixes
* this was the wrong fix for a different thing
will look into it later
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-15 23:20:20 -08:00
dave caruso
f9e78c419f
feat: Implement using keyword (explicit resource management) ( #8151 )
...
* port 'initial support for using declarations'
1:1 port of this commit:
56a3e01244
* port 'initial support for await using declarations'
1:1 port of this commit:
1634a0b5ad
* fix cmake config for local jsc
* add global defines for symbols
* begin porting lowering implementation
based off of
https://github.com/evanw/esbuild/pull/3192
* [autofix.ci] apply automated fixes
* add some fun webkit scripts
* fix the minification bug
* refactor runtime_js, etc
* rename test file
* finished yapping
* silly silyl
* Update src/bundler.zig
* ok
* a
* Fix crash
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-15 23:14:41 -08:00
Jarred Sumner
f47def8515
Update run_command.zig
2024-01-15 19:50:05 -08:00
Jarred Sumner
14398ae27e
Upgrade to Node.js v21.6.0
2024-01-15 19:50:05 -08:00
Jarred Sumner
64d351b102
Upgrade to SQLite v3.45.0 ( #8196 )
...
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-15 19:45:14 -08:00
Meghan Denny
6b577a3970
implement events.on ( #8190 )
...
* exit event loop if there's unhandled errors
* move FixedQueue to a special package
* require(events) is also EventEmitter
* implement events.on
* move fixed_queue to internal and make it lazy in node:events
* use better Promise intrinsics
* move $shared to internal/shared
* make test not dependent on cwd
2024-01-15 18:54:37 -08:00
Lukas Kastern
a159850cce
fix: Bun.serve logging error when fetch returns rejected promise ( #8169 )
...
* Handle rejected promise returned from onResponse
* Add test
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-01-15 18:26:08 -08:00
Lukas Kastern
124392ee98
fix: Report error and close event when creating WebSocket fails ( #8186 )
...
* Defer websocket error/close when websocket client is null
* Rename test
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-01-15 18:08:34 -08:00
Jarred Sumner
e5421c56b1
feat: Support import db from './my.db' with {type: "sqlite"} ( #8178 )
...
* Support SQLite imports
* Docs
* Update executables.md
* Update loaders.md
* Update js_parser.zig
* Update loaders.md
* Update CMakeLists.txt
* Update Module.ts
* JSC got rid of `$trunc`?
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-15 17:56:02 -08:00
Jarred Sumner
a36355cefb
Some Windows tweaks ( #8118 )
...
* Some windows tweaks
* Make this pub
* Update bundle_v2.zig
* Fix woopsie
* Make this error better
* Add assertion for using allocator for HTTP client from another thread.
* Do fewer copies in readdir()
* Fix crash/failing tests
* Update tests
* Fix windows build
* Update loop.c
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-15 17:33:33 -08:00
Ashcon Partovi
2d21567271
Update debugger things ( #8180 )
...
* T
* Update Debug Adapter Protocol
* Update JSC and V8 debugger protocols
* Update inspector-frontend
* Fix empty keys not being printed in `console.log`
* Add `bun --inspect` tests and fix edge cases
* bun install --exact
2024-01-15 17:00:29 -08:00
Jarred Sumner
611b296a6a
Fixes #8170
2024-01-14 21:01:51 -08:00
Jarred Sumner
317998fdd6
Make toBunString increment the reference count ( #8146 )
...
* Make `toBunString` increment the reference count
* Fix WASI
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-14 05:36:31 -08:00
Jarred Sumner
ab40b0e054
Fix file descriptor leak in ipc ( #8165 )
...
* Fix file descriptor leak in ipc
* Do not assume sequential file descriptors
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-14 02:57:44 -08:00
Jarred Sumner
2c3dc5176b
Upgrade uWebSockets & usockets ( #8164 )
...
* Upgrade uWebSockets & usockets
* Update HttpRouter.h
* Defensively prevent sending to blocking sockets
* Add test for receiving large amounts of data
* Large data optimization
* Update loop.c
* Avoid extra system call before entering event loop
* Update internal.h
* 1 less pointer lookup
* Fix error
* Update socket-huge-fixture.js
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-14 02:04:30 -08:00
dave caruso
5fc4538477
windows: support bun:ffi ( #8114 )
...
* compile tcc
* initial linking
* ffi and stuff
* swag
* wala
* Update settings.json
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-01-13 19:14:29 -08:00
Meghan Denny
be0896e204
remove while loops where a for would be more efficient ( #8131 )
...
* remove while loops where a for would be more efficient
* this needs to be a stack copy
* this can use the better loop
* this was translated wrong
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-13 19:13:54 -08:00
Jarred Sumner
56f1e5a362
Hide some noisy stack frames ( #8148 )
...
* Hide some noisy stack frames
* Update javascript.zig
* Add `asyncModuleEvaluation` to the list
* Sort
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-13 19:11:01 -08:00
Jarred Sumner
702da52312
Fix rawMode regression ( #8163 )
...
* Fix rawMode regression
* arg0
* Update ProcessBindingTTYWrap.cpp
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-13 19:10:33 -08:00
Jarred Sumner
2a8956a268
Use one isosubspace for all generated constructors ( #8162 )
...
* Use one Isosubspace for constructors
* Update generate-classes.ts
* Update generate-classes.ts
* Update generate-classes.ts
* Update generate-classes.ts
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-13 18:50:09 -08:00
Meghan Denny
065eae5a95
tidy: use std.mem.zeroes instead of loop or memset ( #8138 )
...
* use std.mem.zeroes instead of loop or memset
* Update src/bun.js/api/bun.zig
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-01-12 23:56:51 -08:00
Meghan Denny
9fa13aec09
fix signalNumberToNameMap assignment for SIGINFO ( #8132 )
2024-01-12 23:53:35 -08:00
Jarred Sumner
01453be2d1
Move function from a header to a .cpp file
2024-01-12 23:48:14 -08:00
Jarred Sumner
9b32516bcb
Implement tty_wrap in process.binding ( #8130 )
...
* Implement `tty_wrap` in process.binding
Fixes #4694
* [autofix.ci] apply automated fixes
* Rename some things
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-12 23:31:18 -08:00
Jarred Sumner
7e787d2a5a
Move console methods from exports.zig to ConsoleObject.zig ( #8145 )
...
* ZigConsoleClient -> ConsoleObject
* Rename more
* Rename more
* ZigConsoleClientFormatter -> ConsoleObject
* More renaming
* Wire up console.profile?
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-01-12 23:15:36 -08:00
dave caruso
b7a32b87ab
fix(bundler): improve external require transpilation on all targets ( #8057 )
...
* fix(build): do not emit import.meta.require for browsers/node.js
* update test snapshots
* sweep
* prefer require ref instead of `import.meta.require`
* remove option i did not use
* stuff
* remove rewrite_require_resolve
* ok
* ok
* wooooo
* [autofix.ci] apply automated fixes
* fix bugs
* ok
* [autofix.ci] apply automated fixes
* OOOOOPPPPPPPPPPPPS
* fix Bun.Transpiler regressions
* fix(bundler): make --splitting ensure --outdir
* fix final
* oops
* [autofix.ci] apply automated fixes
* use require.resolve
* revert but ... it no longer crashes there
* ok
* [autofix.ci] apply automated fixes
* fix fetch test
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
2024-01-12 22:15:51 -08:00
Meghan Denny
0491ff4186
tidy: remove some redundant bun.toFD calls ( #8136 )
...
* remove some redundant bun.toFD calls
* windows fix
2024-01-12 19:46:56 -08:00
Meghan Denny
943c72c8a1
allow StringOrTinyString to hold 31 bytes ( #8134 )
2024-01-12 19:43:50 -08:00
Meghan Denny
cb6f4b9f4d
tidy: remove if(false) dead block ( #8129 )
...
* remove if(false) dead block
* remove if (true) {...}
---------
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com >
2024-01-12 18:18:19 -08:00
Meghan Denny
45bd2264e3
more small undefined fixes ( #8133 )
2024-01-12 18:17:53 -08:00