summaryrefslogtreecommitdiff
path: root/ext/node
AgeCommit message (Collapse)Author
2023-04-20refactor(ext/node): remove polyfills/_core.ts (#18766)Yoshiya Hinosawa
2023-04-19fix(ext/node): implement asymmetric keygen (#18651)Divy Srivastava
Towards #18455 This commit implements the keypair generation for asymmetric keys for the `generateKeyPair` API. See how key material is managed in this implementation: https://www.notion.so/denolandinc/node-crypto-design-99fc33f568d24e47a5e4b36002c5325d?pvs=4 Private and public key encoding depend on `KeyObject#export` which is not implemented. I've also skipped ED448 and X448 since we need a crate for that in WebCrypto too.
2023-04-19fix(ext/node): improve vm.runInThisContext (#18767)Yoshiya Hinosawa
2023-04-19fix(ext/node): add crypto.sign|verify methods (#18765)Yoshiya Hinosawa
2023-04-18chore: forward v1.32.5 release commit to main (#18758)denobot
Co-authored-by: levex <levex@users.noreply.github.com> Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
2023-04-18refactor(node/crypto): scrypt polyfill to rust (#18746)Levente Kurusa
2023-04-18fix(ext/node): implement crypto.createVerify (#18703)Yoshiya Hinosawa
2023-04-18fix(path): Remove non node symbols (#18630)Ryan Clements
- preserve referential invariants (e.g. path.posix === posix) - remove glob and separator exports - save removal of fromFileUrl and toFileUrl for a different PR as that refactor is more involved - addresses #18177
2023-04-18fix(ext/node): add req.socket.remoteAddress (#18733)Yoshiya Hinosawa
2023-04-18fix(ext/node): polyfill response._implicitHeader method (#18738)Yoshiya Hinosawa
2023-04-13refactor(cli,ext,ops): cleanup `regex` with `lazy-regex` (#17296)Yiyu Lin
- bump deps: the newest `lazy-regex` need newer `oncecell` and `regex` - reduce `unwrap` - remove dep `lazy_static` - make more regex cached --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-12chore: forward v1.32.4 release commit to main (#18669)denobot
Co-authored-by: levex <levex@users.noreply.github.com>
2023-04-12refactor(node/crypto): port polyfill to Rust for randomInt, randomFill, ↵Levente Kurusa
randomFillSync (#18658) Pretty much as per the title, I'd welcome some feedback especially around the array/buffer handling in the two randomFill functions.
2023-04-07chore: fix linting on main (#18633)David Sherret
2023-04-07fix(ext/node): add X509Certificate (#18625)Divy Srivastava
Towards #18455
2023-04-07refactor(ext/node): remove conditional in ServerResponse#enqueue (#18617)Bartek Iwańczuk
It's superfluous, the issue linked is no longer relevant. Closes https://github.com/denoland/deno/issues/18579
2023-04-06fix(ext/node): implement hkdf-expand (#18612)Divy Srivastava
Towards https://github.com/denoland/deno/issues/18455
2023-04-06refactor(ext/node): `NodeFs` - add back altered metadata method (#18613)David Sherret
From https://github.com/denoland/deno/pull/18604/files#r1159992299 We should still have a `metadata` method because it's one system call instead of two on most platforms.
2023-04-06fix(ext/node): fix unable to resolve fraction.js (#18544)Marvin Hagemeister
Turns out `autoprefixer` is a better reproduction case then `microbundle`. Fixes #18535 Fixes #18600 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-06fix(ext/node): add symmetric keygen (#18609)Divy Srivastava
Towards #18455
2023-04-06refactor(ext/node): add more methods to 'NodeFs' trait (#18604)Bartek Iwańczuk
Added more methods to `ext/node/clippy.toml` that are not allowed to be used in the crate. Prerequisite for https://github.com/denoland/deno/pull/18544
2023-04-06fix(ext/node): json encode binary command name (#18596)Geert-Jan Zwiers
Fixes https://github.com/denoland/deno/issues/18588
2023-04-05tests: cleanup "node_compat_tests" (#18594)Bartek Iwańczuk
A few drive-by cleanup while I'm working on the "crypto" module. It makes it easier and faster to debug the failing test case.
2023-04-04refactor(core): Improve ergonomics of managing ASCII strings (#18498)Matt Mastracci
This is a follow-on to the earlier work in reducing string copies, mainly focused on ensuring that ASCII strings are easy to provide to the JS runtime. While we are replacing a 16-byte reference in a number of places with a 24-byte structure (measured via `std::mem::size_of`), the reduction in copies wins out over the additional size of the arguments passed into functions. Benchmarking shows approximately the same if not slightly less wallclock time/instructions retired, but I believe this continues to open up further refactoring opportunities.
2023-04-03refactor(ext/node): migrate "http" module to use "Deno.serveHttp" API (#18552)Bartek Iwańczuk
This commit changes "node:http" module to use "Deno.serveHttp" API instead of "Deno.serve" API. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-04-01chore: forward v1.32.3 release commit to main (#18561)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-04-01chore: forward v1.32.2 release commit to main (#18539)denobot
This is the release commit being forwarded back to main for 1.32.2
2023-03-31perf(ext/websocket): use opAsync2 to avoid spread deopt (#18525)Divy Srivastava
This commit adds a new core API `opAsync2` to call an async op with atmost 2 arguments. Spread argument iterators has a pretty big perf hit when calling ops. | name | avg msg/sec/core | | --- | --- | | 1.32.1 | `127820.750000` | | #18506 | `140079.000000` | | #18506 + #18509 | `150104.250000` | | #18506 + #18509 + this | `157340.000000` |
2023-03-30Revert "refactor(ext/node): Use Deno.inspect (#17960)" (#18491)Bartek Iwańczuk
This reverts commit a3529d02329e0d2127ad2a5bb78b4c476ddd6984. This change made debugging Node tests very hard - `AssertionError` is now printed as `[Circular *1]` giving no visibility what failed. We need to align two implementations together and remove this one then.
2023-03-30refactor(ext/node): add NodeEnv::Fs associated type (#18484)Bartek Iwańczuk
This commit adds associated type to "NodeEnv" trait, called "Fs". The "Fs" type has a trait bound on "NodeFs", which specifies APIs required for all ops and resolution APIs to function. A "RealFs" implementation of "NodeFs" is exported from the "deno_node" crate, that provides a default implementation for the trait. All code in "deno_node" extension was changed to use the "NodeFs" trait to handle file system operations, instead of relying on APIs from the standard library.
2023-03-28refactor(ext/node): change extension type parameter (#18483)Bartek Iwańczuk
This commit changes the type parameter for "deno_node" extension, from `P: NodePermission` to `Env: NodeEnv`. `NodeEnv` is a new trait that has associated type `P: NodePermission`. This is a stepping stone to support swappable file system for the extension, that will be added as a second associated type to the `NodeEnv` trait.
2023-03-28fix(ext/node): implement crypto.Sign (RSA/PEM/SHA{224,256,384,512}) (#18471)Yoshiya Hinosawa
2023-03-28Reland "refactor: remove Deno[Deno.internal].nodeUnstable namespace" (#18475)Bartek Iwańczuk
This reverts commit 357bcfcf79fee92195e37bb3f05e247908f207c5.
2023-03-28feat(ext/node): add `crypto.checkPrime` API (#18465)Divy Srivastava
Towards #18455 This commit implements `checkPrimeSync` and `checkPrime` in node:crypto using the Miller-Rabin primality test (fun fact: it actually is a test for composite numbers) It first compares the candidate against many known small primes and if not, proceeds to run the Miller-Rabin primality test. http://nickle.org/examples/miller-rabin.5c used as reference implementation.
2023-03-28chore(ext/node): port pbkdf2 to Rust (#18470)Divy Srivastava
Towards #18455
2023-03-27fix(ext/node): add missing _preloadModules hook (#18447)Marvin Hagemeister
This internal node hook is used by libraries such as `ts-node` when used as a require hook `node -r ts-node/register`. That combination is often used with test frameworks like `mocha` or `jasmine`. We had a reference to `Module._preloadModules` in our code, but the implementation was missing. While fixing this I also noticed that the `fakeParent` module that we create internally always threw because of the `pathDirname` check on the module id in the constructor of `Mdoule`. So this code path was probably broken for a while. ```txt ✖ ERROR: Error: Empty filepath. at pathDirname (ext:deno_node/01_require.js:245:11) at new Module (ext:deno_node/01_require.js:446:15) at Function.Module._resolveFilename (ext:deno_node/01_require.js:754:28) at Function.resolve (ext:deno_node/01_require.js:1015:19) ```
2023-03-27feat: port node:zlib to rust (#18291)Divy Srivastava
2023-03-27Revert "refactor: remove Deno[Deno.internal].nodeUnstable namespace (… ↵Bartek Iwańczuk
(#18458) …#18449)" This reverts commit d1a9c4cd7ce0c19ddf9c7c52c0d35d6124a7677d. Appears this made CI very flaky on macOS, but I can't repeat it locally yet
2023-03-27refactor: remove Deno[Deno.internal].nodeUnstable namespace (#18449)Bartek Iwańczuk
Since we can preserve ops in the snapshot these days, we no longer need to have "Deno[Deno.internal].nodeUnstable" namespace. Instead, various built-in Node.js modules can use appropriate APIs directly.
2023-03-25fix(ext/node): add aes-128-ecb algorithm support (#18412)Yoshiya Hinosawa
2023-03-24feat(ext/node): implement crypto.createSecretKey (#18413)Divy Srivastava
This commit adds the `crypto.createSecretKey` API. Key management: This follows the same approach as our WebCrypto CryptoKey impl where we use WeakMap for storing key material and a handle is passed around, such that (only internal) JS can access the key material and we don't have to explicitly close a Rust resource. As a result, `createHmac` now accepts a secret KeyObject. Closes https://github.com/denoland/deno/issues/17844
2023-03-24fix(ext/node): make cipher/decipher transform stream (#18408)Yoshiya Hinosawa
2023-03-23fix(core): panic at build time if extension code contains anything other ↵Matt Mastracci
than 7-bit ASCII (#18372) This will improve diagnostics and catch any non-ASCII extension code early. This will use `debug_assert!` rather than `assert!` to avoid runtime costs, and ensures (in debug_assert mode only) that all extension source files are ASCII as we load them.
2023-03-23chore: forward v1.32.1 release commit to main (#18399)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-23refactor(ext/node): Use Deno.inspect (#17960)Ryan Dahl
No need for two almost identical implementations of the same thing --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com> Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-03-22chore: update ext/ code to only use ASCII (#18371)Matt Mastracci
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-221.32.0 (#18367)denobot
Bumped versions for 1.32.0 --------- Co-authored-by: mmastrac <mmastrac@users.noreply.github.com> Co-authored-by: Matt Mastracci <matthew@mastracci.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-03-22feat(ext/kv): key-value store (#18232)Heyang Zhou
This commit adds unstable "Deno.openKv()" API that allows to open a key-value database at a specified path. --------- Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-21perf(core) Reduce script name and script code copies (#18298)Matt Mastracci
Reduce the number of copies and allocations of script code by carrying around ownership/reference information from creation time. As an advantage, this allows us to maintain the identity of `&'static str`-based scripts and use v8's external 1-byte strings (to avoid incorrectly passing non-ASCII strings, debug `assert!`s gate all string reference paths). Benchmark results: Perf improvements -- ~0.1 - 0.2ms faster, but should reduce garbage w/external strings and reduces data copies overall. May also unlock some more interesting optimizations in the future. This requires adding some generics to functions, but manual monomorphization has been applied (outer/inner function) to avoid code bloat.
2023-03-20refactor(ext/node): untangle dependencies between js files (#18284)Bartek Iwańczuk
Moving some code around in `ext/node` is it's a bit better well defined and makes it possible for others to embed it. I expect to see no difference in startup perf with this change.