Skip to content

Update npm overrides syntax#81

Merged
PavelVanecek merged 2 commits intomainfrom
overrides
Nov 30, 2025
Merged

Update npm overrides syntax#81
PavelVanecek merged 2 commits intomainfrom
overrides

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Nov 30, 2025

The previous syntax we used works in node <22 but fails in node 24+. This new one works in all versions so let's use that. I couldn't find any details in changelogs but something changed somewhere apparently.

Summary by CodeRabbit

  • Chores
    • Consolidated multiple dependency override entries into a single, unified override group for the charting integration to simplify resolution.
    • Adjusted version constraints within that consolidated override to improve cross-package compatibility.
    • No other dependencies or public APIs were changed; overall structure and dev tooling remain intact.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

Walkthrough

Consolidates npm overrides in two integration package.json files by replacing separate @reduxjs/toolkit and react-redux overrides with a single recharts-scoped overrides block that lists versions for related packages; updates recharts dependency to latest in the ts4-react17 integration.

Changes

Cohort / File(s) Summary
Override consolidation (ts-react16)
integrations/ts-react16-overrides/package.json
Replaces individual overrides for @reduxjs/toolkit and react-redux with a single consolidated overrides.recharts block specifying versions for @reduxjs/toolkit, react-redux, redux, react, and react-dom. No other deps/devDeps changed.
Override consolidation and dependency update (ts4-react17)
integrations/ts4-react17/package.json
Updates recharts dependency from ^3.0.0 to latest and replaces separate overrides for @reduxjs/toolkit and react-redux with a single overrides.recharts block listing @reduxjs/toolkit (^1.9.7), react-redux (^8.1.3), redux (^4.2.1), react (^17.0.1), and react-dom (^17.0.1).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check that the consolidated overrides.recharts produces the intended transitive dependency resolutions.
  • Verify recharts set to "latest" in integrations/ts4-react17/package.json is acceptable for stability and CI reproducibility.
  • Confirm no other packages rely on the previous, narrower override scopes.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update npm overrides syntax' accurately reflects the main change: replacing old npm overrides syntax with new syntax to support Node 24+.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch overrides

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e13314 and bd7bacc.

📒 Files selected for processing (1)
  • integrations/ts4-react17/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • integrations/ts4-react17/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). (8)
  • GitHub Check: npm:my-charts-react19:app-react19 on node 22.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 24.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 20.x
  • GitHub Check: yarn:my-charts-react19:app-react18 on node 24.x
  • GitHub Check: yarn:integrations/ts-react16-resolutions on node 24.x
  • GitHub Check: yarn:integrations/ts-react18 on node 22.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 22.x
  • GitHub Check: yarn:integrations/ts-react16-resolutions on node 20.x

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
Contributor

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02d2f18 and 9e13314.

📒 Files selected for processing (2)
  • integrations/ts-react16-overrides/package.json (1 hunks)
  • integrations/ts4-react17/package.json (2 hunks)
⏰ 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). (7)
  • GitHub Check: npm:integrations/ts-react16-overrides on node 22.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 24.x
  • GitHub Check: yarn:integrations/ts-react16 on node 24.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 22.x
  • GitHub Check: npm:integrations/ts4-react17 on node 22.x
  • GitHub Check: npm:integrations/ts-react18 on node 20.x
  • GitHub Check: npm:integrations/ts-react16-overrides on node 20.x
🔇 Additional comments (2)
integrations/ts4-react17/package.json (1)

34-41: Clarify the scope and necessity of the nested override syntax.

The nested override structure ("recharts": { ... }) applies only to packages when they are dependencies of recharts, but react and react-dom are direct dependencies in this package.json (lines 12-13) and therefore won't be correctly overridden by the scoped rule. For direct dependencies, use a flat override structure instead.

Additionally, web searches for npm changelog documentation show no breaking change in the overrides syntax between Node 22 and Node 24. The feature works to force compatible versions, but requires a clean install to apply properly and has had historical bugs where overrides are silently ignored. Clarify whether the issue is the syntax itself or whether a clean npm install and version validation resolved the Node 24 problem.

  • Verify @reduxjs/toolkit and react-redux are only transitive dependencies of recharts; if not, move them to the flat override level.
  • Confirm that a clean install with this configuration works in Node 24, and document the specific Node 24 incompatibility that was resolved.
integrations/ts-react16-overrides/package.json (1)

35-42: The scoped override syntax is valid, but clarify the actual Node 24 compatibility issue and redundant scoping.

The nested overrides structure is documented and valid npm syntax. However, the original concern about "breaking changes" in npm overrides syntax between Node 22 and 24 is incorrect. The actual issue is that Node 24 ships with npm v11 (which has different lockfile validation and overrides behavior compared to earlier npm versions), and upgrading Node requires regenerating the package-lock.json to match the new npm version's resolution.

Additionally, react and react-dom are direct dependencies (lines 14–15), so overriding them globally at the root level is appropriate. Scoping these overrides under the "recharts" key (lines 36–42) means they only override when recharts requests them—but since react and react-dom are also direct deps with identical versions, this scoping is partially redundant. Consider either:

  1. Moving react and react-dom out of the recharts scope and into the root overrides (if you want them globally pinned), or
  2. Documenting why the recharts-scoped override is necessary (e.g., if recharts' transitive dependencies conflict).

Ensure the package-lock.json was regenerated under Node 24 / npm v11 to avoid install/CI failures due to lockfile drift.

@PavelVanecek PavelVanecek merged commit e15fdba into main Nov 30, 2025
47 checks passed
@PavelVanecek PavelVanecek deleted the overrides branch November 30, 2025 10:50
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.

1 participant