Skip to content

Remove unused cart query metadata from server handlers - #4267

Draft
kdaviduik wants to merge 1 commit into
mainfrom
kd-remove-unused-cart-query-symbol
Draft

kdaviduik wants to merge 1 commit into
mainfrom
kd-remove-unused-cart-query-symbol

Conversation

@kdaviduik

Copy link
Copy Markdown
Contributor

Removes unused, module-private cart query metadata from cart server handlers, completing the cleanup started in #3932, which stopped exporting the symbol after finding no consumers.

Before

type CartServerHandlers<TCartQuery, TCart> = {
  readonly [cartServerHandlersCartQuery]: TCartQuery | undefined;
  get: CartGetHandler<TCart>;
  post: CartPostHandler;
};

After

type CartServerHandlers<TCartQuery, TCart> = {
  get: CartGetHandler<TCart>;
  post: CartPostHandler;
};

TCartQuery remains in both handler types because it still determines the default TCart through CartDataFromQuery<TCartQuery>.

What this changes

  • Removes the symbol declaration, both type members, and the property write.
  • Leaves the separately used cartBuyerIdentitySync brand unchanged.

Developer impact

No changeset is included: this has no runtime behavior change, and consumers could not name the non-exported symbol.

Out of scope

Generated docs data is not updated here; the stale entries will be removed on the next docs regeneration.

Risk

Type-only: keyof CartServerHandlers no longer includes the private symbol, and a hand-built object can now satisfy CartServerHandlers (the unnamed symbol member previously made that impossible). No Hydrogen API takes CartServerHandlers as an input type, and CartServerHandlersWithCustomerSession retains the separately used cartBuyerIdentitySync brand checked at runtime.

The module-private symbol is never read and cannot be named by
consumers. Remove its declaration, both handler type members, and
property write to finish the cleanup started in #3932.
Keep TCartQuery because CartDataFromQuery<TCartQuery> still
determines the default cart type.

Co-authored-by: AI (Pi/Claude Opus 5.5) <noreply@pi.dev>
@shopify

shopify Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Oxygen deployed a preview of your kd-remove-unused-cart-query-symbol branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment October 24, 2026 3:17 AM

Learn more about Hydrogen's GitHub integration.

This branch has not been deployed

No deployments
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