Skip to content

Conversation

@joshblack
Copy link
Member

@joshblack joshblack commented Dec 2, 2025

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

  • Update rollup-plugin-import-css to rolldown-plugin-import-css
    • Update how the plugin matches files by using rolldown's filter option which allows for more efficient bridging between Rust <-> JS
    • Update our logic for creating the *.module.css.js asset since rolldown's behavior is different than rollups. Now, the asset extension no longer gets a .js automatically so we needed to add that in and update the logic accordingly
    • Remove build step since Node.js natively supports *.ts extensions now 😄
  • Update the following packages to use rolldown:
    • doc-gen
    • mcp
    • react
    • styled-react
  • Add external deps to styled-react that were missing (clsx, deepmerge, and focus-visible)

Removed

Rollout strategy

  • None; if selected, include a brief description as to why

This is a change to our internal build and should have no user-facing impact

@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

⚠️ No Changeset found

Latest commit: a548637

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Dec 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

👋 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 integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7263 December 2, 2025 21:55 Abandoned
@joshblack joshblack added the skip changeset This change does not need a changelog label Dec 2, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-7263 December 2, 2025 22:07 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7263 December 2, 2025 22:16 Inactive
@joshblack joshblack marked this pull request as ready for review December 2, 2025 22:21
@joshblack joshblack requested a review from a team as a code owner December 2, 2025 22:21
@joshblack joshblack added skip changeset This change does not need a changelog and removed skip changeset This change does not need a changelog labels Dec 2, 2025
Copilot finished reviewing on behalf of joshblack December 2, 2025 22:24
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 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-css to rolldown-plugin-import-css with 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 defineConfig import should be from 'rolldown' instead of 'rollup' to match the migration to rolldown. This config file is named rolldown.config.js but 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'

@github-actions github-actions bot requested a deployment to storybook-preview-7263 December 3, 2025 17:27 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7263 December 3, 2025 17:41 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Dec 3, 2025
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/8202

@primer-integration
Copy link

🔴 ci completed with status failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: failing Changes in this PR cause breaking changes in gh/gh skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate bundling to rolldown-based setup

2 participants