Skip to content

Conversation

@joshblack
Copy link
Member

Update @primer/react to use rolldown over rollup for improved build performance.

Changelog

New

Changed

  • Update rollup-plugin-import-css to be rolldown compatible
  • Update @primer/react to use rolldown over rollup for bundling

Removed

  • Remove build process from rollup-plugin-import-css since it is no longer necessary

Rollout strategy

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

As far as I can tell, this should be a 1:1 replacement so no changeset needed but will use integration tests to confirm 🤞

Copilot AI review requested due to automatic review settings December 10, 2025 21:25
@joshblack joshblack requested a review from a team as a code owner December 10, 2025 21:25
@changeset-bot
Copy link

changeset-bot bot commented Dec 10, 2025

⚠️ No Changeset found

Latest commit: 0953b87

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

@joshblack joshblack changed the title Refactor/update react to rolldown refactor(react): use rolldown over rollup Dec 10, 2025
@github-actions github-actions bot added the staff Author is a staff member label Dec 10, 2025
@github-actions
Copy link
Contributor

👋 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 added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 10, 2025
@joshblack joshblack added the skip changeset This change does not need a changelog label Dec 10, 2025
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 pull request migrates the @primer/react build system from rollup to rolldown for improved build performance. The migration involves replacing the rollup-plugin-import-css package with a new rolldown-compatible version (rolldown-plugin-import-css) and updating the build configuration to use rolldown's API and plugin structure.

Key Changes

  • Replaced rollup bundler with rolldown for the @primer/react package build process
  • Created a new rolldown-plugin-import-css package to replace the rollup version, using rolldown's filter-based plugin API
  • Removed the build process from the plugin package (no longer compiles to dist, exports TypeScript source directly)

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/rollup-plugin-import-css/tsconfig.build.json Deleted build-specific TypeScript configuration (no longer needed)
packages/rollup-plugin-import-css/src/index.ts Deleted old rollup plugin implementation
packages/rollup-plugin-import-css/rollup.config.js Deleted rollup build configuration for the plugin
packages/rollup-plugin-import-css/package.json Deleted old plugin package definition
packages/rolldown-plugin-import-css/tsconfig.json Added TypeScript configuration for new rolldown plugin
packages/rolldown-plugin-import-css/src/index.ts New rolldown-compatible plugin using filter-based hooks
packages/rolldown-plugin-import-css/package.json New package definition exporting TypeScript source directly
packages/rolldown-plugin-import-css/README.md Updated documentation to reference rolldown instead of rollup
packages/react/script/build Updated build script to use npx rolldown instead of npx rollup
packages/react/rolldown.config.mjs New rolldown configuration replacing rollup config; removed node-resolve, commonjs, and preserve-directives plugins
packages/react/package.json Added rolldown and rolldown-plugin-import-css dependencies, reordered @tanstack/react-virtual
package-lock.json Updated dependencies to include rolldown bindings and related packages
Comments suppressed due to low confidence (3)

packages/react/rolldown.config.mjs:125

  • The previous rollup config included a custom "preserve-directives" plugin that prepended "use client" directives to output chunks when preserveModules was enabled. This plugin has been removed in the rolldown config, but there's no indication that rolldown handles this natively. Without this plugin, React Server Components may not work correctly as the "use client" directives from source files (like src/index.ts, src/experimental/index.ts, src/deprecated/index.ts, src/next/index.ts) won't be preserved in the built output. Verify that rolldown preserves module-level directives or add equivalent functionality.
    packages/react/rolldown.config.mjs:124
  • The rolldown configuration is missing the "interop" setting that was present in the rollup config output. The previous config specified interop: 'auto' which controls how default and named exports are handled when mixing ES modules and CommonJS. Without this setting, there may be compatibility issues when consuming this package from projects using different module systems. Consider adding interop configuration if rolldown supports it.
    packages/react/rolldown.config.mjs:100
  • The rollup config previously included @rollup/plugin-node-resolve and @rollup/plugin-commonjs plugins to handle module resolution and CommonJS dependencies. These plugins have been removed without replacement. While rolldown may have built-in support for these features, this should be explicitly verified. Without proper module resolution, imports may fail, especially for dependencies that use CommonJS format or non-standard module resolution patterns.

@swiing
Copy link
Contributor

swiing commented Dec 11, 2025

Since you are willing to replace rollup-plugin-import-css by a new rolldown-plugin-import-css, please complete the update:

  • rename workspace in ./package.json
  • update files in ./eslint.config.mjs

@swiing
Copy link
Contributor

swiing commented Dec 11, 2025

You may also want to consider #7304, as also applicable to your PR.

@jonrohan jonrohan mentioned this pull request Dec 12, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm 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.

4 participants