Skip to content

Babel classic runtime and overrides fix even more test combinations#82

Merged
ckifer merged 1 commit intomainfrom
fix-library-tests
Nov 30, 2025
Merged

Babel classic runtime and overrides fix even more test combinations#82
ckifer merged 1 commit intomainfrom
fix-library-tests

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Nov 30, 2025

I figured out the combination that makes these tests green so let's enable them in CI so that we have feedback.

Summary by CodeRabbit

  • Chores
    • Updated React and React-DOM versions across multiple applications and libraries to ensure compatibility.
    • Configured dependency resolution and version overrides for transitive packages to maintain consistency across builds.
    • Adjusted JSX build configuration for React 16, 17, and 18 library implementations.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

Walkthrough

Updates configuration files across React 16/17/18 packages to manage recharts transitive dependencies via npm overrides and resolutions, changes Babel JSX runtime from automatic to classic mode across library packages, and applies string formatting standardization to test utilities.

Changes

Cohort / File(s) Summary
React 16 App Configuration
apps-3rd-party/app-react16/package.json
Bumps react and react-dom from ^16.0.0 to ^16.8.x; adds overrides block pinning recharts transitive dependencies (react-redux, @reduxjs/toolkit, redux) to specific versions
React 17 App Configuration
apps-3rd-party/app-react17/package.json
Adds overrides block for recharts constraining transitive dependencies (@reduxjs/toolkit ^1.9.7, react-redux ^8.1.3, redux ^4.2.1, react ^17.0.0, react-dom ^17.0.0)
Library Babel JSX Runtime Configuration
libraries/my-charts-react16/.babelrc, libraries/my-charts-react17/.babelrc, libraries/my-charts-react18/.babelrc
Changes Babel React preset runtime from automatic to classic mode in each configuration file (3 files total)
React 16-17 Library Dependency Management
libraries/my-charts-react16/package.json, libraries/my-charts-react17/package.json
Adds overrides and resolutions blocks for recharts; pins @reduxjs/toolkit, react-redux, redux to specific versions and constrains react/react-dom versions by major version (16.8.x or 17.x)
Test Utilities Formatting
test-ui/server/scripts/test-registry.ts
Standardizes string literals from single quotes to double quotes in type definitions and test data object literals

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Multiple files follow repetitive patterns (dependency overrides applied consistently across packages)
  • .babelrc changes are straightforward single-line configuration updates
  • Test file contains only cosmetic string formatting with no functional changes
  • No complex logic or conditional dependencies requiring detailed scrutiny

Possibly related PRs

  • recharts/recharts-integ#81: Consolidates npm overrides for recharts transitive dependencies using the same semantic approach to manage @reduxjs/toolkit, react-redux, and redux versions.

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 accurately describes the main changes: updating Babel runtime from automatic to classic across multiple .babelrc files and adding dependency overrides/resolutions to package.json files to handle test combination compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-library-tests

📜 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 9b39944 and da4ba33.

📒 Files selected for processing (8)
  • apps-3rd-party/app-react16/package.json (2 hunks)
  • apps-3rd-party/app-react17/package.json (1 hunks)
  • libraries/my-charts-react16/.babelrc (1 hunks)
  • libraries/my-charts-react16/package.json (1 hunks)
  • libraries/my-charts-react17/.babelrc (1 hunks)
  • libraries/my-charts-react17/package.json (1 hunks)
  • libraries/my-charts-react18/.babelrc (1 hunks)
  • test-ui/server/scripts/test-registry.ts (5 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-30T04:39:58.861Z
Learnt from: PavelVanecek
Repo: recharts/recharts-integ PR: 80
File: .github/workflows/integ.yml:57-57
Timestamp: 2025-11-30T04:39:58.861Z
Learning: In .github/workflows/integ.yml, Node.js version 22.18.x is the minimum required version because it enables built-in TypeScript type stripping by default, which is essential for the test-ui TypeScript/ESM implementation.

Applied to files:

  • apps-3rd-party/app-react16/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). (20)
  • GitHub Check: yarn:integrations/ts-react19 on node 25.x
  • GitHub Check: yarn:my-charts-react18:app-react17 on node 25.x
  • GitHub Check: yarn:my-charts-react19:app-react18 on node 25.x
  • GitHub Check: yarn:my-charts-react17:app-react17 on node 25.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 25.x
  • GitHub Check: yarn:my-charts-react19:app-react19 on node 25.x
  • GitHub Check: yarn:my-charts-react16:app-react16 on node 25.x
  • GitHub Check: npm:my-charts-react19:app-react19 on node 25.x
  • GitHub Check: npm:my-charts-react18:app-react17 on node 25.x
  • GitHub Check: npm:my-charts-react19:app-react18 on node 25.x
  • GitHub Check: yarn:integrations/ts-react16-overrides on node 25.x
  • GitHub Check: npm:my-charts-react17:app-react16 on node 24.x
  • GitHub Check: npm:my-charts-react19:app-react19 on node 24.x
  • GitHub Check: yarn:integrations/ts-react19 on node 22.18.x
  • GitHub Check: npm:my-charts-react19:app-react18 on node 24.x
  • GitHub Check: npm:my-charts-react17:app-react17 on node 24.x
  • GitHub Check: npm:integrations/ts4-react17 on node 24.x
  • GitHub Check: yarn:my-charts-react18:app-react17 on node 22.18.x
  • GitHub Check: yarn:my-charts-react17:app-react16 on node 22.18.x
  • GitHub Check: npm:my-charts-react17:app-react16 on node 22.18.x
🔇 Additional comments (10)
libraries/my-charts-react18/.babelrc (1)

4-4: Classic JSX runtime change looks fine; confirm React imports in source.

Switching @babel/preset-react to runtime: "classic" is consistent with the other packages and should be safe, provided all JSX files in my-charts-react18 keep React in scope via imports (since the automatic runtime no longer injects it).

libraries/my-charts-react17/.babelrc (1)

4-4: Aligning React 17 package to classic runtime is reasonable; just ensure imports are present.

The move to runtime: "classic" here keeps Babel behavior consistent across your React 16/17/18 libraries; just double‑check that all JSX in my-charts-react17 still imports React so builds don’t regress.

apps-3rd-party/app-react16/package.json (1)

15-16: React 16.8.x alignment and Recharts overrides look consistent.

Using react/react-dom ^16.8.x in both dependencies and overrides.recharts should prevent a stray React 17/18 from being pulled in through recharts or its stack. Please just confirm that:

  • The package manager(s) used in CI actually support overrides, and
  • You’ve regenerated the lockfile so Recharts and its Redux‑related deps resolve into this React 16.8.x universe.

Also applies to: 34-42

libraries/my-charts-react16/.babelrc (1)

4-4: Classic runtime for React 16 library is consistent with the rest.

The runtime: "classic" setting matches the other React*-flavored libraries and is appropriate for React 16; just ensure the src files for my-charts-react16 still have import React from "react"; (or equivalent) wherever JSX is used.

libraries/my-charts-react16/package.json (1)

35-48: React 16.8.0 overrides/resolutions align with peerDependencies.

The overrides.recharts block and resolutions for react/react-dom all target ^16.8.0, matching this library’s peer dependency constraints and keeping Recharts’ transitive React pinned in the same band. That’s a good way to avoid mixed React majors in the test workspace; just confirm how your package manager(s) combine overrides and resolutions in this monorepo and that the resulting dependency tree has a single React 16 line.

libraries/my-charts-react17/package.json (1)

35-48: Union React 16/17 ranges in overrides/resolutions match library intent.

The overrides.recharts and resolutions entries using ^16.8.0 || ^17.0.0 are consistent with this package’s peerDependencies and should let you exercise both React 16 and 17 scenarios without pulling in React 18+. It’s worth double‑checking, in your install scripts, that tests which are meant to run with React 16 actually install that version (since package managers tend to pick the highest version satisfying such a union by default).

apps-3rd-party/app-react17/package.json (1)

34-42: Recharts overrides for React 17 app are coherent with app dependencies.

The overrides.recharts block pins react, react-dom, and the Redux stack to 17-compatible versions, matching the app’s own react/react-dom ^17.0.0 dependencies and helping avoid a second React major creeping in through recharts. Please just confirm the lockfile for this app reflects these overrides so CI runs exactly this combination.

test-ui/server/scripts/test-registry.ts (3)

8-11: Type aliases and direct test definitions remain clear and consistent.

The literal union types for PackageManager, TestType, and TestStability plus the directDependencyTests matrix look coherent: npm/yarn entries are symmetric where expected, and the stability flags (e.g., marking ts-react16-overrides as stable for npm, broader stability for yarn direct tests) match the idea of gating CI to the healthier combinations. No functional issues spotted here.

Also applies to: 38-155


159-185: Library test combinations and stable set logic match the new dependency strategy.

The libraryTestCombinations list covers the expected matrix of my-charts-react{16,17,18,19} with app-react{16,17,18,19}, and stableLibraryTests correctly singles out which (pm, library, app) pairs are considered stable. Notably, the my-charts-react19 + app-react17 combo is left experimental for both npm and yarn, which aligns with the idea that this one is still flaky while neighboring combos are stable. The loop that derives libraryTests and assigns "stable" vs "experimental" from stableLibraryTests is straightforward and correct.

Also applies to: 187-201


205-207: Registry construction and filter helpers still behave as expected.

testRegistry built via Object.fromEntries(allTests.map(...)), getAllTestNames, getAllTests (with optional filters), and isStableTest all use simple, readable logic; the recent edits are formatting and quote-style only, and they preserve the original behavior of these helper APIs.

Also applies to: 219-226, 231-251, 256-259


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.

@ckifer ckifer merged commit 88a346e into main Nov 30, 2025
127 of 129 checks passed
@PavelVanecek PavelVanecek deleted the fix-library-tests branch November 30, 2025 23:28
This was referenced Dec 1, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 23, 2025
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.

2 participants