Skip to content

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

Merged
JoshuaKGoldberg merged 4 commits into
masterfrom
ref/decycle-cheap-type-cuts
Jun 8, 2026
Merged

ref(replays): cut two type-only edges into the import cycle#117031
JoshuaKGoldberg merged 4 commits 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
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review June 8, 2026 14:10
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners June 8, 2026 14:10
UNPARSEABLE_BODY_TYPE = 'unparseable_body_type',
DATA = 'data',
}
export {Output};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-export.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AAAAGH

@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team as a code owner June 8, 2026 18:15
display: flex;
justify-content: space-between;
gap: $${p => p.theme.space['2xl']};
gap: ${p => p.theme.space['2xl']};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda off topic tho

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. I'm surprised no linting thing caught this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 1b37b3e into master Jun 8, 2026
76 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the ref/decycle-cheap-type-cuts branch June 8, 2026 19:34
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.

2 participants