feat(parser): resolve tsconfig-path aliases and Loadable/lazy wrappers (6F.3)#45
Merged
officialCodeWork merged 1 commit intoJul 15, 2026
Conversation
…s to definitions (6F.3) The field run linked only 28% of JSX instances to definitions. Two scanner changes close the diagnosed causes: 1. scanReact honors the scanned app's own tsconfig.json (tsConfigFilePath; file discovery unchanged), so baseUrl/paths make alias imports like "@ui" resolvable through multi-hop rename barrels. Before, such usages produced no instance node at all. 2. New lazyDefinition resolution: a JSX tag naming a module-scope const X = Loadable(lazy(() => import("./Page"))) (or bare React.lazy) unwraps to the dynamic import and resolves the target module's default export. Exercised by a new PreviewPane fixture component whose variable name differs from the definition name, so only the unwrap can link it. Fixture golden: both 6F.3 expectedFail marks removed — DataGrid instances = 2 and blast radius DataGrid → {UsersPage, InvoicesPage} now pass unmarked; 100% of the fixture's component usages resolve. 2 new parser unit tests (121 total). Eval 283 pass / 0 fail / 7 xfail (all owned by 6F.4–6F.5) / 0 unexpected-pass, gate OK, metrics 1.000. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
The field validation linked only 563 of 1,982 instances (28%) to their definitions — the root cause capping
blast_radiusand the render graph. This PR closes the two diagnosed causes:scanReacthonors the scanned app's owntsconfig.json(tsConfigFilePath; file discovery unchanged) —baseUrl/pathsmake alias imports like@uiresolvable through multi-hop rename barrels. Before, such usages produced no instance node at all.Loadable(lazy(() => import()))unwrap — a JSX tag naming a module-scope lazy-wrapped variable resolves through the dynamic import to the target module's default export. The newPreviewPanefixture component names the variable differently from the definition, so only the unwrap can link it.Result on the field-patterns fixture
expectedFailmarks removed:DataGridinstances = 2 and blast radiusDataGrid → {UsersPage, InvoicesPage}now pass unmarked (field regression was 0 dependents)Verification
pnpm test: 201 tests green (2 new parser tests)pnpm eval: 283 pass · 0 fail · 7 xfail (all owned by 6F.4–6F.5) · 0 unexpected-pass, gate OK, metrics 1.000pnpm typecheck: clean🤖 Generated with Claude Code