summaryrefslogtreecommitdiff
path: root/ext/node/lib.rs
AgeCommit message (Collapse)Author
2024-06-20fix(ext/node): use cppgc for node:zlib (#24267)Divy Srivastava
2024-06-18feat(ext/node): add BlockList & SocketAddress classes (#24229)Satya Rohith
Closes https://github.com/denoland/deno/issues/24059
2024-06-15fix(ext/node): better support for `node:diagnostics_channel` module (#24088)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/24060
2024-06-13chore(ext/node): remove old vm ops (#24187)Divy Srivastava
Unused; before the recent rewrite of node:vm
2024-06-12fix(ext/node): fix vm memory usage and context initialization (#23976)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22441 Fixes https://github.com/denoland/deno/issues/23913 Fixes https://github.com/denoland/deno/issues/23852 Fixes https://github.com/denoland/deno/issues/23917
2024-06-08fix(check): attempt to resolve types from pkg before `@types` pkg (#24152)David Sherret
I've been meaning to fix this for ages, but I finally ran into it here: https://github.com/dsherret/ts-ast-viewer/actions/runs/9432038675/job/25981325408 We need to resolve the `@types` package as a fallback instead of eagerly resolving it.
2024-06-07chore(ext/node): remove dead op (#24131)Satya Rohith
2024-06-06refactor: remove `PermissionsContainer` in deno_runtime (#24119)David Sherret
Also removes permissions being passed in for node resolution. It was completely useless because we only checked it for reading package.json files, but Deno reading package.json files for resolution is perfectly fine. My guess is this is also a perf improvement because Deno is doing less work.
2024-05-21feat(node): buffer isUtf8/isAscii (#23928)snek
Fixes: https://github.com/denoland/deno/issues/23657 Implements `isUtf8` and `isAscii` as ops.
2024-05-16fix(ext/node): homedir() `getpwuid`/`SHGetKnownFolderPath` fallback (#23841)Divy Srivastava
**Unix**: Returns the value of the HOME environment variable if it is set even if it is an empty string. Otherwise, it tries to determine the home directory by invoking the [getpwuid_r](https://linux.die.net/man/3/getpwuid_r) function with the UID of the current user. **Windows**: Returns the value of the USERPROFILE environment variable if it is set and it is not an empty string. Otherwise, it tries to determine the home directory by invoking the [SHGetKnownFolderPath](https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath) function with [FOLDERID_Profile](https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid). Fixes https://github.com/denoland/deno/issues/23824
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-20fix(ext/node): implement process.kill in Rust (#23130)Divy Srivastava
Closes https://github.com/denoland/deno/issues/23056
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-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-21fix(ext/node): ECDH.publicKey() point encoding (#23013)Divy Srivastava
2024-03-20fix(ext/node): worker_threads ESM handling (#22841)mash-graz
Fixes #22840 Fixes #22964
2024-03-13feat(node): implement fs.statfs() (#22862)Nayeem Rahman
2024-03-13fix(ext/node): initial `crypto.createPublicKey()` support (#22509)Asher Gomez
Closes #21807 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-03-11fix(ext/node): Match punycode module behavior to node (#22847)Nathan Whitaker
Fixes #19214. We were using the `idna` crate to implement our polyfill for `punycode.toASCII` and `punycode.toUnicode`. The `idna` crate is correct, and adheres to the IDNA2003/2008 spec, but it turns out `node`'s implementations don't really follow any spec! Instead, node splits the domain by `'.'` and punycode encodes/decodes each part. This means that node's implementations will happily work on codepoints that are disallowed by the IDNA specs, causing the error in #19214. While fixing this, I went ahead and matched the node behavior on all of the punycode functions and enabled node's punycode test in our `node_compat` suite.
2024-03-09fix(node): require of pkg json imports was broken (#22821)David Sherret
2024-03-05chore: upgrade deno_core (#22699)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-02-04chore: bump deno core (#22243)Matt Mastracci
Migrations: - Error registration no longer required for Interrupted or BadResource (these are core exception) - `include_js_files!`/`ExtensionFileSource` changes
2024-02-01fix(node): `util.callbackify` (#22200)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22180 Matches the Node.js implementation more closely. Removed types, they do not help just make it harder to debug with stack traces.
2024-01-05fix(ext/node): add fs.cp, fs.cpSync, promises.cp (#21745)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20803 Fixes https://github.com/denoland/deno/issues/21723 Performance: copying a 48GiB rust `target` folder (recursive) | Platform | `deno` | `node v21.5` | Improvement | | -------- | ------- | ------- | ------- | | macOS (APFS) | 3.1secs | 127.99 secs | **42x** | | Windows | 18.3secs | 67.2secs | **3.8x** | Copying files with varying sizes: ![image](https://github.com/denoland/deno/assets/34997667/58932652-6f7a-47f5-8504-896dc9ab4ddc)
2024-01-02fix(ext/node): querystring stringify without encode callback (#21740)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/21734 Changes: - Use default encode when options do not provide a encode callback. - Remove internal TS for `node:querystring`. Its not helping catching bugs like this because of invalid type assumptions and use of `any`, more of a maintenance burden.
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-30fix(ext/node): add process.abort() (#21742)Divy Srivastava
2023-12-28fix(node): Implement os.cpus() (#21697)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/21666 Zero added dependency and tries to match the libuv implementation
2023-12-19fix(node): child_process IPC on Windows (#21597)Divy Srivastava
This PR implements the child_process IPC pipe between parent and child. The implementation uses Windows named pipes created by parent and passes the inheritable file handle to the child. I've also replace parts of the initial implementation which passed the raw parent fd to JS with resource ids instead. This way no file handle is exposed to the JS land (both parent and child). `IpcJsonStreamResource` can stream upto 800MB/s of JSON data on Win 11 AMD Ryzen 7 16GB (without `memchr` vectorization)
2023-12-19fix(console): inspect for `{Set,Map}Iterator` and `Weak{Set,Map}` (#21554)Kenta Moriuchi
2023-12-15refactor: setup child process pipe in Rust (#21579)Divy Srivastava
Avoid passing the fd into JS and back into Rust. Instead we setup the child's end of the pipe directly using a special Rust op.
2023-12-13fix: implement child_process IPC (#21490)Divy Srivastava
This PR implements the Node child_process IPC functionality in Deno on Unix systems. For `fd > 2` a duplex unix pipe is set up between the parent and child processes. Currently implements data passing via the channel in the JSON serialization format.
2023-12-11fix(ext/node): basic vm.runInNewContext implementation (#21527)Divy Srivastava
Simple implementation to support webpack (& Next.js): https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/javascript/JavascriptParser.js#L4329
2023-12-04perf(node/fs): faster `existsSync` when not exists (#21458)David Sherret
2023-12-01fix(ext/node): add stubbed process.report (#21373)Daniel Mizerski
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-11-29fix(ext/node): add util.parseArgs (#21342)Yoshiya Hinosawa
2023-11-11perf: snapshot runtime ops (#21127)Divy Srivastava
Closes https://github.com/denoland/deno/issues/21135 ~1ms startup time improvement --------- Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-11-11chore(ext/node): use libz-sys w/`zlib-ng` feature in node (#21158)Matt Mastracci
We only want one zlib dependency. Zlib dependencies are reorganized so they use a hidden `__vendored_zlib_ng` flag in cli that enables zlib-ng for both libz-sys (used by ext/node) and flate2 (used by deno_web).
2023-11-10fix(ext/node): implement process.geteuid (#21151)Divy Srivastava
Fixes #21097
2023-11-09fix(node): implement createPrivateKey (#20981)Divy Srivastava
Towards #18455
2023-11-07fix(node): inspect ancestor directories when resolving cjs re-exports during ↵David Sherret
analysis (#21104) If a CJS re-export can't be resolved, it will check the ancestor directories, which is more similar to what `require` does at runtime.
2023-11-04fix(node): use closest package.json to resolve package.json imports (#21075)David Sherret
2023-10-30fix: implement node:tty (#20892)Divy Srivastava
Fixes #21012 Closes https://github.com/denoland/deno/issues/20855 Fixes https://github.com/denoland/deno/issues/20890 Fixes https://github.com/denoland/deno/issues/20611 Fixes https://github.com/denoland/deno/issues/20336 Fixes `create-svelte` from https://github.com/denoland/deno/issues/17248 Fixes more reports here: - https://github.com/denoland/deno/issues/6529#issuecomment-1432690559 - https://github.com/denoland/deno/issues/6529#issuecomment-1522059006 - https://github.com/denoland/deno/issues/6529#issuecomment-1695803570
2023-10-26fix(unstable/byonm): improve error messages (#20987)David Sherret
This improves the error messages when a specifier can't be resolved from a deno module into an npm package.
2023-09-28refactor(ext/node): remove dependency on deno_npm and deno_semver (#20718)David Sherret
This is required from BYONM (bring your own node_modules). Part of #18967
2023-09-26chore: slight cleanup in npm resolvers (#20692)David Sherret
2023-09-23fix(node): supported arguments to `randomFillSync` (#20637)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20634
2023-09-15feat(ext/node): http2.connect() API (#19671)Bartek Iwańczuk
This commit improves compatibility of "node:http2" module by polyfilling "connect" method and "ClientHttp2Session" class. Basic operations like streaming, header and trailer handling are working correctly. Refing/unrefing is still a TODO and "npm:grpc-js/grpc" is not yet working correctly. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-09-14refactor: rewrite ext/node to op2 (#20489)Bartek Iwańczuk
2023-09-06fix(ext/node): implement AES GCM cipher (#20368)Divy Srivastava
Adds support for AES-GCM 128/256 bit keys in `node:crypto` and `setAAD()`, `setAuthTag()` and `getAuthTag()` Uses https://github.com/littledivy/aead-gcm-stream Fixes https://github.com/denoland/deno/issues/19836 https://github.com/denoland/deno/issues/20353