Skip to content

Conversation

@Mash707
Copy link
Contributor

@Mash707 Mash707 commented Mar 6, 2025

Towards #11491
The following dependencies are updated

  • @rollup/plugin-commonjs to ^28.0.2
  • @rollup/plugin-node-resolve to ^16.0.0
  • @rollup/plugin-replace to ^6.0.2

Summary by CodeRabbit

  • Chores
    • Updated build tool devDependencies to newer major versions for improved compatibility and build resolution.
    • No changes to public APIs or exported declarations.

✏️ Tip: You can customize this high-level summary in your review settings.

@patternfly-build
Copy link
Collaborator

patternfly-build commented Mar 6, 2025

@thatblindgeye thatblindgeye requested a review from tlabaj March 10, 2025 12:57
@thatblindgeye thatblindgeye mentioned this pull request Mar 7, 2025
16 tasks
@thatblindgeye
Copy link
Contributor

Adding the "Do not merge" label for now as we need to investigate what - if any - consumer impact there is. Depending on that this may need to be held off until a breaking change release.

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the Stale label May 15, 2025
@github-actions github-actions bot removed the Stale label May 23, 2025
@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the Stale label Jul 22, 2025
@Mash707 Mash707 force-pushed the update-rollup-dependency branch from c57c150 to 72095a8 Compare January 9, 2026 19:41
@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Walkthrough

Bumped three Rollup-related devDependencies in package.json: @rollup/plugin-commonjs, @rollup/plugin-node-resolve, and @rollup/plugin-replace. No exported/public API changes; other package entries unchanged.

Changes

Cohort / File(s) Summary
Rollup devDependencies
package.json
Updated @rollup/plugin-commonjs to ^28.0.2, @rollup/plugin-node-resolve to ^16.0.0, and @rollup/plugin-replace to ^6.0.2. No other dependency or public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore(deps): update dependency @rollup' is vague and generic. It mentions '@rollup' but doesn't specify which plugins or versions are being updated, making it unclear what the actual change is about. Use a more specific title like 'chore(deps): update rollup plugins to v28/v16/v6' or 'chore(deps): update @rollup plugin versions' to better convey which dependencies and versions are involved.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72095a8 and 188628e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Build, test & deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @package.json:
- Around line 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.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 296178f and 72095a8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json

Comment on lines +35 to +37
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-replace": "^6.0.2",
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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants