-
Notifications
You must be signed in to change notification settings - Fork 646
refactor(project): update project to use rolldown over rollup #7263
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
base: main
Are you sure you want to change the base?
Conversation
|
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
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 migrates the project from Rollup to Rolldown, a Rust-based bundler with a Rollup-compatible API. Rolldown is part of the voidzero toolchain powered by oxc (Rust) and offers performance improvements while maintaining compatibility with Rollup's API. The migration removes several rollup plugins that are now built into rolldown (commonjs, json, resolution) and simplifies the build configuration.
Key changes include:
- Migration of build configurations across 4 packages (react, styled-react, mcp, doc-gen) from Rollup to Rolldown
- Renaming and refactoring of the CSS import plugin from
rollup-plugin-import-csstorolldown-plugin-import-csswith updated filter-based API for efficient Rust/JS bridging - Removal of custom "preserve-directives" plugin as rolldown has built-in support for directive preservation
Reviewed changes
Copilot reviewed 21 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/styled-react/script/build | Updated build command from rollup to rolldown |
| packages/styled-react/rollup.config.js | Deleted old rollup configuration |
| packages/styled-react/rolldown.config.js | New rolldown config with simplified plugin list (removed custom preserve-directives plugin) |
| packages/styled-react/package.json | Updated dependency from rollup to rolldown@^1.0.0-beta.52, added peer dependencies |
| packages/rollup-plugin-import-css/src/index.ts | Deleted old rollup plugin implementation |
| packages/rollup-plugin-import-css/rollup.config.js | Deleted old rollup build config for plugin |
| packages/rollup-plugin-import-css/package.json | Deleted old package.json for rollup plugin |
| packages/rolldown-plugin-import-css/tsconfig.json | New TypeScript config for rolldown plugin |
| packages/rolldown-plugin-import-css/tsconfig.build.json | New TypeScript build config for rolldown plugin |
| packages/rolldown-plugin-import-css/src/index.ts | New rolldown plugin using filter-based hooks for efficient JS/Rust bridging |
| packages/rolldown-plugin-import-css/package.json | New package.json with direct TypeScript exports (no build step needed) |
| packages/rolldown-plugin-import-css/README.md | Updated documentation to reference rolldown instead of rollup |
| packages/react/src/Text/Text.tsx | Refactored import to use direct path instead of barrel export (unrelated style change) |
| packages/react/script/build | Updated build command from rollup to rolldown |
| packages/react/rollup.config.mjs | Deleted old rollup configuration |
| packages/react/rolldown.config.mjs | New rolldown config with simplified plugins and dual build targets |
| packages/react/package.json | Updated dependency from rollup to rolldown@^1.0.0-beta.52, removed unused rollup plugins |
| packages/mcp/rolldown.config.js | Updated to import from rolldown, removed commonjs/json/node-resolve plugins |
| packages/mcp/package.json | Updated build commands and dependency from rollup to rolldown |
| packages/doc-gen/tsconfig.build.json | Added test exclusion to build config |
| packages/doc-gen/rolldown.config.js | Updated to use rolldown with platform: 'node', removed commonjs/json/node-resolve plugins |
| packages/doc-gen/package.json | Updated build commands and dependency from rollup to rolldown, reordered dependencies |
| package.json | Simplified workspaces glob pattern |
| package-lock.json | Updated lockfile with rolldown and related dependencies |
Comments suppressed due to low confidence (3)
packages/doc-gen/rolldown.config.js:1
- The
defineConfigimport should be from 'rolldown' instead of 'rollup' to match the migration to rolldown. This config file is namedrolldown.config.jsbut is still importing from the old 'rollup' package.
packages/react/rolldown.config.mjs:4 - Unused import MagicString.
import MagicString from 'magic-string'
packages/styled-react/rolldown.config.js:5
- Unused import MagicString.
import MagicString from 'magic-string'
Co-authored-by: Copilot <[email protected]>
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/8202 |
|
🔴 ci completed with status |
Closes #6171
Update project to use rolldown over rollup. Rolldown is a part of voidzero and is powered by a Rust-based toolchain through projects like oxc. It features a rollup-compatible API so (ideally) speeds up our builds without many changes 😄
It also allows us to remove several rollup plugins that are baked into the library, namely ones for commonjs, json, resolution, and more. We can also remove some of our rollup custom plugins, like the one we have for preserving directives.
Changelog
New
Changed
rollup-plugin-import-csstorolldown-plugin-import-cssfilteroption which allows for more efficient bridging between Rust <-> JS*.module.css.jsasset since rolldown's behavior is different than rollups. Now, the asset extension no longer gets a.jsautomatically so we needed to add that in and update the logic accordingly*.tsextensions now 😄doc-genmcpreactstyled-reactstyled-reactthat were missing (clsx,deepmerge, andfocus-visible)Removed
Rollout strategy
This is a change to our internal build and should have no user-facing impact