ref(replays): cut two type-only edges into the import cycle#117031
Draft
JoshuaKGoldberg wants to merge 1 commit into
Draft
ref(replays): cut two type-only edges into the import cycle#117031JoshuaKGoldberg wants to merge 1 commit into
JoshuaKGoldberg wants to merge 1 commit into
Conversation
Two small, source-side type-only cuts (no behavior change): - `utils/replays/types` imported `Event` solely to type one type-guard param (`isHydrateCrumb`). The guard only reads `.category`, so it now takes `unknown` and narrows structurally — dropping the `types/event` edge. (~-24 to the largest SCC on its own.) - The `Output` enum lived in `getOutputType` (a runtime util), so the analytics event map `replayAnalyticsEvents` pulled that whole module in for one type. Move `Output` to a dependency-free leaf and re-export it from `getOutputType` for existing consumers. (~-6 on its own.) Largest type-import SCC drops 1681 -> 1651 (-30) across 5 files. Note: the sibling 'cheap cut' candidates (uptime/types, deprecatedforms, issueTypeConfig importing core/group types) are relocation-style and are already handled by the leaf-extraction PR; configStore genuinely stores `Config` and isn't cheaply cuttable. Part of a series of SCC-shrinking PRs.
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.
Why
A batch of source-side, type-only bridge cuts — like #117029, each severs a single high-leverage type edge by editing the importer, not by relocating a widely-used symbol. Type-only change, no runtime behavior difference.
What
utils/replays/types→types/event(~−24). The file importedEventsolely to type one type-guard parameter (isHydrateCrumb). The guard only reads.category, so it now takesunknownand narrows structurally — dropping thetypes/eventedge entirely.replayAnalyticsEvents→getOutputType(~−6). TheOutputenum lived ingetOutputType(a runtime util with its own deps), so the analytics event-map pulled that whole module in for one type. MoveOutputinto a dependency-free leaf (details/output) and re-export it fromgetOutputTypeso existing consumers are untouched.Impact
Largest type-import SCC drops 1681 → 1651 (−30) across 5 files.
Scope note (the other "cheap cut" candidates)
From the ranked type-only-edge list, the rest aren't independent of work already in flight:
types/core→charts/utils(−30) is ref(types): define IntervalPeriod without importing charts/utils #116853.types/system→exportGlobals(−26) is ref(types): drop bootstrap/exportGlobals coupling from types/system #117029.uptime/types→core,deprecatedforms/formField→group,issueTypeConfig→group(−19/−10/−8) are relocation-style — those importers get repointed to the new leaves by the leaf-extraction PR, so doing them here would duplicate/conflict.configStore→system(−13) genuinely stores theConfigtype; not cheaply cuttable.So this PR is the remaining independent, source-side type cuts.