Name SCC-merged shared modules after their largest member — short + stable (#35)#44
Merged
Conversation
Closes #35 (probe I-9). A cyclic shared-type group was named by concatenating every member home-domain -> 'ComponentsMenubarRootStoreToastTypes' (40+ chars), which also RESHUFFLED whenever an SCC edge changed, breaking consumers' qualified references (Module.foo) across regenerations. planSharedModules now names a merged SCC after its LARGEST member (most types; alphabetical tie-break) + 'SharedTypes' -> 'PositionerSharedTypes' (21 chars), 'RootSharedTypes' (15). Short, readable, and stable: adding/removing a small domain to the cycle doesn't change which member is largest, so the name holds. Verified: base-ui merged modules are PositionerSharedTypes / RootSharedTypes (both <=25 chars, the 40-char monster gone); names identical across two runs; 265 files compile; goldens unaffected (none has a cross-domain SCC); bench 8/8. TYPE_MAPPING + CHANGELOG. The optional --shared-module-name sink flag is left as a follow-up (not needed for the acceptance criteria).
Benchmark: ✅ PASS
|
commit: |
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.
What
Closes #35 (probe I-9). A cyclic shared-type group was named by concatenating every member home-domain —
ComponentsMenubarRootStoreToastTypes(40+ chars) — which was unreadable AND unstable: any SCC edge change reshuffled the name, breaking consumers' qualified references (Module.foo) across regenerations. Critical for the blend-rescript sync, where generated module paths are referenced from juspay-portal.Change
planSharedModulesnames a merged SCC after its largest member (most types; alphabetical tie-break) +SharedTypes:ComponentsMenubarRootStoreToastTypesRootSharedTypesPositionerTabUtilsTypesPositionerSharedTypesCjsClassesDateFnsLocaleTypesTypes(day-picker)LocaleSharedTypesChartsV2HighchartsOptionsTypes(blend)HighchartsSharedTypesWhy it's stable
The name tracks the largest member, so adding or removing a small domain from the cycle doesn't change which member is largest → the module name holds → consumers'
PositionerSharedTypes.fooreferences survive a regeneration. (A perturbation that changes the largest member does rename it — that's allowed by the acceptance criteria.)Verified
PositionerSharedTypes(21 chars),RootSharedTypes(15) — both ≤25, the 40-char monster goneThe optional
--shared-module-namesingle-sink flag is left as a follow-up (not needed for the acceptance criteria).