Skip to content

feat(alias,auto-install,beep,buble,data-uri,dynamic-import-vars,eslint,esm-shim,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript): support rollup 5 - #2037

Open
lukastaegert wants to merge 21 commits into
masterfrom
simple-rollup-5-updates

Conversation

@lukastaegert

@lukastaegert lukastaegert commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Rollup Plugins: 27 plugins

alias, auto-install, beep, buble, data-uri, dynamic-import-vars, eslint, esm-shim, inject, legacy, multi-entry, node-resolve, pluginutils, replace, run, strip, sucrase, swc, terser, typescript

This PR contains:

  • feature
  • bugfix
  • refactor
  • documentation
  • other

Are tests included?

  • yes
  • no

Breaking Changes?

  • yes
  • no

List any relevant issue numbers:

Description

Prepare the plugins that only need a peer dependency range extension for Rollup 5. Each plugin now accepts rollup@^5.0.0, tests against rollup@5.0.0-3 through the new rollup-next catalog, and includes the Rollup 5 test and snapshot adaptations it needs.

Smoke tests that run an actual Rollup build were duplicated from test-earliest-supported-rollup where they exist (inject, strip, virtual). The auto-install fixture lockfile guard and virtual's type-test @types/node setup were duplicated as well, so the two branches can merge in either order.

html and babel were moved to separate PRs (#2038, #2039) because their declared peer floors are too low (1.20.0 and 2.0.0). json and wasm are intentionally excluded: they need source changes to handle Rollup 5's attribute-encoded module ids via rawId. Those are tracked separately.

This is intended to trigger a minor release for each of the 27 updated plugins.

generated with AI

@lukastaegert
lukastaegert marked this pull request as ready for review November 2, 2026 16:31
Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:31
@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge, with the existing non-blocking concern about running Rollup 5 on Node 20 still open.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the existing non-blocking concern about running Rollup 5 on Node 20 still open.

Findings

  1. P2 CI uses unsupported Node ▶

Reviews (9) · Last reviewed commit: "chore(repo): raise vitest test timeout f..." · Reviewed by Greptile

Comment thread pnpm-workspace.yaml Outdated
Comment on lines +11 to +13
catalogs:
rollup-next:
rollup: ^5.0.0-2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 CI uses unsupported Node

The new rollup-next catalog selects Rollup 5, which requires Node >=22.22.0, but both test workflows still run it on Node 20. This leaves those checks outside Rollup's supported runtime and makes failures harder to separate from plugin problems. Keep Rollup 4 for the Node 20 checks and run the Rollup 5 checks on a supported Node version.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Rollup 5 upgrade requires Node >=22.22.0 while CI still runs Node 20, and the updated HTML snapshot no longer verifies exclusion of non-entry chunks.

2 open issues
1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

Prepares 29 Rollup plugins and utilities for Rollup 5 by updating dependency declarations and compatibility tests. json and wasm remain excluded because they require separate source changes.

Changes:

  • Adds Rollup 5 peer support and a shared rollup-next development catalog.
  • Updates test expectations and snapshots, adds build smoke tests, and adjusts Node type dependencies.
  • Isolates auto-install’s pnpm fixtures and checks that installs leave the root lockfile unchanged.
File Description
pnpm-workspace.yaml Defines the Rollup 5 development catalog.
pnpm-lock.yaml Locks Rollup 5 and updated dependency resolutions.
packages/​yaml/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​virtual/​test/​types.test.js Includes Node types in type tests.
packages/​virtual/​test/​rollup-build.test.js Adds a virtual-module build smoke test.
packages/​virtual/​package.json Adds Rollup 5 support and Node type dependencies.
packages/​url/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​typescript/​test/​test.js Adapts diagnostic assertions to augmented Rollup logs.
packages/​typescript/​test/​snapshots/​warnings.js.snap Updates warning snapshots for augmented logs.
packages/​typescript/​test/​snapshots/​tslib.js.snap Updates the missing-tslib error snapshot.
packages/​typescript/​package.json Adds Rollup 5 support and updates Node types.
packages/​terser/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​swc/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​sucrase/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​strip/​test/​rollup-build.test.js Adds a stripping build smoke test.
packages/​strip/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​run/​test/​test.js Updates expected plugin error prefixes.
packages/​run/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​replace/​test/​sourcemaps.js Updates sourcemap warning expectations.
packages/​replace/​test/​snapshots/​misc.js.snap Updates the plugin warning snapshot.
packages/​replace/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​pluginutils/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​node-resolve/​test/​test.mjs Expects additional resolver importer metadata.
packages/​node-resolve/​test/​snapshots/​test.mjs.snap Updates the deprecation warning snapshot.
packages/​node-resolve/​test/​prefer-builtins.js Updates the built-in preference warning expectation.
packages/​node-resolve/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​multi-entry/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​legacy/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​inject/​test/​rollup-build.test.js Adds an injected-import build smoke test.
packages/​inject/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​image/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​html/​test/​snapshots/​test.js.snap Updates dynamic-import output and warning snapshots.
packages/​html/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​graphql/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​esm-shim/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​eslint/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​dynamic-import-vars/​test/​snapshots/​rollup-plugin-dynamic-import-vars.test.js.snap Updates generated chunk hashes.
packages/​dynamic-import-vars/​test/​rollup-plugin-dynamic-import-vars.test.js Updates the missing-files warning expectation.
packages/​dynamic-import-vars/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​dsv/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​data-uri/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​commonjs/​test/​test.js Updates diagnostic formatting expectations.
packages/​commonjs/​test/​snapshots/​function.js.snap Refreshes generated bundle snapshots.
packages/​commonjs/​test/​fixtures/​function/​warn-this-resolve-without-options/​_config.js Updates the resolver warning prefix.
packages/​commonjs/​test/​fixtures/​function/​strict-requires-debug-none/​_config.js Updates the wrapping diagnostic prefix.
packages/​commonjs/​test/​fixtures/​function/​module-side-effects-late-entry/​_config.js Adjusts the expected generated entry filename.
packages/​commonjs/​test/​fixtures/​function/​custom-options/​_config.js Expects additional resolver importer metadata.
packages/​commonjs/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​buble/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​beep/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​babel/​test/​as-output-plugin.mjs Updates warning and chunk-hash expectations.
packages/​babel/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​auto-install/​test/​pnpm.js Checks root lockfile preservation during fixture installs.
packages/​auto-install/​test/​pnpm-bare.js Checks root lockfile preservation during bare installs.
packages/​auto-install/​test/​fixtures/​pnpm/​pnpm-workspace.yaml Anchors workspace detection to the fixture.
packages/​auto-install/​test/​fixtures/​pnpm/​.npmrc Allows dependency installation at the fixture root.
packages/​auto-install/​test/​fixtures/​pnpm-bare/​pnpm-workspace.yaml Anchors workspace detection to the bare fixture.
packages/​auto-install/​test/​fixtures/​pnpm-bare/​.npmrc Allows dependency installation at the bare fixture root.
packages/​auto-install/​package.json Adds Rollup 5 peer support and catalog usage.
packages/​alias/​test/​alias.test.ts Expects additional resolver importer metadata.
packages/​alias/​package.json Explicitly supports Rollup 4–5 and uses the catalog.

Review effort: Balanced

Comment thread pnpm-workspace.yaml Outdated

catalogs:
rollup-next:
rollup: ^5.0.0-2
{
"code": "if (Math.random() % 2) {
import('./batman-w40geAFS.js');
Promise.resolve().then(function () { return batman; });
@lukastaegert
lukastaegert force-pushed the simple-rollup-5-updates branch from 138dee6 to 08718f0 Compare November 3, 2026 05:42
@lukastaegert lukastaegert changed the title feat(alias,auto-install,babel,beep,buble,commonjs,data-uri,dsv,dynamic-import-vars,eslint,esm-shim,graphql,html,image,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript,url,virtual,yaml): support rollup 5 feat(alias,auto-install,beep,buble,commonjs,data-uri,dsv,dynamic-import-vars,eslint,esm-shim,graphql,image,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript,url,virtual,yaml): support rollup 5 Nov 3, 2026
@lukastaegert
lukastaegert force-pushed the simple-rollup-5-updates branch 3 times, most recently from 6a4c2b9 to 3eaada2 Compare November 3, 2026 06:45
@TrickyPi

Copy link
Copy Markdown
Member

Hey @lukastaegert, while working on #2017 I realized a few other plugins here also break with import attributes in Rollup 5 and need rawId fixes, so I opened #2050 (dsv), #2051 (yaml), #2052 (image), #2054 (virtual), #2055 (graphql), and #2056 (url).

Also, commonjs needs a fix too, which depends on rollup/rollup#6653. Could we publish rollup@5.0.0-3 so I can open that PR?

@lukastaegert

Copy link
Copy Markdown
Member Author

@TrickyPi Thanks for looking into this! rollup@5.0.0-3 is now released, so you can update your PRs. To avoid duplication, I will remove the packages for which you opened PRs from this blanket PR.
As far as I see it, v5.0.0-3 is now complete with regard to potential breaking changes. There is one source map improvement I am considering, but it should not have any impact on plugins, so I think we should be fine to start releasing new plugin versions based on that.

@lukastaegert
lukastaegert force-pushed the simple-rollup-5-updates branch from 00fbf14 to a492f14 Compare November 27, 2026 05:20
@lukastaegert lukastaegert changed the title feat(alias,auto-install,beep,buble,commonjs,data-uri,dsv,dynamic-import-vars,eslint,esm-shim,graphql,image,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript,url,virtual,yaml): support rollup 5 feat(alias,auto-install,beep,buble,commonjs,data-uri,dynamic-import-vars,eslint,esm-shim,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript): support rollup 5 Nov 27, 2026
@lukastaegert

Copy link
Copy Markdown
Member Author

@TrickyPi One question about the commonjs fix: If it depends on rollup/rollup#6653, can we still release it before rollup@5 is still released? To my understanding, the commonjs plugin was working with current rollup 5? It would be nice to have versions for all plugins that work with both latest rollup 4 and rollup 5 before we release rollup 5.

@TrickyPi

Copy link
Copy Markdown
Member

@TrickyPi One question about the commonjs fix: If it depends on rollup/rollup#6653, can we still release it before rollup@5 is still released? To my understanding, the commonjs plugin was working with current rollup 5? It would be nice to have versions for all plugins that work with both latest rollup 4 and rollup 5 before we release rollup 5.

@lukastaegert Yes, it stays compatible with Rollup 4 and can be released before Rollup 5. I only needed 5.0.0-3 to implement and test the Rollup 5 side.

And yeah, regular builds already work fine on Rollup 5, it's just importing CJS modules with import attributes that breaks. I've opened #2057 for commonjs, so feel free to drop it from this PR as well.

@lukastaegert
lukastaegert force-pushed the simple-rollup-5-updates branch from a492f14 to 857c155 Compare November 28, 2026 05:34
@lukastaegert lukastaegert changed the title feat(alias,auto-install,beep,buble,commonjs,data-uri,dynamic-import-vars,eslint,esm-shim,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript): support rollup 5 feat(alias,auto-install,beep,buble,data-uri,dynamic-import-vars,eslint,esm-shim,inject,legacy,multi-entry,node-resolve,pluginutils,replace,run,strip,sucrase,swc,terser,typescript): support rollup 5 Nov 28, 2026
@lukastaegert

Copy link
Copy Markdown
Member Author

feel free to drop it from this PR as well.

Done

Extend the peer dependency range and test against the upcoming Rollup 5 release.
Extend the peer dependency range and test against the upcoming Rollup 5 release. Also anchor pnpm workspace detection to the fixture so its installs no longer rewrite the workspace lockfile.
Extend the peer dependency range and test against the upcoming Rollup 5 release.
Extend the peer dependency range and test against the upcoming Rollup 5 release.
Also await restoring the incremental fixture file, which produced an unhandled ENOENT in the watchMode test, and raise the declaration-test timeout for cold CI runners.
Cold runners can exceed the 5s default when loading TypeScript and Rollup types. Use the same 20s default as test-earliest-supported-rollup; only one testTimeout key should remain when the branches merge.
@lukastaegert
lukastaegert force-pushed the simple-rollup-5-updates branch from 857c155 to c12d038 Compare November 28, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants