chore(react19): automatic JSX runtime, remove deprecated defaultProps#3452
chore(react19): automatic JSX runtime, remove deprecated defaultProps#3452charlesmulder wants to merge 4 commits intoRedHatInsights:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (4)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughSwitches the project to React's automatic JSX transform by updating SWC and TypeScript configs, adding Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/webpack.cy.config.js (1)
39-43: Addreact/jsx-runtimeto Cypress Module Federation shared deps for consistency with productionThe automatic JSX runtime enabled at lines 39-43 implicitly requires
react/jsx-runtime. The production config (webpack.plugins.js) shares this dependency with version constraint, but the Cypress config omits it. Adding it to the shared list ensures consistency across test and production Module Federation configurations.Proposed patch
shared: [ { react: { singleton: true, eager: true } }, { 'react-dom': { singleton: true, eager: true } }, + { 'react/jsx-runtime': { singleton: true, eager: true } }, { 'react-router-dom': { singleton: true } }, { '@openshift/dynamic-plugin-sdk': { singleton: true } },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@config/webpack.cy.config.js` around lines 39 - 43, The Cypress webpack config enables the automatic JSX runtime (transform.react.runtime = 'automatic') but the ModuleFederationPlugin shared dependencies list omits 'react/jsx-runtime', causing inconsistency with production; update the ModuleFederationPlugin shared configuration to include 'react/jsx-runtime' alongside 'react' and 'react-dom' (use the same sharing options/version constraint pattern as in webpack.plugins.js, e.g., singleton/requiredVersion settings) so the Cypress build shares the same runtime module as production.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@config/webpack.cy.config.js`:
- Around line 39-43: The Cypress webpack config enables the automatic JSX
runtime (transform.react.runtime = 'automatic') but the ModuleFederationPlugin
shared dependencies list omits 'react/jsx-runtime', causing inconsistency with
production; update the ModuleFederationPlugin shared configuration to include
'react/jsx-runtime' alongside 'react' and 'react-dom' (use the same sharing
options/version constraint pattern as in webpack.plugins.js, e.g.,
singleton/requiredVersion settings) so the Cypress build shares the same runtime
module as production.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d1362fee-8847-47bb-8b8c-93c12265270c
📒 Files selected for processing (11)
config/webpack.config.jsconfig/webpack.cy.config.jsconfig/webpack.plugins.jssrc/analytics/useAmplitude.test.tsxsrc/bootstrap.tsxsrc/components/Header/HeaderAlert.tsxsrc/hooks/useQuickstarLinksStore.tsxsrc/hooks/useTrialRedirect.test.tsxsrc/inventoryPoc/FilterToolbar.tsxsrc/utils/loading-fallback.tsxtsconfig.json
💤 Files with no reviewable changes (4)
- src/analytics/useAmplitude.test.tsx
- src/utils/loading-fallback.tsx
- src/components/Header/HeaderAlert.tsx
- src/inventoryPoc/FilterToolbar.tsx
013509e to
cba15ad
Compare
cba15ad to
d676656
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Preparatory changes for React 19 (RHCLOUD-44375). No functional changes — build config and dead code removal only. Tenant apps remain on React 18.3.
Switch JSX transform to automatic runtime (
tsconfig.json, SWC loader inwebpack.config.js+webpack.cy.config.js)Add
react/jsx-runtimeas a Module Federation singleton in production config; non-eager singleton in Cypress config (eager causes a share scope initialization deadlock in Cypress's bootstrapless MF environment)Add
@rhds/iconsresolve alias to Cypress webpack config to fix a module-not-found error from@rhds/elementsRemove
defaultPropsonHeaderAlertandGenerateId— deprecated in React 18.3, removed in React 19; defaults already declared in function destructuringRemove unnecessary
Reactdefault imports in 5 files — only needed for the old classic JSX transformOut of scope (deferred to RHCLOUD-44216)
onUncaughtError/onCaughtErroroncreateRoot, React 19 codemods (forwardRefmigration, ref callback types), and dependency upgrades (react@19,react-intl,@testing-library/react).Summary by CodeRabbit
Refactor
Style
Lint