Repository navigation
fix(modern-js-v3): share JSX runtimes when React is shared - #5307
BleedingDev wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 684c1bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 48 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fac39bb9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Issue #5154 | Zack Jackson's recommendation
Why the change
A remote can bundle an incompatible JSX runtime even when React is shared, so the Modern.js integration now shares both JSX runtimes with React's policy when React has a local fallback.
Special things to note
@module-federation/modern-js-v3changes. Core federation and the standalone Rsbuild integration remain unchanged.react/take precedence. Consume-only React withimport: falsereceives no implicit JSX entries. Replacement React imports also need explicit JSX subpath configuration.Change outline
The browser and server configurations use the same defaults:
The defaults preserve array and object forms without mutating them. They do not reuse React's root import, request, or share key for a JSX runtime. Applying them twice adds nothing further.
All 39 focused tests pass on Node 24. Six consume-only regression cases failed before the review fix. They cover arrays, explicit JSX entries, and both browser and server configurations. Targeted strict TypeScript, package lint, formatting, and commit-message checks pass.
pnpm --filter @module-federation/modern-js-v3 exec rstest run src/cli/reactShared.spec.ts src/cli/configPlugin.spec.tsCreated with GPT-6.1 Sol in Codex.