summaryrefslogtreecommitdiff
path: root/ext/node
AgeCommit message (Collapse)Author
2024-11-19feat(ext/node): perf_hooks.monitorEventLoopDelay() (#26905)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20961 Depends on https://github.com/denoland/deno_core/pull/965 and https://github.com/denoland/deno_core/pull/966
2024-11-19fix(node/crypto): support promisify on generateKeyPair (#26913)Marvin Hagemeister
Calling `promisify(generateKeyPair)` didn't work as expected. It requires a custom promisify implementation. This was easy to fix thanks to the excellent debugging investigation in https://github.com/denoland/deno/issues/26910 Fixes https://github.com/denoland/deno/issues/26910 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-16fix(ext/node): New async setInterval function to improve the nodejs ↵/usr/bin/cat
compatibility (#26703) Closes #26499
2024-11-15refactor: use boxed_error in some places (#26887)David Sherret
2024-11-14refactor(resolver): move more resolution code into deno_resolver (#26873)David Sherret
Follow-up to cjs refactor. This moves most of the resolution code into the deno_resolver crate. Still pending is the npm resolution code.
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-11-13fix(ext/node): zlib.crc32() (#26856)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26845
2024-11-13fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented (#26853)Divy Srivastava
2024-11-13feat(ext/fs): add ctime to Deno.stats and use it in node compat layer (#24801)Łukasz Czerniawski
This PR fixes #24453, by introducing a ctime (using ctime for UNIX and ChangeTime for Windows) to Deno.stats. Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-11-13fix(ext/node): process.getBuiltinModule (#26833)Divy Srivastava
Closes https://github.com/denoland/deno/issues/26832
2024-11-12fix(ext/node): add autoSelectFamily option to net.createConnection (#26661)Yoshiya Hinosawa
2024-11-10chore: forward v2.0.6 release commit to main (#26804)denobot
This is the release commit being forwarded back to main for 2.0.6 Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-06refactor: use concrete error type for remaining ops (#26746)Leo Kettmeir
2024-11-06fix(node:zlib): gzip & gzipSync should accept ArrayBuffer (#26762)Satya Rohith
Closes https://github.com/denoland/deno/issues/26638
2024-11-06fix(ext/node): better inspector support (#26471)snek
implement local inspector future changes: - wire up InspectorServer to enable open/close/url - wire up connectToMainThread Fixes https://github.com/denoland/deno/issues/25004
2024-11-06chore: forward v2.0.5 release commit to main (#26755)denobot
This is the release commit being forwarded back to main for 2.0.5 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-11-04fix(ext/node): add `findSourceMap` to the default export of `node:module` ↵Nathan Whitaker
(#26720) Next.js 15.0.2 tries to use this and errors out
2024-11-04refactor(runtime/permissions): use concrete error types (#26464)Leo Kettmeir
2024-11-04chore: update dlint to v0.68.0 for internal (#26711)Kenta Moriuchi
2024-11-01fix: improved support for cjs and cts modules (#26558)David Sherret
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-01chore: upgrade to rust 1.82 and LLVM 19 (#26615)Divy Srivastava
Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because `requestAdapter` not working on new ubuntu 24 runners
2024-10-31fix(node): Implement `os.userInfo` properly, add missing `toPrimitive` (#24702)Nathan Whitaker
Fixes the implementation of `os.userInfo`, and adds a missing `toPrimitive` for `tmpdir`. This allows us to enable the corresponding node_compat test.
2024-10-31fix(ext/node): resolve exports even if parent module filename isn't present ↵Nathan Whitaker
(#26553) Fixes https://github.com/denoland/deno/issues/26505 I'm not exactly sure how this case comes about (I tried to write tests for it but couldn't manage to reproduce it), but what happens is the parent filename ends up null, and we bail out of resolving the specifier in package exports. I've checked, and in node the parent filename is also null (so that's not a bug on our part), but node continues to resolve even in that case. So this PR should match node's behavior more closely than we currently do.
2024-10-31fix(ext/node): convert errors from `fs.readFile/fs.readFileSync` to node ↵Nathan Whitaker
format (#26632) Fixes the original issue reported in #26404. storybook runs into other errors after this PR (the new errors will be fixed in other PRs). Some code used by a dependency of storybook does a [string comparison on the error message](https://github.com/chromaui/chromatic-cli/blob/ce30b2be343cb96a0826390b95ea42befb2be547/node-src/lib/getConfiguration.ts#L88-L92) thrown here to check for a file not found error.
2024-10-31fix: clamp smi in fast calls by default (#26506)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26480 Ref https://github.com/denoland/deno_core/commit/d2945fb65bca56ebfa7bb80556a4c8f4330d2315
2024-10-30fix: remove permission check in op_require_node_module_paths (#26645)David Sherret
2024-10-30fix(ext/node): return `this` from `http.Server.ref/unref()` (#26647)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26642
2024-10-30chore: forward v2.0.4 release commit to main (#26636)denobot
This is the release commit being forwarded back to main for 2.0.4 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-29Revert "fix(ext/node): fix dns.lookup result ordering (#26264)" (#26621)Yoshiya Hinosawa
This reverts commit d59599fc187c559ee231882773e1c5a2b932fc3d. Closes #26588
2024-10-29fix(ext/node): compatibility with {Free,Open}BSD (#26604)Volker Schlecht
Ports for both BSDs contain patches to the same effect. See https://github.com/freebsd/freebsd-ports/blob/main/www/deno/files/patch-ext_node_ops_fs.rs and https://github.com/openbsd/ports/blob/8644910cae24458306b6a7c4ef4ef7811bc3d1f5/lang/deno/patches/patch-ext_node_ops_fs_rs
2024-10-29Revert "fix(ext/node): use primordials in `ext/node/polyfills/https.ts` ↵Bartek Iwańczuk
(#26323)" (#26613) …s` (#26323)" This reverts commit afb33b3c2597c9ec943f71218b236486fbc86e23. Reverting because it caused a regression - https://github.com/denoland/deno/issues/26612. Closes https://github.com/denoland/deno/issues/26612.
2024-10-28fix: report exceptions from nextTick (#26579)snek
Fixes: https://github.com/denoland/deno/issues/24713 Fixes: https://github.com/denoland/deno/issues/25855
2024-10-27fix(ext/node): add path to `fs.stat` and `fs.statSync` error (#26037)familyboat
2024-10-26fix(ext/node): use primordials in ↵Mayank Kumar
ext\node\polyfills\internal\crypto\_randomInt.ts (#26534) Towards #24236
2024-10-25chore: forward v2.0.3 commit to main (#26535)Bartek Iwańczuk
Forwarding v2.0.3 commit to `main` Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-25fix(ext/node): refactor http.ServerResponse into function class (#26210)Nicola Bovolato
While testing, I found out that light-my-request relies on `ServerResponse.connection`, which is deprecated, so I added that and `socket`, the non deprecated property. It also relies on an undocumented `_header` property, apparently for [raw header processing](https://github.com/fastify/light-my-request/blob/v6.1.0/lib/response.js#L180-L186). I added it as an empty string, feel free to provide other approaches. Fixes #19901 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-24refactor(ext/node): use concrete error types (#26419)Leo Kettmeir
2024-10-24fix(node/util): support array formats in `styleText` (#26507)Marvin Hagemeister
We missed adding support for an array of formats being passed to `util.styleText`. Fixes https://github.com/denoland/deno/issues/26496
2024-10-24fix(ext/node): cancel pending ipc writes on channel close (#26504)Nathan Whitaker
Fixes the issue described in https://github.com/denoland/deno/issues/23882#issuecomment-2423316362. The parent was starting to send a message right before the process would exit, and the channel closed in the middle of the write. Unlike with reads, we weren't cancelling the pending writes, which resulted in a `Broken pipe` error surfacing to the user.
2024-10-23fix(node:tls): set TLSSocket.alpnProtocol for client connections (#26476)Satya Rohith
Towards https://github.com/denoland/deno/issues/26127
2024-10-23fix(ext/node): map `ERROR_INVALID_NAME` to `ENOENT` on windows (#26475)Yoshiya Hinosawa
In libuv on windows, `ERROR_INVALID_NAME` is mapped to `ENOENT`, but it is mapped to `EINVAL` in our compat implementation, which causes the issue #24899. ref: https://github.com/libuv/libuv/blob/d4ab6fbba4669935a6bc23645372dfe4ac29ab39/src/win/error.c#L138 closes #24899 closes #26411 closes #23635 closes #21165 closes #19067
2024-10-21fix(ext/node): use primordials in `ext/node/polyfills/https.ts` (#26323)jiang1997
Towards https://github.com/denoland/deno/issues/24236
2024-10-19perf: avoid multiple calls to runMicrotask (#26378)Divy Srivastava
Improves HTTP throughput by 8-9k rps on Linux: this patch ``` Requests/sec: 145001.69 Transfer/sec: 20.74MB ``` main ``` Requests/sec: 137866.61 Transfer/sec: 19.72MB ``` The improvements comes from the reduced number of calls to `op_run_microtask` per request. Returning `true` from a macrotask callback already calls `op_run_microtask` so the extra call was redundant. Here's `--strace-ops` output for a single request: main ``` [ 4.667] op_http_wait : CompletedAsync Async [ 4.667] op_run_microtasks : Dispatched Slow [ 4.668] op_http_try_wait : Dispatched Slow [ 4.668] op_http_try_wait : Completed Slow [ 4.668] op_http_wait : Dispatched Async [ 4.668] op_http_set_response_header : Dispatched Slow [ 4.668] op_http_set_response_header : Completed Slow [ 4.669] op_http_set_response_body_text : Dispatched Slow [ 4.669] op_http_set_response_body_text : Completed Slow [ 4.669] op_run_microtasks : Completed Slow [ 4.669] op_has_tick_scheduled : Dispatched Slow [ 4.669] op_has_tick_scheduled : Completed Slow [ 4.669] op_run_microtasks : Dispatched Slow [ 4.669] op_run_microtasks : Completed Slow [ 4.669] op_run_microtasks : Dispatched Slow [ 4.669] op_run_microtasks : Completed Slow ``` this pr ``` [ 3.726] op_http_wait : CompletedAsync Async [ 3.727] op_run_microtasks : Dispatched Slow [ 3.727] op_http_try_wait : Dispatched Slow [ 3.727] op_http_try_wait : Completed Slow [ 3.727] op_http_wait : Dispatched Async [ 3.727] op_http_set_response_header : Dispatched Slow [ 3.728] op_http_set_response_header : Completed Slow [ 3.728] op_http_set_response_body_text : Dispatched Slow [ 3.728] op_http_set_response_body_text : Completed Slow [ 3.728] op_run_microtasks : Completed Slow [ 3.728] op_run_microtasks : Dispatched Slow [ 3.728] op_run_microtasks : Completed Slow ```
2024-10-19refactor(ext/fetch): use concrete error types (#26220)Leo Kettmeir
2024-10-18fix(ext/node): stub HTTPParser internal binding (#26401)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26394.
2024-10-18fix(ext/node): properly map reparse point error in readlink (#26375)Nathan Whitaker
2024-10-18chore: forward v2.0.2 release commit to main (#26376)denobot
This is the release commit being forwarded back to main for 2.0.2 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-17fix(ext/node): add null check for kStreamBaseField (#26368)Bartek Iwańczuk
It's not guaranteed that `kStreamBaseField` is not undefined, so added a check for it. Closes https://github.com/denoland/deno/issues/26363
2024-10-17fix(node/fs): copyFile with `COPYFILE_EXCL` should not throw if the ↵Nathan Whitaker
destination doesn't exist (#26360) Fixes #26313. We were checking for the NotFound error, but still calling the callback with the error / throwing.
2024-10-17fix(net): don't try to set nodelay on upgrade streams (#26342)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26341. We try to call `op_set_nodelay` on an `UpgradeStream`, which doesn't support that operation.