Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@eslint/js": "^9.32.0",
"@octokit/rest": "^21.1.1",
"@rhds/icons": "^2.0.0",
"@rollup/plugin-commonjs": "^26.0.3",
"@rollup/plugin-node-resolve": "^15.3.1",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-replace": "^6.0.2",
Comment on lines +36 to +38
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

@rollup/plugin-commonjs version 28 breaking changes migration guide

💡 Result:

Web search failed: Server error: no LLM provider could handle the message


🌐 Web query:

@rollup/plugin-node-resolve version 16 breaking changes migration guide

💡 Result:

Summary of breaking change (v16)

  • The plugin now includes a "development|production" conditional when resolving package exports. By default it will pick "production" unless NODE_ENV is set to something other than "production" (so resolution can differ between dev and prod). This is the breaking change introduced in v16. [1][2]

What this can break

  • Packages with conditional exports that provide different files for the "development" vs "production" condition may resolve to a different entry than in v15 (potentially changing runtime code or requiring different bundler handling).
  • Interaction with @rollup/plugin-commonjs v16+: require-resolution semantics changed (commonjs v16+ uses require conditions), so behavior for require() vs import may differ if you don't configure conditions. [2]

Migration steps / quick fixes

  1. Audit packages with conditional exports

    • Search your dependencies for "exports" fields in package.json and look for branches keyed by "development" / "production".
  2. Explicitly set exportConditions in node-resolve config to reproduce previous behavior

    • If you want the old (pre-v16) behavior for ESM imports, set exportConditions to an explicit array:
      • For Node-like resolution: exportConditions: ['node']
      • To keep only ESM/import resolution: exportConditions: ['default','module','import']
      • Example:
        nodeResolve({ exportConditions: ['default','module','import'] })
    • To include require semantics for require() calls (commonjs interop), pair with @rollup/plugin-commonjs v16+ and/or use: exportConditions: ['default','module','require'] as needed. [2]
  3. Control dev vs prod choice via NODE_ENV (if you rely on the plugin's default)

    • The plugin defaults to "production" unless NODE_ENV !== 'production', so set NODE_ENV in your build scripts if you rely on the dev condition:
      • e.g. cross-env NODE_ENV=development rollup -c
    • Or avoid relying on NODE_ENV and set explicit exportConditions in the plugin config (recommended). [2]
  4. Note small API/typing additions

    • v16.x added options/typing fixes such as ignoreSideEffectsForRoot (see v16.0.1). If you rely on sideEffects behavior for the root package, consider the new ignoreSideEffectsForRoot option. [1]

Where to read the authoritative details

  • plugin-node-resolve package page / options (describes exportConditions default and behavior). [2]
  • plugin changelog / releases (v16.0.0 breaking-change entry and subsequent patch notes). [1]

If you want, I can:

  • produce the exact patch you should apply to your rollup.config.js (showing the nodeResolve(...) change), or
  • scan a package.json + rollup config you paste and recommend the exact exportConditions to use.

🌐 Web query:

@rollup/plugin-replace version 6 breaking changes migration guide

💡 Result:

Summary — breaking change in v6

  • The v6 release notes state one breaking change: "fix!: objectGuards doesn't take effects" (v6.0.0, 2024-09-23). [1]

What that means (short)

  • The objectGuards option no longer treats property reads as having side effects for the purpose of replacement guards. If your replacements relied on objectGuards to detect or preserve side-effectful property accesses (e.g., code paths that threw or invoked getters), that behavior changed: objectGuards will no longer consider those accesses as “effects.”

Quick migration steps

  1. Audit uses of objectGuards in your Rollup config (@rollup/plugin-replace options). If you passed guards expecting side-effect detection, update those guards to explicit checks that don’t rely on property-read side‑effects.
  2. Prefer explicit replacement strategies:
    • Use preventAssignment: true when you want to avoid replacing left‑hand assignments. [1]
    • Use typeofReplacements / values / function-based replacements for finer control (replace values with functions that inspect module id/match). [1]
  3. Run a full build and unit/integration tests to find any regressions where replacements were previously skipped/kept due to side-effect assumptions; convert those cases to explicit guards or manual conditional code.
  4. If you need previous behavior for a specific case and can’t change source, wrap or pre-process the code (or keep using an older plugin version) until you refactor.

References

  • @rollup/plugin-replace ChangeLog (v6.0.0 breaking change: "objectGuards doesn't take effects"). [1]

Would you like me to: (a) scan your rollup config for uses of objectGuards and suggest exact changes, or (b) fetch the related PR/issue (#1764) and show the discussion?


🏁 Script executed:

#!/bin/bash
# Check for Rollup configuration files and the structure of the repository
echo "=== Rollup Configuration Files ==="
find . -maxdepth 3 -type f \( -name "rollup.config.*" -o -name ".rolluprc*" \) | head -20

echo ""
echo "=== Repository Structure (top level) ==="
ls -la | head -30

echo ""
echo "=== package.json location and size ==="
find . -name "package.json" -type f | head -5

Repository: patternfly/patternfly-react

Length of output: 2318


🏁 Script executed:

#!/bin/bash
# Check npm registry for the specific versions to verify they exist
echo "=== Checking if versions exist on npm ==="
npm view @rollup/plugin-commonjs@28.0.2 version 2>/dev/null || echo "Version 28.0.2 not found or error"
npm view @rollup/plugin-node-resolve@16.0.0 version 2>/dev/null || echo "Version 16.0.0 not found or error"
npm view @rollup/plugin-replace@6.0.2 version 2>/dev/null || echo "Version 6.0.2 not found or error"

Repository: patternfly/patternfly-react

Length of output: 132


🏁 Script executed:

#!/bin/bash
# Read the rollup config files to check current plugin configurations
echo "=== Root level package.json (lines 30-40) ==="
sed -n '30,40p' ./package.json

echo ""
echo "=== ./packages/react-core/rollup.config.mjs ==="
cat ./packages/react-core/rollup.config.mjs

echo ""
echo "=== ./packages/react-table/rollup.config.mjs ==="
cat ./packages/react-table/rollup.config.mjs

echo ""
echo "=== ./packages/react-templates/rollup.config.mjs ==="
cat ./packages/react-templates/rollup.config.mjs

Repository: patternfly/patternfly-react

Length of output: 1374


🌐 Web query:

@rollup/plugin-commonjs v28 v27 breaking changes changelog

💡 Result:

Summary of breaking changes:

Sources: [1] v28 changelog, [2] v27/v28 release notes, [3] packaged CHANGELOG.

Citations:


🌐 Web query:

@rollup/plugin-commonjs v26 to v28 migration guide

💡 Result:

Short migration checklist (v26 → v28)

  1. Upgrade package
  • npm: npm install --save-dev @rollup/plugin-commonjs@^28
  • pnpm/yarn similarly. [1]
  1. Key breaking changes to watch
  • v27: strictRequires defaults to true — if your build relied on loose/dynamic require behavior, set strictRequires: false in the plugin options (or audit dynamic require usage). [1][2]
  • v27: top-level this replacement — code that relied on top-level this may behave differently because top-level this is replaced with the exports identifier; audit modules that expect global/this semantics. [1][2]
  • v28: internal dependency change (switched to fdir) — fewer transitive deps; unlikely to break your config but note the change if you pin dependencies. [1]
  1. Notable fixes / recommendations in v28
  • Docs: output.exports recommendation also applies to IIFE builds — ensure your Rollup output.export settings are appropriate for bundles that wrap CJS modules. [1]
  • Several bugfixes around dynamicRequireRoot, proxy modules, node: builtins and modules with falsy __esModule — update if you saw related runtime errors previously. [1][3]
  1. Practical steps to migrate safely
  • Pin and run tests: install v28 in a branch and run full test suite and CI.
  • Search your code for dynamic require patterns and top-level this usage; update or set plugin options: e.g.
    • commonjs({ strictRequires: false }) if you need old behavior.
  • If you bundle for Rollup 4, follow Rollup 4 migration notes (Node >=18 and update plugins). [4]
  • If you hit regressions, check the plugin changelog/issues for the specific v28.x patch that addresses it. [1][3]

References

  • @rollup/plugin-commonjs changelog (v26→v28 notes, breaking changes and release notes). [1]
  • v27 breaking changes (strictRequires default, top-level this change). [1][2]
  • v28 bugfix patches (dynamicRequireRoot, proxy modules, node: builtins). [1][3]
  • Rollup 4 migration notes (general plugin compatibility reminders). [4]

Sources
[1] @rollup/plugin-commonjs changelog / release notes.
[2] v27 release notes / changelog entries.
[3] v28 patch release notes (v28.0.2–v28.0.6).
[4] Rollup migration docs.


🏁 Script executed:

#!/bin/bash
# Find and read the base rollup config
echo "=== ./rollup.base.mjs ===" 
cat ./rollup.base.mjs

Repository: patternfly/patternfly-react

Length of output: 163


🏁 Script executed:

#!/bin/bash
# Also check for any Rollup config at the root
echo "=== Files in root containing 'rollup' ==="
find . -maxdepth 1 -type f -name "*rollup*"

echo ""
echo "=== Check for other config files that might use these plugins ==="
fd -e mjs -e js -e ts "rollup" --max-depth 2 | grep -v node_modules | grep -v ".git"

Repository: patternfly/patternfly-react

Length of output: 204


🏁 Script executed:

#!/bin/bash
# Read the base rollup config file
cat ./packages/rollup.base.mjs

Repository: patternfly/patternfly-react

Length of output: 1962


Configuration updates required for Rollup plugin major version upgrades.

Breaking changes have been confirmed in two of the three updated plugins that require config changes:

@rollup/plugin-node-resolve v16 (from v15.3.1):

  • Breaking change: Export conditions logic now includes "development|production" conditional (defaults to "production" unless NODE_ENV set during build)
  • Current config in ./packages/rollup.base.mjs line 30 uses nodeResolve() with no exportConditions specified
  • This will change package resolution behavior for dependencies with conditional exports
  • Fix: Set explicit exportConditions in config (e.g., nodeResolve({ exportConditions: ['default','module','import'] })) to preserve v15 behavior

@rollup/plugin-commonjs v28 (from v26.0.3):

  • Breaking changes in v27: strictRequires defaults to true (was false); top-level this replacement behavior changed
  • Current config line 31 uses commonjs() with no options
  • If code relies on loose/dynamic require behavior or top-level this semantics, builds may break
  • Fix: Audit for dynamic require() patterns and top-level this usage; set strictRequires: false if needed to restore v26 behavior, or update code to match new semantics

@rollup/plugin-replace v6 (from v5.0.7):

  • Breaking change: objectGuards no longer treats property reads as side effects
  • Current config uses only replace({ 'process.env.NODE_ENV': ... }) without objectGuards, so this change has minimal impact

Run full test suite on each package in ./packages after applying config updates to verify no regressions in output bundles or module resolution.

🤖 Prompt for AI Agents
In @package.json around lines 35 - 37, Update the Rollup plugin configs in
rollup.base.mjs: when calling nodeResolve() pass explicit exportConditions
(e.g., exportConditions: ['default','module','import']) to preserve previous v15
resolution behavior; for commonjs(), either set strictRequires: false to retain
v26 loose require semantics or audit and refactor dynamic/top-level-this code
and remove that fallback; leave replace() unchanged but be aware objectGuards
behavior changed; after making these config changes for nodeResolve and
commonjs, run the full test suite across all ./packages to validate bundles and
module resolution.

"@rollup/plugin-terser": "^0.4.4",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
Expand Down
70 changes: 37 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4716,9 +4716,9 @@ __metadata:
"@eslint/js": "npm:^9.32.0"
"@octokit/rest": "npm:^21.1.1"
"@rhds/icons": "npm:^2.0.0"
"@rollup/plugin-commonjs": "npm:^26.0.3"
"@rollup/plugin-node-resolve": "npm:^15.3.1"
"@rollup/plugin-replace": "npm:^5.0.7"
"@rollup/plugin-commonjs": "npm:^28.0.2"
"@rollup/plugin-node-resolve": "npm:^16.0.0"
"@rollup/plugin-replace": "npm:^6.0.2"
"@rollup/plugin-terser": "npm:^0.4.4"
"@testing-library/dom": "npm:^10.4.1"
"@testing-library/jest-dom": "npm:^6.9.1"
Expand Down Expand Up @@ -4908,28 +4908,29 @@ __metadata:
languageName: node
linkType: hard

"@rollup/plugin-commonjs@npm:^26.0.3":
version: 26.0.3
resolution: "@rollup/plugin-commonjs@npm:26.0.3"
"@rollup/plugin-commonjs@npm:^28.0.2":
version: 28.0.3
resolution: "@rollup/plugin-commonjs@npm:28.0.3"
dependencies:
"@rollup/pluginutils": "npm:^5.0.1"
commondir: "npm:^1.0.1"
estree-walker: "npm:^2.0.2"
glob: "npm:^10.4.1"
fdir: "npm:^6.2.0"
is-reference: "npm:1.2.1"
magic-string: "npm:^0.30.3"
picomatch: "npm:^4.0.2"
peerDependencies:
rollup: ^2.68.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
checksum: 10c0/b9c24dbd4efb9648395135ceddd43af45b748f81a600ee4bfeaed099970d548b4557b57b86b86e1ba0005fe3a68f56e2319917724fd4d60b471d6b7ab9a73628
checksum: 10c0/0dbc61a5a894cdf526c3f0a738243cf1b3f634d592db0f2b9cad8c5d8e4c3e645d9b7ac19761c07a8a475118cafa6cdef4746111019388dd6e962f7373878ea4
languageName: node
linkType: hard

"@rollup/plugin-node-resolve@npm:^15.3.1":
version: 15.3.1
resolution: "@rollup/plugin-node-resolve@npm:15.3.1"
"@rollup/plugin-node-resolve@npm:^16.0.0":
version: 16.0.0
resolution: "@rollup/plugin-node-resolve@npm:16.0.0"
dependencies:
"@rollup/pluginutils": "npm:^5.0.1"
"@types/resolve": "npm:1.20.2"
Expand All @@ -4941,13 +4942,13 @@ __metadata:
peerDependenciesMeta:
rollup:
optional: true
checksum: 10c0/ecf3abe890fc98ad665fdbfb1ea245253e0d1f2bc6d9f4e8f496f212c76a2ce7cd4b9bc0abd21e6bcaa16f72d1c67cc6b322ea12a6ec68e8a8834df8242a5ecd
checksum: 10c0/b63deb6fc14b37070ccaffacc8c10c9720f28ce7632f4fe2ee77064c0c79bcc3fe060fb77160e673c9fd847307252f25a2983030bd54f1888324063c69ae1399
languageName: node
linkType: hard

"@rollup/plugin-replace@npm:^5.0.7":
version: 5.0.7
resolution: "@rollup/plugin-replace@npm:5.0.7"
"@rollup/plugin-replace@npm:^6.0.2":
version: 6.0.2
resolution: "@rollup/plugin-replace@npm:6.0.2"
dependencies:
"@rollup/pluginutils": "npm:^5.0.1"
magic-string: "npm:^0.30.3"
Expand All @@ -4956,7 +4957,7 @@ __metadata:
peerDependenciesMeta:
rollup:
optional: true
checksum: 10c0/1732af42febdb42d96fd7916b65ca94a550a028d1ea5efa40d5d7a99ab3c336e41efac14a77eefef18b956b4b7335969c6252f2a22bf0223dc8b4a7a53f89ed3
checksum: 10c0/71c0dea46f560c8dff59853446d43fa0e8258139a74d2af09fce5790d0540ff3d874c8fd9962cb049577d25327262bfc97485ef90b2a0a21bf28a9d3bd8c6d44
languageName: node
linkType: hard

Expand Down Expand Up @@ -11715,6 +11716,18 @@ __metadata:
languageName: node
linkType: hard

"fdir@npm:^6.2.0":
version: 6.4.3
resolution: "fdir@npm:6.4.3"
peerDependencies:
picomatch: ^3 || ^4
peerDependenciesMeta:
picomatch:
optional: true
checksum: 10c0/d13c10120e9625adf21d8d80481586200759928c19405a816b77dd28eaeb80e7c59c5def3e2941508045eb06d34eb47fad865ccc8bf98e6ab988bb0ed160fb6f
languageName: node
linkType: hard

"fdir@npm:^6.4.3, fdir@npm:^6.4.4, fdir@npm:^6.5.0":
version: 6.5.0
resolution: "fdir@npm:6.5.0"
Expand Down Expand Up @@ -12684,22 +12697,6 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^10.4.1":
version: 10.4.2
resolution: "glob@npm:10.4.2"
dependencies:
foreground-child: "npm:^3.1.0"
jackspeak: "npm:^3.1.2"
minimatch: "npm:^9.0.4"
minipass: "npm:^7.1.2"
package-json-from-dist: "npm:^1.0.0"
path-scurry: "npm:^1.11.1"
bin:
glob: dist/esm/bin.mjs
checksum: 10c0/2c7296695fa75a935f3ad17dc62e4e170a8bb8752cf64d328be8992dd6ad40777939003754e10e9741ff8fbe43aa52fba32d6930d0ffa0e3b74bc3fb5eebaa2f
languageName: node
linkType: hard

"glob@npm:^11.0.0":
version: 11.0.1
resolution: "glob@npm:11.0.1"
Expand Down Expand Up @@ -18474,7 +18471,14 @@ __metadata:
languageName: node
linkType: hard

"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3":
"picomatch@npm:^4.0.2":
version: 4.0.2
resolution: "picomatch@npm:4.0.2"
checksum: 10c0/7c51f3ad2bb42c776f49ebf964c644958158be30d0a510efd5a395e8d49cb5acfed5b82c0c5b365523ce18e6ab85013c9ebe574f60305892ec3fa8eee8304ccc
languageName: node
linkType: hard

"picomatch@npm:^4.0.3":
version: 4.0.3
resolution: "picomatch@npm:4.0.3"
checksum: 10c0/9582c951e95eebee5434f59e426cddd228a7b97a0161a375aed4be244bd3fe8e3a31b846808ea14ef2c8a2527a6eeab7b3946a67d5979e81694654f939473ae2
Expand Down
Loading