dave caruso
1bf540efcf
feat: allow "bun:test" utilities at runtime ( #7486 )
...
* feat: allow "bun:test" utilities at runtime
* fsdafdsafd
* yippee
2023-12-06 22:09:43 -08:00
Jérôme Benoit
6a5995e27d
test(worker): refactor worker tests ( #6732 )
...
* test(worker): refactor worker tests
+ constify variables
+ typing
+ untangle web worker from worker_threads tests
+ cleanup variables namespace
no functional changes on tests
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: move worker_threads related code to node/worker_threads
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: move worker tests into workers directory
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* refactor: report upstream changes
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* refactor: report upstream change
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* fix: address review comments
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* chore: fix submodule
---------
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
Co-authored-by: dave caruso <me@paperdave.net >
2023-12-06 17:06:11 -08:00
Vlad Sirenko
f0e0c6d5df
fix: improve compatibility of http.ServerResponse ( #4431 )
2023-12-05 16:15:16 -08:00
Jarred Sumner
03298cba70
Disable parseArgs implementation until https://github.com/oven-sh/bun/pull/7310#issuecomment-1837135393 is addressed
2023-12-02 04:29:13 -08:00
Dylan Conway
d79fa7ac1a
remove bun.parseargs and update docs
2023-11-30 18:04:48 -08:00
Otger Rogla
70039ff038
feat(parseArgs): Native implementation of parseArgs from node:util ( #7310 )
...
* Native implementation of parseArgs from node:util
* small change to validators + added some docs
2023-11-30 16:34:44 -08:00
Jérôme Benoit
a043497fb4
fix(worker_threads): do not terminate worker at parentPort closing ( #7238 )
...
* fix(worker_threads): do not crash worker at parentPort closing
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* doc: add TODO comment as per review request
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
---------
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
2023-11-28 11:44:01 -08:00
Jérôme Benoit
44b9960113
fix(worker_threads): make onmessageerror setter work ( #7237 )
...
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
2023-11-27 19:32:24 -08:00
Sam
194294f5b5
fix(node:fs): fix fs.promises.opendir not having a path property ( #7292 )
...
Closes #4995
2023-11-24 19:11:45 -08:00
Ciro Spaciari
53ee2d77b2
fix(crypto) oneshot Sign and Verify ( #7256 )
...
* WIP
* native oneshot sign
* add native verify
* fallback rsa to non-native
* WIP der dsaEncoding
* pass encoding
* RSA-PSS padding and saltLength
* oopies
* improve RSA-PSS support
* accepts hash identifiers like nodejs and add options.hashAlgorithm support
* fix string check
* tests
* define hash for ECDSA
* fix compilation
2023-11-24 18:43:17 -08:00
Jarred Sumner
ef8b9efaa4
Fixes #7201
2023-11-18 22:24:49 -08:00
Ciro Spaciari
c23579d66c
feat(http2) Client Support ( #6761 )
...
* init
* WIP fix post data/refactor
* make it compile again
* more things
* undo padding and continue + fix posting + update lshpack
* re-add fixes
* really simple tests + fixes
* add aborted event
* fix trailers
* add getDefaultSettings, getPackedSettings and getUnpackedSettings
* fix + fmt
* fixes
* fix enablePush o be boolean
* fix sendTrailers
* fmt
* fix goaway, fix some error messages
* oops
* revert some changes
* more reverts
* WIP
* get CMAKE building lspack + ping behavior
* remove files that should not be added anymore
* remove old out files
* remove old file
* fix header reduce
* bunch of fixes
* fix socket unref
* fix abort signal, rebase and fmt
* socket unref tests
* oops re-add cmake
* fix stream state
* more tests and fixes
* fixes and ping tests
* lshpack in Dockerfile
* just copy lshpack
* oops
* fix end
* wantTrailers
* encode/decode fixes + grpc
* channel credentials test
* rebase
* support h2c
* fix h2c
* fix h2c connect event + h2c tests
* 'copy ls-hpack
* ls-hpack build sh
* oops
* changing CMake + Docker
* add ps1 build for ls-hpack fix clean
* optimizations + fixes
* remove protect/unprotect from handlers
* more consistent errors
* fix error code
* oops
* add goaway tests
* oops uncoment tests
* better errors more tests
* add broken priority frame
* better memory leak, some fixes and less flask tests
* zig update .Big -> .big
* closer threshold + h2 fix
* remove log
* test should not be flask
* increase timeout on leak memory test
* windows build
* less flasky
* always 127.0.0.1
* [autofix.ci] apply automated fixes
* remove .call and use primordials
* apply socket fix
* fix win-build
* should properly mark inactive
* postgres fix
* increase deadline
* test tests
* high light deadline timeouts
* event loop test
* make memory leak test faster
* use buffer on payload test
* check for socket.data before use
* reduce iterations to see if timeout on mac intel
* fix assertions
* avoid localhost and simplify things
* refactor memory leak test
* Update src/js/node/tls.js
* fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciai@gmail.com >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-11-17 18:14:54 -08:00
HK-SHAO
606c80b049
Fix the TypeError of isValidTLSArray for http ( https://github.com/oven-sh/bun/issues/7153 ) ( #7154 )
2023-11-16 23:41:19 -08:00
Anton Golub
8f3e278ab9
Add stubs for zlib.brotli* ( #7096 )
2023-11-14 08:52:42 -08:00
Ciro Spaciari
273f612c77
fix(async_hooks) fix disable and disable test ( #7090 )
...
* fix disable
* test should fail on exception
* oops
2023-11-13 13:21:27 -08:00
Meghan Denny
84414f8fe8
fix fs.read being passed to util.promisify ( #6999 )
...
* fix fs.read being passed to util.promisify
* Update test/js/node/fs/fs.test.ts
* Update test/js/node/fs/fs.test.ts
* Update src/js/node/fs.js
* Fix write, add more tests, clean up the code
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-11-09 20:00:41 -08:00
Ciro Spaciari
046d197519
fix asyncLocalStorage disabled ( #7015 )
2023-11-09 17:51:49 -08:00
Jarred Sumner
b52e503ce4
Fixes #6973 ( #6975 )
...
Fixes #6973
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-11-07 16:42:25 -08:00
Jarred Sumner
3ba9647858
Fix a couple bugs with node:http ( #6924 )
...
* Update to latest SIMDUTF
* Fix issue with `Headers.toJSON` having an incorrect size set with set-cookie header
* [node:http] Fix `undefined` when multiple Set-Cookie headers are sent
* Count UTF8 byteLength for headers
This is not necessary, just being cautious.
* Update http-hello.node.mjs
* Be 100% sure the test isn't caching anything
* move this up
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-11-06 03:51:49 -08:00
Anton Golub
732650d6a4
fix: provide nodejs compat for dns methods wrapped with util.promisify ( #6748 )
...
* fix: add nodejs compat for dns methods wrapping with util.promisify
* fix: use single symbol for util.promisify.custom
* style: linting
2023-10-30 23:54:48 -07:00
Ciro Spaciari
4d780837ac
fix(fetch) ( #6672 )
...
* fix fetch
* oops
* revert
* fix checkServerIdentity
* check dns len
* use same checks on wsclient and fetch, fix tests
* more tests and more fixes
* fix node-http flask test
* orelse
* fix requestCert
* more fixes, but no data receiving
* fix pause on connect behavior on TLS
* WS Client + rejectUnauthorized progress
* move test to the right place
* more test
* oops
* oops 2
* fmt
* cleanup
* WIP: handle handshake properly on uWS
* handle rejectUnauthorized in uWS
* fmt
* duplicated test
* fix leak
* add rejectUnauthorized option in WS types
* fix merge
* fix merge2
2023-10-30 12:56:31 -07:00
Jérôme Benoit
85a0d71c52
fix(worker_threads): off by one on threadId ( #6671 )
...
* fix(worker_threads): off by one on threadId
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: refine worker_threads threadId consistency test
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: improve worker_threads tests
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: fix worker_threads threadId consistency test
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: simplify worker_threads threadId consistency test
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: refine worker_threads threadId consistency test
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org >
* refactor: cleanup import on worker_threads tests
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: switch worker_threads worker to TS
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: revert wrong refactoring
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: format
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: port worker_threads worker to ESM
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: cleanup worker_threads test
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: improve worker_threads coverage
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org >
---------
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org >
2023-10-24 17:05:22 -07:00
Dmitry Nourell
7166fe10b5
Fixes IV calculation for AES-GCM mode ( #6590 )
...
* fix(crypto): fix the error in IV calculation for AES-GCM mode
* chore(crypto): add basic unit tests for Cipher & Decipher
2023-10-20 14:01:58 -07:00
Ai Hoshino
e91436e524
fix(node:http): fix server.address() ( #6442 )
...
Closes #6413 , #5850
2023-10-17 13:18:14 -07:00
dave caruso
98d19fa624
fix(runtime): make some things more stable (partial jsc debug build) ( #5881 )
...
* make our debug assertions work
* install bun-webkit-debug
* more progress
* ok
* progress...
* more debug build stuff
* ok
* a
* asdfghjkl
* fix(runtime): fix bad assertion failure in JSBufferList
* ok
* stuff
* upgrade webkit
* Update src/bun.js/bindings/JSDOMWrapperCache.h
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
* fix message for colin's changes
* okay
* fix cjs prototype
* implement mainModule
* i think this fixes it all
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2023-10-16 21:22:43 -07:00
dave caruso
a3958190e8
fix(runtime): improve IPC reliability + organization pass on that code ( #6475 )
...
* dfghj
* Handle messages that did not finish
* tidy
* ok
* a
* Merge remote-tracking branch 'origin/main' into dave/ipc-fixes
* test failures
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2023-10-16 20:01:24 -07:00
Yannik Schröder
0853e19f53
perf(node:events): optimize emit(...) function ( #5485 )
2023-10-16 16:18:40 -07:00
Jérôme Benoit
d9c0273421
fix(node:worker_threads): ensure threadId property is exposed on worker_threads instance ( #6521 )
...
* fix: ensure threadId property is exposed on worker_threads instance
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* fix: rename lazy worker_threads module properties
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* fix: add getter for threadId
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: improve worker_threads UTs
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: fix lazy loading
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: fix worker_threads test
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org >
* fix: return the worker threadId
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
* test: refine worker_threads expectation on threadId
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org >
---------
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com >
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org >
2023-10-16 15:19:38 -07:00
Ciro Spaciari
a87aa2fafe
fix(net/tls) fix pg hang on end + hanging on query ( #6487 )
...
* fix pg hang on end + hanging on query
* remove dummy function
* fix node-stream
* add test
* fix test
* return error in test
* fix test use once instead of on
* fix OOM
* generated
* 💅
* 💅
2023-10-14 16:16:49 -07:00
Jarred Sumner
d7062eb367
[node:dns] Fix unnecessary array creation + prettier
2023-10-13 17:57:43 -07:00
João Alisson
851dc9aadc
fix(node): dns lookup deprecated behavior ( #6391 )
...
Co-authored-by: alisson <alisson@Ubuntu.myguest.virtualbox.org >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2023-10-13 17:52:57 -07:00
Ciro Spaciari
6301778a58
fix(AbortSignal/fetch) fix AbortSignal.timeout, fetch lock behavior and fetch errors ( #6390 )
...
* fix abort signal and fetch error
* fix fetch error and lock behavior
2023-10-09 19:56:48 -07:00
Ciro Spaciari
35109160ca
feat(KeyObject) ( #5940 )
...
* oops
* createSecretKey but weird error
* use the right prototype, do not add a function called export lol
* HMAC JWT export + base64 fix
* Fix Equals, Fix Get KeySize, add complete export RSA
* fix RSA export
* add EC exports
* X25519 and ED25519 export + fixes
* fix default exports
* better asymmetricKeyType
* fix private exports
* fix symmetricKeySize
* createPublicKey validations + refactor
* jwt + der fixes
* oopsies
* add PEM into createPublicKey
* cleanup
* WIP
* bunch of fixes
* public from private + private OKP
* encrypted keys fixes
* oops
* fix clear tls error, add some support to jwk and other formats on publicEncrypt/publicDecrypt
* more fixes and tests working
* more fixes more tests
* more clear hmac errors
* more tests and fixes
* add generateKeyPair
* more tests passing, some skips
* fix EC key from private
* fix OKP JWK
* nodejs ignores ext and key_ops on KeyObject.exports
* add EC sign verify test
* some fixes
* add crypto.generateKeyPairSync(type, options)
* more fixes and more tests
* fix hmac tests
* jsonwebtoken tests
* oops
* oops2
* generated files
* revert package.json
* vm tests
* todos instead of failues
* toBunString -> toString
* undo simdutf
* improvements
* unlikely
* cleanup
* cleanup 2
* oops
* move _generateKeyPairSync checks to native
2023-10-07 15:22:45 -07:00
Colin McDonnell
323ae0f2a3
Update Node.js compat docs ( #6282 )
...
* Update nodejs-apis
* No commas
* Updates
2023-10-05 16:03:21 -07:00
Jarred Sumner
5c8233515a
Fix query property of url object ( #6274 )
...
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-10-04 21:31:29 -07:00
Colin McDonnell
5da79a8366
Closes #6309 ( #6310 )
2023-10-04 21:28:23 -07:00
dave caruso
eddb0078b5
fix(runtime): followup for server.requestIP ( #6185 )
...
* fix(runtime): followup for `server.requestIP`
* oops
* yeah
* sure
* Update src/deps/libuwsockets.cpp
* Update Dockerfile
* lol
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-09-29 16:17:54 -07:00
dave caruso
72bdd380af
add Socket.prototype; lol ( #5945 )
2023-09-29 15:42:06 -07:00
dave caruso
6afa78120a
feat(runtime): implement server.requestIp + node:http socket.address() ( #6165 )
...
* [server] requestIp and AnyRequestContext
Changed Request.uws_request to the new AnyRequestContext. This
allows grabbing the IP from a Request. Unfinished.
* [server] basic `requestIp` implementation
Currently using uws's requestIpAsText, which always returns a ipv6
string. We should return a `SocketAddress` object to the user instead,
which will contain the formatted address string and what type it is.
We'll have to use requestIpAsBinary and parse that ourselves.
* TypeScript docs, use `bun.String`, return `undefined` instead of `null`
if we can't get the ip.
* binary address formatting
* uws getRemoteAddress binding
* remove dead code
* working
* final touches✨
* I will abide by the results of this poll.
---------
Co-authored-by: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com >
2023-09-29 03:39:26 -07:00
dave caruso
387f1260c9
Get Next.js Pages Router to work ( #6095 )
...
* 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-28 03:53:24 -07:00
jhmaster
e60b3607c1
Complete rework of the majority of node:util, primarily util.inspect ( #4493 )
...
* 1st revision of new util.inspect impl. (not done)
* fix util.types.isArrayBuffer
* fix some utl tests and bugs
* fix node:tty missing primordials
* fix utl stackoverflow handling & some tests
* narrow down diff. context test
* util.inspect indirect circulars optimization
* temp workaround for buggy is...Function checks
* impl. Map/Set/Iterator entries inspection
* fix bigint & symbol objects inspection
* error inspection fixes
* misc util tests stuff
* inline getExternalValue stub
* leftovers
* util.inspect promise internals
* run bun fmt
* commit make js changes
* cut out unnecessary utl files
* reorganize utl folder structure
* remove browserify buffer check
* Try to revert git messing up uws somehow
This reverts commit 2c27e16e7d .
* commit src/js/out files again
* redo this edit too
* refresh js/out files
* Removed uws submodule
* tidy up
* unused primordials
* run fmt
---------
Co-authored-by: dave caruso <me@paperdave.net >
2023-09-27 23:51:49 -07:00
Ai Hoshino
a0081f9e29
fix(node:fs): fix fs.exists callback parameters ( #6097 )
...
Close : #6073
2023-09-27 03:40:45 -07:00
dave caruso
341c1c1804
disable child_process execArgv + fix crash in cli parsing ( #5843 )
...
* stuff
* stuff
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-09-21 20:37:32 -07:00
Liz
b297fabd17
fix: correctly pass the encrypted(bool) property on "Socket" for express.js ( #5878 )
...
* fix: correctly pass the encrypted property on "Socket" for express.js
Express relies on this for setting the requests protocol.
Since this is on a dummy object, a property is simply set with the actual value.
Which seams okay as a workaround.
* chore: add generated files
* chore: add test
* refactor: set property directly rather then through a getter
2023-09-21 18:44:05 -07:00
dave caruso
b7951511a3
fix(run): interpret extensionless files as typescript ( #5711 )
...
* test
* gadsgsagdsa
* add better err msg
* r
* oops
* ok
2023-09-20 19:48:46 -07:00
Ai Hoshino
7319142fd8
feat(node:dns): implement dns.lookupService ( #5613 )
...
* feat(node:dns): implement dns.lookupService
Close : #4347
* fix flags
* add `getSockaddr`
* fix sockaddr size
* flaky test
2023-09-20 18:43:08 -07:00
dave caruso
333e217c32
feat(runtime): Implement console.Console ( #5448 )
...
* prototype
* asdfg
* It works!
* okay its done now fr
* self review
* ok
* fix
* fix test
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2023-09-18 16:29:56 -07:00
dave caruso
f77df12894
Fix HTTP listen behavior being non-compliant with node ( #5689 )
...
* Fix HTTP listen behavior being non-compliant with node
* Add error code for address in use
* use SystemError
---------
Co-authored-by: SuperAuguste <19855629+SuperAuguste@users.noreply.github.com >
2023-09-18 14:57:48 -07:00
Jarred Sumner
a39b0d86a0
Fixes #5465 ( #5468 )
...
* Fixes #5465
Fixes #5465
* Update tty.js
* Update InternalModuleRegistryConstants.h
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2023-09-15 06:53:39 -07:00
Dylan Conway
94e9f8bdca
fix http set cookie headers ( #5428 )
...
* allow multiple set-cookie values
* make it work for `getHeader`
* move `getHeader` to cpp
* remove set-cookie check
* move `setHeader` to cpp
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2023-09-14 23:03:20 -07:00