-
-
Notifications
You must be signed in to change notification settings - Fork 746
perf: replace graceful-fs with node:fs #11894
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
Conversation
✅ Deploy Preview for rspack canceled.
|
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.
Pull Request Overview
This PR removes the graceful-fs dependency in favor of native node:fs, as Rspack handles file system operations on the Rust side, making the graceful-fs wrapper unnecessary. This simplification should improve build performance.
Key Changes:
- Replaced
graceful-fsimports withnode:fsin source files - Removed
graceful-fsfrom package dependencies and build configuration - Updated prebundle configuration to handle watchpack's graceful-fs dependency externally
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/tsconfig.json | Removed graceful-fs path alias from TypeScript configuration |
| packages/rspack/src/rspackOptionsApply.ts | Changed import from graceful-fs to node:fs |
| packages/rspack/src/node/NodeEnvironmentPlugin.ts | Changed import from graceful-fs to node:fs and adjusted import ordering |
| packages/rspack/prebundle.config.mjs | Removed graceful-fs from dependencies list and updated watchpack configuration to externalize it |
| packages/rspack/package.json | Removed graceful-fs and @types/graceful-fs dependencies |
| package.json | Removed graceful-fs patch from pnpm configuration |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
🙈 Size remains the same at 47.67MB |
CodSpeed Performance ReportMerging #11894 will not alter performanceComparing Summary
|
Summary
Rspack handles file system operations in Rust side, so the
graceful-fsdependency on the Node.js side is not necessary. And modern Node.js applications rarely usegraceful-fs, this PR removes it and usesnode:fsdirectly instead.This change should make
rspack buildslightly faster.Checklist