feat(template): switch PDP variants optimistically - #532
Draft
laugharn wants to merge 1 commit into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Why
The PDP should feel instant without downloading or reconstructing the complete variant matrix in the browser. This keeps the existing selected-variant query and bounded product payload, while adding only a small client context for visual selection state and transition safety.
Unlike #518, this does not add
adjacentVariants, expandfirstSelectableVariant, or use Hydrogen's product form store.Verification
pnpm exec tsc --noEmit(apps/template) — passedoxlinton all 8 touched template files — passed with 0 warnings and 0 errorsoxfmt --checkon all 8 touched template files — passedpnpm build(apps/template) — passed; 33/33 static pages generatedpnpm exec oxfmt --check content/docs/anatomy/pages/pdp.mdx(apps/docs) — passedgit diff --check— passedThe session-requested
lib/markdown/negotiation.test.tsandlib/markdown/routing.test.tsdo not exist onmain, and this checkout has no Vitest dependency, so those historical focused tests could not be run.Notes
The repository-wide template formatting check still reports two unrelated pre-existing files:
components/product-detail/bundle-components.tsxandlib/shopify/transforms/product.ts.