Repository navigation
typescript: a JSX tag through a wrapper, a loader or a prop lands on what renders - #1577
Merged
Merged
Conversation
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
September 28, 2026 02:49
…sing The bytecode oracle in CI finds three edges case 61-var-local-type does not produce: a var element of an enhanced for loop, a try-with-resources var, and var lambda parameters. Before #1401 each was a wrong external:var edge; now the receiver is an honest unknown. Record them as accepted gaps so a new miss still fails and a fixed one reports NOW-FIXED. Refs #1401.
swapnilpaliwal-sd
force-pushed
the
loop/ty-ts-jsx-tags
branch
2 times, most recently
from
September 28, 2026 03:11
d7140f5 to
7a03c15
Compare
CI's second run on this branch failed 61-var-local-type with 'no oracle golden'. The golden is oracle_diff.py's report, and CI measured every value in it: oracle=20 engine=17 agree=17, the three known-missing var shapes, no extra edge. Refs #1401.
…what renders
Three wrong edges from the JSX component rules:
- Any call's argument 0 was taken as the component, so `makeThing(() => build())`
rendered `build` and `useMemo(() => Comp, [])` rendered the arrow. Only the
component wrappers now count: `memo`, `forwardRef`, `observer` and a `withX`
higher-order component, read off the callee name so `React.memo` matches.
- A `lazy` / `dynamic` / `loadable` loader was matched on a namespace import
anywhere under its return, so `import("./m").then((m) => m.Named)` rendered the
module's default export. The returned value is read at its root; the module
renders its default, and a projection (`.then` callback returning `m.Named`,
`{ default: m.Named }`, `await import(...)`) renders the named component.
- A tag or call through a parameter, plain or destructured
(`({ icon: Button }) => <Button/>`), was looked up by name in the module scope
and landed on the same-named import. A callee bound to a local now stays with
what the local resolves to, or unresolved.
Case 75 pins each, with controls: real wrappers still reach their argument, a
loader returning the module still renders its default, and an unshadowed tag
still reaches the import. Two React apps index to the same edge set as before.
Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Sep 28, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1541. The JSX component rules produced three kinds of wrong edge:
const Thing = makeThing(() => build())made<Thing/>renderbuild;useMemo(() => Comp, [])rendered the arrow. Only component wrappers now count:memo,forwardRef,observer, and awithXHOC (by callee name, soReact.memomatches).lazy(() => import("./m").then((m) => ({ default: m.Named })))landed on the default export. The loader's returned value is now read at its root: the module itself renders its default; a.thencallback,await import(...)or{ default: m.Named }renders the named component.dynamicandloadableare loaders too.({ icon: Button }) => <Button/>(and the same with a plain call) resolved to the module's importedButton. A callee that the binder bound to a parameter or a non-module local now stays with what the local resolves to, or unresolved (typescript: a call through a destructured parameter resolves to a same-named import #1562).Tests
75-jsx-wrapper-guardspins each shape with controls: real wrappers still reach their argument, a loader returning the module still renders its default, an unshadowed<Button/>still reaches the import.graph/test/typescript/run-tests.sh --oracle: passed 75, failed 0 (7m41s). Case 75 vs the compiler: agree 15, missing 6 (all listed as known), NEW 0.Before / after (TypeScript call edges)
Index time on the real app: 7s before, 6s after.