-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implement fs searching in rust #5481
Conversation
|
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
|
Only used by original RPi 2 Model B, backward compatible with armv6, process.arch doesn't distinguish between them
packages/core/utils/src/config.js
Outdated
|
||
return resolveConfig(fs, filepath, filenames, opts); | ||
): Promise<?FilePath> { | ||
// TODO: realpath |
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.
Unclear about this: it doesn't break any tests at the moment to remove it. However, I think it will change again soon anyway though perhaps slightly different (realpath the result rather than the input). See #5183.
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 believe this will be unnecessary once #5508 is merged since all asset file paths (and therefore where we are searching for config from) will be realpaths. Remove the TODO comment in that PR.
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.
Looks good to me
* Use inputFS.realpathSync get realpath of module * Add test for symlink structure * add symlink file * dynamically create symlinks for test * Update packages/utils/node-resolver-core/src/NodeResolver.js Co-authored-by: Amin Yahyaabadi <[email protected]> * Update NodeResolver.js * Update packages/utils/node-resolver-core/src/NodeResolver.js Co-authored-by: Amin Yahyaabadi <[email protected]> * Update packages/utils/node-resolver-core/src/NodeResolver.js Co-authored-by: Amin Yahyaabadi <[email protected]> * use realpath * Tests use overlayFS * Update packages/utils/node-resolver-core/src/NodeResolver.js Co-authored-by: Amin Yahyaabadi <[email protected]> * Realpath at the end of resolution * Remove realpaths that are now unnecessary * Fix sourcemaps tests * Add tests for symlink resolution * Remove realpath comment * prettier Co-authored-by: dishuostec <[email protected]> Co-authored-by: Niklas Mischkulnig <[email protected]> Co-authored-by: Jasper De Moor <[email protected]> Co-authored-by: Amin Yahyaabadi <[email protected]> Co-authored-by: dishuostec <[email protected]> Co-authored-by: Will Binns-Smith <[email protected]>
This adds a new package,
@parcel/fs-search
, which implements some very common filesystem searching methods natively in Rust, with a fallback to a JS implementation. These include finding a file by searching up a directory tree, finding a node_modules directory, and checking a number of extensions. Using the native implementation instead of JS is much faster because it avoids crossing the JS -> C++ barrier for every FS call and instead only crosses it once per search.This results in ~15% faster builds overall.
TODO