ref(utils): move issue-tag query helpers out of the utils barrel#116807
Open
JoshuaKGoldberg wants to merge 1 commit into
Open
ref(utils): move issue-tag query helpers out of the utils barrel#116807JoshuaKGoldberg wants to merge 1 commit into
JoshuaKGoldberg wants to merge 1 commit into
Conversation
`escapeIssueTagKey` and `generateQueryWithTag` were the only members of the `sentry/utils` god-barrel that imported `types/event`, `utils/fields`, and `utils/queryString` — the edges keeping the barrel inside the frontend type-import strongly-connected component (SCC). Relocate both into `utils/queryString` (alongside the related `appendTagCondition`) and repoint the handful of consumers. The barrel then imports nothing in the cycle and leaves the SCC. Re-exporting from the barrel would re-create the edge (the helpers' new home is itself in the cycle), so consumers import from `sentry/utils/queryString` directly. Largest SCC drops 1867 -> 1850 standalone; the barrel is one of the most widely-imported modules, so this compounds with the other de-cycling PRs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
📊 Type Coverage Diff
🔍 1 new type safety issue introducedType assertions (
This is informational only and does not block the PR. |
scttcper
approved these changes
Jun 3, 2026
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
Sentry's frontend type-import graph forms a large strongly-connected component (SCC).
run-on-changedcountsimport typeedges, so this cycle makes its "impacted files" analysis flag a huge fraction of the app for almost any change. We're shrinking the SCC by moving misplaced symbols out of god-barrels.The
sentry/utilsbarrel (static/app/utils.tsx) is one of the most widely-imported modules in the app, and it sat inside the SCC for exactly two reasons: the helpersescapeIssueTagKeyandgenerateQueryWithTag, which importtypes/event,utils/fields, andutils/queryString.What
utils/queryString— their natural home, alongside the relatedappendTagConditionthey already use.sentry/utils/queryString.queryString.spec.tsx.A re-export from the barrel would re-create the cycle edge (the helpers' new home is itself in the SCC), so consumers import from
sentry/utils/queryStringdirectly. With the helpers gone, the barrel imports nothing in the cycle and leaves the SCC.Impact
Largest type-import SCC drops 1867 → 1850 (−17) standalone. Because the barrel is so widely imported, the effect compounds with the sibling de-cycling PRs (it removes ~49 once the tooltip cluster is also out).
Part of a series of SCC-shrinking PRs.