summaryrefslogtreecommitdiff
path: root/ext/node/polyfills
AgeCommit message (Collapse)Author
2024-04-30fix(ext/node): support multiple message listeners on MessagePort (#23600)Satya Rohith
Closes https://github.com/denoland/deno/issues/23561
2024-04-30fix(ext/node): read(0) before destroying http2stream (#23505)Satya Rohith
This patch enables gRPC hello world client example to work. Towards #23246 #3326
2024-04-29fix(ext/node): exporting rsa public keys (#23596)Divy Srivastava
Initial support for exporting rsa public KeyObject. Current assumption is that RSA keys are stored in pkcs1 der format in key storage. Ref https://github.com/denoland/deno/issues/23471 Ref https://github.com/denoland/deno/issues/18928 Ref https://github.com/denoland/deno/issues/21124
2024-04-29refactor: remove dead code in node stream polyfill (#23597)Yoshiya Hinosawa
2024-04-29fix(ext/node): support NODE_DEBUG env (#23583)Satya Rohith
2024-04-29fix(ext/node): add support for MessagePort.removeListener/off (#23598)Satya Rohith
Closes https://github.com/denoland/deno/issues/23564
2024-04-27fix(ext/node): support process.stdin.unref() (#22865)Yoshiya Hinosawa
This PR adds private `[REF]()` and `[UNREF]()` methods to Stdin class, and call them from Node.js polyfill layer (`TTY` class). This enables `process.stdin.unref()` and `process.stdin.ref()` for the case when stdin is terminal. closes #21796
2024-04-24feat(ext/http): Implement request.signal for Deno.serve (#23425)Matt Mastracci
When the response has been successfully send, we abort the `Request.signal` property to indicate that all resources associated with this transaction may be torn down.
2024-04-24fix(ext/node): worker_threads copies env object (#23536)Bartek Iwańczuk
Most common argument to `env` option for `worker_threads.Worker` will be `process.env`. In Deno `process.env` is a `Proxy` which can't be cloned using structured clone algorithm. So to be safe, I'm creating a copy of actual object before it's sent to the worker thread. Ref #23522
2024-04-23fix: Float16Array support (#23512)Kenta Moriuchi
Ref #23490, #23277 * remove `--js-float16array` flag (This flag has already added to deno_core) * add some `Float16Array` support
2024-04-21fix(ext/node): define http.maxHeaderSize (#23479)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/23432
2024-04-20fix(ext/node): implement process.kill in Rust (#23130)Divy Srivastava
Closes https://github.com/denoland/deno/issues/23056
2024-04-20fix(ext/node): Support `env` option in worker_thread (#23462)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23455
2024-04-18fix(ext/node): Correctly send ALPN on node TLS connections (#23434)Matt Mastracci
Landing work from #21903, plus fixing a node compat bug. We were always sending the HTTP/2 ALPN on TLS connections which might confuse upstream servers. Changes: - Configure HTTP/2 ALPN when making the TLS connection from the HTTP/2 code - Read the `ALPNProtocols` property from the TLS connection options rather than the deno `alpnProtocols` field - Add tests Prereq for landing Deno.serveHttp on Deno.serve: removing older HTTP servers from the codebase.
2024-04-16fix(ext/node): dispatch beforeExit/exit events irrespective of listeners ↵Satya Rohith
(#23382) Closes https://github.com/denoland/deno/issues/23342 Closes https://github.com/denoland/deno/issues/21757
2024-04-16fix(ext/node): panic on 'worker_threads.receiveMessageOnPort' (#23386)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/23362 Previously we were panicking if there was a pending read on a port and `receiveMessageOnPort` was called. This is now fixed by cancelling the pending read, trying to read a message and resuming reading in a loop.
2024-04-15fix(ext/node): add stub for AsyncResource#asyncId() (#23372)Divy Srivastava
Ref https://github.com/denoland/deno/issues/23263
2024-04-13fix(ext/node): use ext/io stdio in WriteStream (#23354)Divy Srivastava
This is the same issue as https://github.com/denoland/deno/pull/23044 but in `WriteStream`. Adding a docusarus test in npm_smoke_tests repo.
2024-04-12chore: remove repetitive words (#23341)youngwendy
Signed-off-by: youngwendy <clonefetch@outlook.com>
2024-04-09fix(ext/node): implement MessagePort.unref() (#23278)Satya Rohith
Closes https://github.com/denoland/deno/issues/23252 Closes https://github.com/denoland/deno/issues/23264
2024-04-09fix(ext/node): `node:vm` contexts (#23202)Divy Srivastava
Implement contextified objects in `node:vm` Fixes https://github.com/denoland/deno/issues/23186 Fixes https://github.com/denoland/deno/issues/22395 Fixes https://github.com/denoland/deno/issues/20607 Fixes https://github.com/denoland/deno/issues/18299 Fixes https://github.com/denoland/deno/issues/19395 Fixes https://github.com/denoland/deno/issues/18315 Fixes https://github.com/denoland/deno/issues/18319 Fixes https://github.com/denoland/deno/issues/23183
2024-04-08fix(ext/node): out-of-order writes of fs.createWriteStream (#23244)Yoshiya Hinosawa
This PR follows this fix (https://github.com/nodejs/node/pull/52005) in Node.js. Stream's construct callback happens one tick earlier by this change, and it prevents the reordering of the first few chunks in `node:stream.Writable` closes #20284
2024-04-05fix(ext/node): hostname is valid IPv4 addr (#23243)Divy Srivastava
Fixes `docusaurus serve`
2024-04-05fix(ext/node): Add "module" to builtinsModule (#23242)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22731
2024-04-03refactor(ext/node): remove worker_threads dependency on ext:runtime (#23206)Satya Rohith
2024-04-03fix(ext/node): polyfill node:domain module (#23088)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/16852 --------- Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-04-03fix(ext/node): patch MessagePort if provided as workerData (#23198)Satya Rohith
MessagePort if directly assigned to workerData property instead of embedding it in an object then it is not patched to a NodeMessagePort. This commit fixes the bug.
2024-04-02fix(ext/node): Support returning tokens and option defaults in ↵Nathan Whitaker
`node:util.parseArgs` (#23192) Fixes #23179. Fixes #22454. Enables passing `{tokens: true}` to `parseArgs` and setting default values for options. With this PR, the observable framework works with deno out of the box (no unstable flags needed). The existing code was basically copied straight from node, so this PR mostly just updates that (out of date) vendored code. Also fixes some issues with error exports (before this PR, in certain error cases we were attempting to construct error classes that weren't actually in scope). The last change (in the second commit) adds a small hack so that we actually exercise the `test-parse-args.js` node_compat test, previously it was reported as passing though it should have failed. That test now passes. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-04-02feat: improve AsyncLocalStorage api (#23175)Alex Yang
Fixes: https://github.com/denoland/deno/issues/23174
2024-04-03chore: move `tools/node_compat` to `tests/node_compat/runner` (#23025)Asher Gomez
The `tools/node_compat/node` submodule has been moved to `tests/node_compat/runner/suite` and the remaining files within `tools/node_compat` to `tests/node_compat/runner`. Most of the changes are of the header within `tests/node_compat/test` files. The `setup` and `test` tasks within `tests/node_comapt` execute successfully. Towards #22525 CC @mmastrac
2024-04-02fix(ext/node): MessagePort works (#22999)Satya Rohith
Closes https://github.com/denoland/deno/issues/22951 Closes https://github.com/denoland/deno/issues/23001 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-04-01fix(ext/node): Add fs.readv, fs.readvSync (#23166)Nathan Whitaker
Part of #18218. Implements `fs.readv` and `fs.readvSync` and enables the corresponding `node_compat` tests.
2024-03-28fix(ext/node): support stdin: "inherit" in node:child_process (#23110)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23051
2024-03-28fix(ext/node): use tty stdin from ext/io (#23044)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23043
2024-03-24fix(ext/node): handle `null` in stdio array (#23048)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23045
2024-03-22perf: warm expensive init code at snapshot time (#22714)Matt Mastracci
Slightly different approach to similar changes in #22386 Note that this doesn't use a warmup script -- we are actually just doing more work at snapshot time.
2024-03-22fix(ext/node): handle KeyObject in `prepareAsymmetricKey` (#23026)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20938
2024-03-22fix(ext/node): add crypto.subtle (#23027)Divy Srivastava
Alias for `crypto.webcrypto.subtle`. https://nodejs.org/api/crypto.html#cryptosubtle
2024-03-22fix(ext/node): add crypto.getRandomValues (#23028)Divy Srivastava
Alias for `crypto.webcrypto.getRandomValues`
2024-03-21feat(ext/node): add riscv64 in process.arch (#23016)Eric Long
Rust triple for riscv64 is riscv64gc. Although there are no official builds for architectures other than x86_64 and aarch64, Arch Linux RISC-V has managed to package Deno on riscv64: https://github.com/felixonmars/archriscv-packages/blob/master/deno/riscv64.patch Ref: https://github.com/denoland/deno/issues/18702
2024-03-21fix(ext/node): ECDH.publicKey() point encoding (#23013)Divy Srivastava
2024-03-20fix(ext/node): spread args in setImmediate (#22998)Satya Rohith
Closes https://github.com/denoland/deno/issues/22997 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-03-20fix(ext/node): implement EventEmitterAsyncResource (#22994)Divy Srivastava
Fixes #22729
2024-03-20fix(ext/node): FsWatcher ref and unref (#22987)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22973 --------- Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-03-20fix(ext/node): add process.setSourceMapsEnabled noop (#22993)Satya Rohith
Closes https://github.com/denoland/deno/issues/22992
2024-03-20fix(ext/node): worker_threads ESM handling (#22841)mash-graz
Fixes #22840 Fixes #22964
2024-03-18fix(node): implement v8 serialize and deserialize (#22975)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22971
2024-03-18fix(ext/node): support public key point encoding in ECDH.generateKeys() (#22976)Satya Rohith
Towards https://github.com/denoland/deno/issues/22921 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-03-16fix(ext/node): pass normalized watchFile handler to StatWatcher (#22940)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22939
2024-03-15fix(ext/node): Reimplement StringDecoder to match node's behavior (#22933)Nathan Whitaker
Fixes #22158. Basically reimplements the whole `StringDecoder` with a much more direct translation (read like one-to-one) of node's current logic. The old implementation was closer to node's super old impl and it was too hard to keep the code structure while matching the behavior of their new logic. This adds support for UTF-16LE, ascii, and latin1. This also enables the node_compat test, which now passes without modification.