Repository navigation
Conversation
|
Review requested:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #63653 +/- ##
==========================================
+ Coverage 90.10% 90.13% +0.02%
==========================================
Files 752 752
Lines 252197 252868 +671
Branches 47440 47580 +140
==========================================
+ Hits 227245 227925 +680
+ Misses 16251 16246 -5
+ Partials 8701 8697 -4
🚀 New features to boost your workflow:
|
|
@joyeecheung take a look, should be easier to review. |
6321e08 to
51b033a
Compare
joyeecheung
left a comment
There was a problem hiding this comment.
A design question recently occurred to me: have we explored the versioning of the mounting?
what do you mean? You mean multiple vfs layers on top of each other? |
For the stacks to have some kind of version number/ID to identify the current status? BTW I just noticed that there's no mention of |
I did purge them when doing the splitting; I forgot to bring them back. I'll add them to this PR. |
No but we totally should. |
51b033a to
294a19c
Compare
|
@joyeecheung PTAL |
75bb5c7 to
99a5a5c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@joyeecheung PTAL, I plan to land this on Monday/when I can get a clean CI. If there are more things to fix, could you please open an issue? |
This comment was marked as duplicate.
This comment was marked as duplicate.
Commit Queue failed
The pull request was removed from the Commit Queue and labeled
commit-queue-failed
Full Commit Queue output |
|
@mcollina Looks like this needs to land manually since node-core-utils isn't aware of CI being successful. |
Co-authored-by: James M Snell <jasnell@gmail.com> Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #63653 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 4d9cb71 |
Co-authored-by: James M Snell <jasnell@gmail.com> Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #63653 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
Notable changes: benchmark: * (SEMVER-MINOR) implement node:bench version of bench tools (James M Snell) #65606 crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * (SEMVER-MINOR) move histogram.burnRate to correct location in doc (James M Snell) #65434 * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) add `node:bench` explicit createRunner (James M Snell) #65606 * (SEMVER-MINOR) complete the implementation of node:bench and cli (James M Snell) #65606 * (SEMVER-MINOR) implement bench/reporters (James M Snell) #65606 * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) fixup histogram and options linting issues (James M Snell) #65606 * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src, lib: * (SEMVER-MINOR) add stats to dtls (James M Snell) #63182 src,lib: * (SEMVER-MINOR) add dtls interop tests (James M Snell) #63182 * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 test: * (SEMVER-MINOR) fix node:bench test timing (James M Snell) #65606 * (SEMVER-MINOR) improve node:bench test coverage (James M Snell) #65606 * (SEMVER-MINOR) update bench tests to not fail on no-crypto (James M Snell) #65606 * (SEMVER-MINOR) use native builder for legacy SEA tests (Filip Skokan) #65553 * (SEMVER-MINOR) enable multi-global WPTs (Filip Skokan) #64894 * (SEMVER-MINOR) add opt-in process WPT runner (Filip Skokan) #64894 * (SEMVER-MINOR) accomodate multi-global tests in WPT{Runner,TestSpec,Report} (Filip Skokan) #64894 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add wpt tests for Web Workers (Aviv Keller) #64894 * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Co-authored-by: James M Snell <jasnell@gmail.com> Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #63653 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Upstream moved the native legacyMainResolve call from esm/resolve.js into the loaderMethods table in internal/modules/helpers.js, so pass the asar-aware fileExists callback from there instead. Ref: nodejs/node#63653 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vf2yMuJ7XxvNktpKuiMPzU
Makes
require()andimportresolve files served bynode:vfs. Before this PR, mounted VFS files were only visible throughfs.*; the loaders went straight to the real filesystem.Design
vfs.mount()takes no arguments and returns the reserved absolute mount point of the instance:${os.devNull}/vfs/<layerId>(for example/dev/null/vfs/0).os.devNullis a character device on POSIX and a device-namespace path on Windows; neither can have child filesystem entries, so no real path can ever exist under this root.Everything about ownership is decidable from the path alone:
benchmark/vfs/bench-fs-dispatch.js) reports flat per-call latency across 1..10 mounted layers.realpathSyncof a VFS entry always resolves to another path under the same mount point, so cache entries hidden behind symlinks are captured by the prefix scan.file:URLs under the mount point;import(import.meta.resolve(x))re-hits the same module job.Two instances mounting simultaneously never collide (each gets its own
layer-<id>segment), so there is no overlap validation and no ordering hazard between mounts.Loader integration
Toggleable wrappers in the loaders. Null fast-path when no VFS is mounted; otherwise the VFS answers
stat/readFile/realpath/legacyMainResolve/getFormatOfExtensionlessFileand the fourpackage.jsonC++-binding calls.Module identity follows the path:
__filename,module.filename, andimport.meta.urlare the plain absolute path (orfile:URL) of the module under the mount point — no synthetic decorations.Review guide
Suggested reading order:
lib/internal/vfs/router.jsgetVfsRoot,getLayerRoot,getLayerIdFromPath.lib/internal/vfs/file_system.jsmount()returns the layer's reserved mount point.lib/internal/vfs/setup.jsfindVFS(O(1) lookup), fs handler, loader overrides with parity tosrc/node_modules.cc/src/node_file.cc, prefix-scan cache purge.lib/internal/modules/helpers.jsloader*wrappers,setLoaderFsOverrides/setLoaderPackageOverrides,purgeRealpathCacheForPrefix.lib/internal/modules/cjs/loader.jsstat()+ TS read routed through wrappers;purgeModuleCachesForPrefixfor unmount.lib/internal/modules/esm/resolve.jslegacyMainResolve+internalModuleStat+toRealPathrouted. No URL decoration.lib/internal/modules/esm/load.jsgetSourceSyncreads via the wrapper.lib/internal/modules/esm/get_format.jslib/internal/modules/package_json_reader.jspurgePackageJSONCacheForPrefix.lib/fs.jsstatSync/lstatSynchonourthrowIfNoEntry:falseon ENOENT from the VFS handler.doc/api/vfs.mdTests (all gated by
--experimental-vfs):test-vfs-mount,test-vfs-mount-errors,test-vfs-multi-mount,test-vfs-require,test-vfs-import,test-vfs-module-hooks,test-vfs-module-hooks-cleanup,test-vfs-package-json,test-vfs-package-json-cache,test-vfs-invalid-package-json,test-vfs-scoped-cache-purge,test-vfs-layer-id,test-vfs-layer-tag-prefix.Refs
The reserved-namespace design follows the "no interference with valid paths in the file system" requirement from the SEA VFS requirements doc.
Out of scope
SEA + VFS, overlay/stacking of multiple VFS layers under one prefix, migrating the C++
package_configs_cache, broader permission-model integration.