fix(solid_generator): qualify cross-file registry entries by origin library - #111
Merged
Merged
Conversation
…ibrary Closes #110. The name-keyed registry could not distinguish a local plain class from a foreign @SolidState class sharing its simple name: blocking registration protected the local class but silently lost the genuinely reactive foreign read. Entries under a shadowed or multi-origin name are now recorded qualified by origin library (side-maps; the flat registry is stripped for flagged names so every other consumer is byte-identical for the unflagged common case), and the value rewriter resolves flagged names only when the receiver's tier-1 resolved staticType library matches a recorded origin — asset:<pkg>/source URIs normalized to the registry's package:<pkg> form. AST-only receivers never rewrite an ambiguous name, so the change can only add rewrites proven by real resolution, never introduce a wrong one. Two same-named @SolidState classes consumed in one file each resolve through their own receiver; the one-hop local-shadow fixture's foreign read now lowers while the local plain read stays untouched. Deliberate side-effect (changelogged): dispose auto-injection no longer recognizes a 2+-origin name as @Solid-annotated — pass dispose: explicitly for such classes. Validated pre-release against the downstream app via path overrides (byte-identical output + live shadow probe).
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.
Closes #110. Extends the unreleased
3.0.0-dev.5(no version bump — tag after merge, per plan).Problem
The cross-file registry is keyed by simple class name, so a local plain
Fooand a foreign@SolidState-bearingFoowere mutually exclusive: registering the foreign one wrongly rewrote the local class (caught in #109's review), and blocking registration — the shipped trade-off — silently lost the genuinely reactive foreign read.Fix
name → originUri → fieldsside-maps). The flat registry is stripped for flagged names, so every other consumer sees byte-identical behavior for the unflagged common case.staticTypelibrary matches a recorded origin (asset:<pkg>/source/...normalized to the registry'spackage:<pkg>/...— verified againstpackage:build's AssetId internals, and it's the build conventionbuild.yamlmandates for every consumer, not a repo-local accident).Review guide
cross_file_qualified_registry_disambiguation(new)@SolidStateFoos in different files, consumed in one file — each read lowers against its own class (reviewer-probed at N=3 too)cross_file_super_param_one_hop_local_shadow(updated)thing.label(foreign, reactive) now lowers;f.label(local, plain) stays untouchedcross_file_local_shadowing_decoy(comment-only)value_rewriter_test.dartadditionDeliberate side-effect (changelogged): dispose auto-injection no longer recognizes a 2+-origin name as
@Solid-annotated (previously it fired non-deterministically for whichever origin registered first) — passdispose:explicitly for such same-named classes.Verification
352/352 solid_generator tests (goldens + idempotency ×2), 11/11 integration, repo-root
dart analyze --fatal-infoszero, format clean, 5 example apps zero-delta. Pre-release validation against fairtile via path overrides: byte-identical app output, the #108 bare-super.x probe lowers, and a live local-shadow probe (plain localAuthRepositorybeside the real reactive one) disambiguates correctly in the real app — tree left clean.