Repository navigation
fix(codemod): warn about retained React JSX callers - #2657
domgan-oai merged 3 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit d963636. Configure here.
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 111 measured values. Public-import reachability bundles (bytes)No changes across 141 measured values. |
…demod-retained-react-jsx-issuer

Summary
Warn when an unchanged React JSX component directly renders a relative JSX import that the codemod will rename to an Octane component. Report the edge on the retained caller and selected leaf.
Selecting only the leaf in a standard React JSX project rewrites the caller's import to
.tsrx. Production React SSR then rejects the Octane element returned by the leaf. The existing server-render advisory covers direct calls to the React DOM renderer. A plain React component return can reach the same failure through an ancestor.Validation
pnpm format:checkpnpm typecheckpnpm testpnpm sync, andgit diff --check.Risk / follow-ups
The check follows explicit relative JSX paths and direct exported returns under the standard resolver. Bundler-only aliases can supply a different renderer, so this is an advisory. The recipe-free replay matched all 7,902 rows, including the 1,361 clean Strong results on the base.
Provenance
agent-authored)Codex task · host
com-79386Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Changes are limited to codemod diagnostics and tests; no runtime or auth/data paths are affected.
Overview
Extends the codemod’s react-compat advisory beyond direct
react-dom/serverusage: when only a leaf.tsx/.jsxis selected for migration, it now flags unchanged React callers that still use standard automatic JSX and return JSX for a relative component that will be rewritten to.tsrx.The new
retainedReactComponentReturnsanalyzer reuses direct-export return detection to find those edges;project.tsmerges them with the existing server-render checks and emits warnings on both the retained caller and the migrating leaf (with JSX-specific wording). A patch changeset and parameterized project tests cover when the warning should and should not appear (e.g. native Octane JSX, aliases, lowercase tags, type-only imports, shadowed bindings, explicitOctaneCompat).Reviewed by Cursor Bugbot for commit 6147f17. Bugbot is set up for automated code reviews on this repo. Configure here.