-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Virtual File System for Node.js #61478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mcollina
wants to merge
64
commits into
nodejs:main
Choose a base branch
from
mcollina:vfs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
b0a8b64
fs: add virtual file system support
mcollina 9c37b93
vfs: add Windows path compatibility
mcollina 309f4fa
sea: support VFS in embedderRequire
mcollina 0099c0e
test: add tmpdir.refresh() to SEA VFS test
mcollina 349069d
test: update SEA VFS test for new buildSEA API
mcollina ff3aaca
vfs: add provider-based architecture and node:vfs module
mcollina 046ad91
vfs: remove backward compat methods, use standard fs API
mcollina ecb4970
vfs: address review comments
mcollina b2204f5
vfs: fix lint errors
mcollina 01267e9
vfs: fix lint errors
mcollina 7515caf
vfs: remove public createSEA()
mcollina e4f3712
vfs: address review comments
mcollina 5d4733f
doc: address review comments on VFS documentation
mcollina 8edc36d
doc: clarify virtualCwd behavior in Worker threads
mcollina 9ab017f
vfs: add RealFSProvider for mounting real directories
mcollina 61cae85
tools: add VFS types to doc type-parser
mcollina 25b47c8
doc: use REPLACEME for version placeholders in vfs.md
mcollina fab4cdf
doc: add security warnings and symlink documentation to vfs.md
mcollina 718c4d3
vfs: address code review feedback from @jasnell
mcollina 7201d99
vfs: add overlay mode for selective file interception
mcollina b028f02
vfs: add tests and fix appendFile, add readonly checks
mcollina 6aa4fa8
fs: remove createVirtual, use node:vfs instead
mcollina 951c7d0
vfs: add watch and watchFile support
mcollina 03eec28
vfs: improve test coverage for watch implementation
mcollina 62ae79e
vfs: remove unused utility functions from module_hooks
mcollina 17cb922
vfs: add test for symlink target creation after symlink
mcollina e7fb57d
doc: add worker thread limitations to VFS documentation
mcollina 4b61269
doc: clarify VFS accepts same types as fs module
mcollina fb3a00f
vfs: remove unused entries.js, add error tests
mcollina a3905f4
vfs: remove unused exports from fd.js and stats.js
mcollina a0089ed
vfs: remove unused VirtualFD methods
mcollina e99ba02
vfs: remove more unused VirtualFD code
mcollina 39ea233
vfs: address Aviv's review comments
mcollina 6b8b324
test: improve VFS code coverage
mcollina c7c3a6b
Update lib/internal/vfs/module_hooks.js
mcollina 9a808b1
Update lib/internal/vfs/module_hooks.js
mcollina 27d4157
vfs: address aduh95 review comments
mcollina 4c95888
vfs: remove SEAProvider export and hasSeaAssets
mcollina a8e3bc8
vfs: remove addFile and addDirectory methods
mcollina 5457818
doc: alphabetize VirtualFileSystem members in vfs.md
mcollina 52f4790
Update single-executable-applications.md
mcollina aed8894
sea: remove getVfs from public API
mcollina 1af93b3
doc: explain symlink behavior in overlay mode
mcollina ae00632
doc: document overlay mode behavior for fs operations
mcollina 861a79c
vfs: add Symbol.dispose support for automatic unmount
mcollina 3ca8f54
vfs: add missing JSDoc @returns for mount()
mcollina bffba9a
vfs: only initialize SEA VFS when assets exist
mcollina b358ae9
vfs: use path.posix methods instead of custom implementations
mcollina 071d19e
vfs: address review feedback for SEA docs and getSeaVfs
mcollina 906c96f
vfs: refactor SEA VFS with initSeaVfs/getSeaVfs pattern
mcollina 1d8ee8b
vfs: address test review feedback
mcollina 77851e9
vfs: replace custom path helpers with standard path module
mcollina 7a18822
vfs: address remaining review feedback from avivkeller
mcollina 8e5dad3
test: expand VFS provider and promises test coverage
mcollina 3d5e013
fixup! test: expand VFS provider and promises test coverage
mcollina cdc2a7a
doc: address vfs documentation review feedback
mcollina 5c5868f
test: add Windows-specific VFS mount path tests
mcollina 99c94eb
vfs: address code review feedback
mcollina 2f057f1
vfs: add process vfs-mount and vfs-unmount events
mcollina c873f49
vfs: address code review feedback
mcollina a18f948
doc: add case sensitivity documentation for VFS overlay mode
mcollina bda370f
sea: use wrapModuleLoad for VFS module loading
mcollina 38bf3ad
doc: add VFS limitations and cross-references
mcollina 164ba61
vfs: fix path normalization on Windows
mcollina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be somewhat impractical for real-world apps - they are likely not really requiring from any absolute paths when being developed locally, for example just doing
require('pkg')andrequire('./path')as usual. Given that there are already module loading hooks it would be better to suggest/provide a built-in hook that alters resolution under the hood to prepend/seaand hide this from SEA users.Also this technically does not fully work, because
require('/path/to/addons.node')would go throughprocess.dlopen()instead. That either needs a call out or better be done as a follow up with some "temporarily decompressing to disk" mechanism.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also another thing that may need to be called out in the docs - I don't think the current implementation would support
useCodeCachefor the modules loaded from the SEA blob, that requires actually executing the modules to know "what modules to cache" and build the cache during SEA building, whereas the current SEA plumbing here only runs post-building.