Skip to content

Remove treeshake:false, delete dead GraphQL ops, fix broken section-move route#11612

Merged
nbudin merged 2 commits into
mainfrom
moar-spinnar
Jun 4, 2026
Merged

Remove treeshake:false, delete dead GraphQL ops, fix broken section-move route#11612
nbudin merged 2 commits into
mainfrom
moar-spinnar

Conversation

@nbudin
Copy link
Copy Markdown
Contributor

@nbudin nbudin commented Jun 4, 2026

Purpose

A few things bundled together because they were all found during the same investigation.

treeshake: false removed. This workaround was added for a Rolldown bug with GraphQL document constants being silently eliminated. Turns out the bug no longer exists. Verified by writing scripts/check-graphql-documents.mts, which collects all operation names from the source .generated.ts files and confirms they survive the build — same 502 operations pass whether treeshaking is on or off.

8 dead GraphQL operations deleted. Found them as a byproduct of the check: AdminStoreAbilityQuery, MailingListsMenuQuery, WhosFreeFormConventionQuery, and five Standalone* mutations in StandaloneEditEvent. None of their document constants were imported anywhere. Source .graphql files and generated .ts files cleaned up via codegen.

Broken section drag-and-drop fixed. While checking MoveFormSection (also absent from the build), noticed that the route action file existed and was correctly implemented, but the route itself was never registered in AppRouter.tsx. The UI was submitting to /admin_forms/:id/edit/section/:sectionId/move and silently failing. One missing route entry, now fixed.

GraphiQL imports consolidated. CmsGraphqlQueryForm previously had a static import of @graphiql/toolkit alongside its lazy import of graphiql. Both now live in GraphiQLWithFetcher.tsx, lazily loaded as a unit.

Changes

💻 Engineer-facing

  • yarn check-graphql-documents — run after yarn build:web to verify all expected operations are in the output. Fails with a list of anything missing.
  • CI job in static.yml runs the build + check on every PR
  • KNOWN_ABSENT in the script is currently empty — if you add an operation that's intentionally unreachable, add it there

🚢

🤖 Generated with Claude Code

@nbudin nbudin marked this pull request as ready for review June 4, 2026 19:24
…ove route

The treeshake:false workaround was added for a Rolldown bug that no longer
exists — verified by checking that all 502 reachable GraphQL operations
survive the build with treeshaking enabled.

Also found and cleaned up while verifying: 8 unused GraphQL operations
(AdminStoreAbilityQuery, MailingListsMenuQuery, WhosFreeFormConventionQuery,
5 Standalone* mutations in StandaloneEditEvent) deleted from source and
regenerated. And a genuinely broken feature: MoveFormSection was defined and
its action was wired up, but the route was never registered in AppRouter —
so section drag-and-drop silently did nothing. Route added.

Adds scripts/check-graphql-documents.mts (yarn check-graphql-documents) and
a CI job that builds and runs it on every PR to catch future regressions.

Also consolidates graphiql/toolkit imports into GraphiQLWithFetcher.tsx so
they load as a single lazy chunk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
app/graphql/concerns/cms_parent_implementation.rb 🔴 40.54% 🔴 43.24% 🟢 2.7%
app/graphql/sources/cms_page_content.rb 🔴 0% 🟢 100% 🟢 100%
app/graphql/types/page_type.rb 🟢 88.89% 🟢 100% 🟢 11.11%
app/helpers/application_helper.rb 🟢 85.19% 🟢 86.21% 🟢 1.02%
app/javascript/BuiltInFormControls/AddFileModal.tsx 🔴 0% 🔴 33.33% 🟢 33.33%
app/javascript/BuiltInFormControls/LiquidInput.tsx 🟠 57.5% 🟠 60% 🟢 2.5%
app/policies/application_policy.rb 🟢 90.91% 🟢 93.94% 🟢 3.03%
app/services/cms_content_finder.rb 🟢 80.77% 🟢 84.62% 🟢 3.85%
test/system/page_weight_test.rb 🔴 0% 🟢 96.3% 🟢 96.3%
Overall Coverage 🟢 52.78% 🟢 52.84% 🟢 0.06%

Minimum allowed coverage is 0%, this run produced 52.84%

@nbudin nbudin merged commit ad09e9d into main Jun 4, 2026
32 of 34 checks passed
@nbudin nbudin deleted the moar-spinnar branch June 4, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant