Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Rspack handles file system operations in Rust side, so the graceful-fs dependency on the Node.js side is not necessary. And modern Node.js applications rarely use graceful-fs, this PR removes it and uses node:fs directly instead.

This change should make rspack build slightly faster.

image

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 16, 2025 10:59
@chenjiahan chenjiahan requested a review from hardfist as a code owner October 16, 2025 10:59
@netlify
Copy link

netlify bot commented Oct 16, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 517ff44
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68f0d0a4c506470007711d96

Copy link
Contributor

Copilot AI left a 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-fs imports with node:fs in source files
  • Removed graceful-fs from 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.

@github-actions github-actions bot added release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 16, 2025
@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 517ff44 to fix: should not cache dependency instance in DynamicEntryPlugin (#11888) by Cong-Cong Pan

🙈 Size remains the same at 47.67MB

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 16, 2025

CodSpeed Performance Report

Merging #11894 will not alter performance

Comparing remove_graceful_fs_1016 (517ff44) with main (0e14994)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) October 16, 2025 11:24
@chenjiahan chenjiahan merged commit 4dd06cf into main Oct 16, 2025
44 checks passed
@chenjiahan chenjiahan deleted the remove_graceful_fs_1016 branch October 16, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants