Upgrade to RSPack and pnpm
#9114
Open
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.
Notes from Cam
yarn.lockremoval andpnpm-lock.yamladdition. Many of the files changed are just removing the hot reload.Migrate from Webpack to RSPack and Yarn to pnpm
Overview
This PR modernizes the Treeherder build infrastructure by:
Why RSPack?
RSPack is a high-performance JavaScript bundler written in Rust that offers:
Why pnpm?
pnpm offers several advantages over Yarn:
Changes Made
Build System Migration
webpack.config.js→rspack.config.jspackage.jsonrspackinstead ofwebpack.npmrc.yarnrcyarn.lock→pnpm-lock.yamlRSPack Configuration Highlights
builtin:swc-loaderfor faster JS/JSX transpilation (faster than Babel)@rspack/plugin-react-refreshfor HMR (replacesreact-hot-loader)@importdeprecation warnings (Bootstrap 5 still uses@import)Dependency Cleanup
Removed from dependencies (no longer needed)
react-hot-loader- Replaced by RSPack's built-in React RefreshRemoved from devDependencies
@babel/plugin-proposal-class-properties- Deprecated, built into @babel/preset-env@babel/plugin-syntax-dynamic-import- Built into @babel/preset-envpath- Built-in Node.js module, unnecessary as a dependencyMoved to devDependencies (were incorrectly in dependencies)
eslint-formatter-codeframe- Only used by ESLintglobals- Only used by ESLint configredux-mock-store- Only used in testsCode Changes
Removed
react-hot-loaderusage from 8 files:ui/App.jsxui/job-view/App.jsxui/login-callback/LoginCallback.jsxui/logviewer/App.jsxui/push-health/App.jsxui/intermittent-failures/App.jsxui/userguide/App.jsxui/perfherder/App.jsxConfiguration Updates
babel.config.json.prettierignorevenv/,node_modules/,pnpm-lock.yaml.circleci/config.ymldocker/Dockerfiledocs/*.mdTesting
All scripts pass successfully:
pnpm buildpnpm build:devpnpm lintpnpm testpnpm startpnpm format:checkpnpm markdownlintBuild Performance Comparison
While exact benchmarks depend on hardware, RSPack typically provides:
Migration Guide for Developers
For local development
Common commands (same as before, just use pnpm)
Package Manager Enforcement
This PR adds guards to ensure developers use pnpm instead of yarn or npm.
How It Works
1.
packageManagerfield inpackage.jsonThis field:
2.
preinstallscriptThis script:
packageManagerWhat Developers Will See
If they try to use Yarn:
If they try to use npm:
Migration for Developers
Breaking Changes
None. The migration is transparent to end users and maintains all existing functionality.
Remaining Warnings (informational only)
util._extenddeprecation from a transitive dependency. Does not affect functionality.Future Improvements (out of scope for this PR)
momenttodayjsfor better tree-shakingreact-router-domto v6