Skip to content

ref(replays): cut two type-only edges into the import cycle#117031

Draft
JoshuaKGoldberg wants to merge 1 commit into
masterfrom
ref/decycle-cheap-type-cuts
Draft

ref(replays): cut two type-only edges into the import cycle#117031
JoshuaKGoldberg wants to merge 1 commit into
masterfrom
ref/decycle-cheap-type-cuts

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

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/typestypes/event (~−24). The file imported Event solely to type one type-guard parameter (isHydrateCrumb). The guard only reads .category, so it now takes unknown and narrows structurally — dropping the types/event edge entirely.
  • replayAnalyticsEventsgetOutputType (~−6). The Output enum lived in getOutputType (a runtime util with its own deps), so the analytics event-map pulled that whole module in for one type. Move Output into a dependency-free leaf (details/output) and re-export it from getOutputType so 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:

So this PR is the remaining independent, source-side type cuts.

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.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant