Skip to content

[CDX-458] Resolve incompatibility with react 1617#48

Merged
esezen merged 9 commits into
mainfrom
cdx-458-components-ui-resolve-incompatibility-with-react-1617-2
Jun 9, 2026
Merged

[CDX-458] Resolve incompatibility with react 1617#48
esezen merged 9 commits into
mainfrom
cdx-458-components-ui-resolve-incompatibility-with-react-1617-2

Conversation

@esezen

@esezen esezen commented May 15, 2026

Copy link
Copy Markdown
Contributor

Continuation of #47

Alexey-Pavlov and others added 5 commits May 6, 2026 13:55
Radix Slot's ESM output imports "react/jsx-runtime" which fails to resolve on React 16/17 + webpack 5 (fullySpecified mode) because those React versions lack an exports map. This removes the Radix dependency entirely and replaces it with a ~70-line implementation using only React.cloneElement/forwardRef, which is compatible with React >=16.12.
Copilot AI review requested due to automatic review settings May 15, 2026 20:11
@esezen esezen requested a review from a team as a code owner May 15, 2026 20:11
@esezen esezen changed the base branch from main to no-cdx-replace-radix-slot-react16-compat May 15, 2026 20:11

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

Comment thread .github/workflows/react-compat.yml Outdated

@constructor-claude-bedrock constructor-claude-bedrock Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This PR adds a React 16/17/18/19 compatibility test matrix (CI workflow + fixture projects) to guard against the react/jsx-runtime bare-specifier failure surfaced in CDX-458, and it is well-structured overall.

Inline comments: 4 discussions added

Overall Assessment: ⚠️ Needs Work


const root = document.getElementById('root');
if (root) {
ReactDOM.render(<App />, root);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important Issue: ReactDOM.render is the React 16/17 legacy API and works correctly here, but the React 17 fixture (test/react-compat/17/src/index.tsx) uses the identical file — including the same deprecated ReactDOM.render call. React 17 also supports ReactDOM.render, so this isn't a bug, but it means the React 17 fixture is not exercising the React 17 idiomatic entry point. More critically, if the intent is to verify that consumers can adopt the recommended patterns for each version, the React 17 entry point should match what a real React 17 consumer would write. Consider noting this distinction in a comment, or updating the React 17 fixture to document that ReactDOM.render is intentionally used (it was still the primary API in React 17).

compat:
runs-on: ubuntu-latest
strategy:
fail-fast: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: fail-fast: true means that if the React 16 cell fails, the React 17/18/19 cells are cancelled immediately. This is efficient for the CDX-458 use case (fail fast on the oldest version), but it makes it harder to see which versions are broken when multiple cells fail simultaneously (e.g. after a dependency upgrade). Consider setting fail-fast: false so all four cells always run to completion and the full compatibility picture is visible in a single CI run.

@deomsj deomsj left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

Base automatically changed from no-cdx-replace-radix-slot-react16-compat to main May 27, 2026 15:29

@t3t3c t3t3c left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have went through everything and it looks good to me.
I have tested locally and the guard works.
What is interesting is that it breaks only on @radix-ui/react-slot@1.2.3. It works fine with @radix-ui/react-slot@1.2.5. So I think Radix managed to fix this jsx-runtime import.

@esezen esezen merged commit 5e5691b into main Jun 9, 2026
11 checks passed
@esezen esezen deleted the cdx-458-components-ui-resolve-incompatibility-with-react-1617-2 branch June 9, 2026 17:16
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.

5 participants