Repository navigation
refactor(squads): move PrivacyOption into graphql/squads - #6987
Merged
Merged
Conversation
graphql/squads.ts imported the PrivacyOption enum from the SquadPrivacySection component, so the GraphQL module depended on UI code. That closed an import cycle: graphql/squads.ts -> SquadPrivacySection -> SquadCategoryDropdown -> fields/Dropdown -> hooks/index.ts (barrel) -> useLeaveSquad -> graphql/squads.ts. It also meant every chunk that imports the squads GraphQL module pulled in the whole hooks barrel. The enum belongs next to SquadForm, which is typed with it, so it moves there and the component, SquadManageDetails and useEditSquad import it from the GraphQL module. graphql/squads.ts no longer reaches the hooks barrel at all. Structural cleanup only, with no known user-facing bug. This cycle is not what caused the webpack SSR crash fixed in #6986. Breaking it locally left that crash unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
graphql/squads.tsimported thePrivacyOptionenum from theSquadPrivacySectioncomponent, so the GraphQL module depended on UI code. That closed an import cycle:It also meant every chunk that imports the squads GraphQL module pulled in the whole hooks barrel.
What
PrivacyOptionmoves next toSquadFormingraphql/squads.ts, sinceSquadFormis typed with it.SquadPrivacySection,SquadManageDetailsanduseEditSquadnow import it from there.graphql/squads.tsno longer reaches the hooks barrel at all, and none of its runtime imports lead back to it.This is structural cleanup with no known user-facing bug. It's a follow-up to #6986: this cycle looked like the cause of that webpack SSR crash, but breaking it left the crash unchanged.
Verification
node ./scripts/typecheck-strict-changed.js, eslint on the changed files, the squad jest suites in shared (19 suites),pnpm --filter webapp test, and the full webapptsc --noEmitall pass.Preview domain
https://claude-squads-privacy-option-cyc.preview.app.daily.dev