-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product Form Abstraction #1027
Product Form Abstraction #1027
Conversation
https://github.com/Shopify/hydrogen/pull/1027/files#diff-8b58d224aa70a8818cc53be7f43fff8838e38a1d87672f2fb14f9263ae3b1b23 |
templates/demo-store/app/routes/($locale).products.$productHandle.tsx
Outdated
Show resolved
Hide resolved
@@ -220,10 +211,103 @@ export function ProductForm() { | |||
return ( | |||
<div className="grid gap-10"> | |||
<div className="grid gap-4"> | |||
<ProductOptions | |||
<VariantSelector | |||
options={product.options} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need options
and variants
separated out? Shouldn't we just have product={product}
and we just derive options and variants from that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having them separate, so that they can come from separate requests. Only options
is required. The variants
could be deferred.
Also left comments on the proposal: https://gist.github.com/blittle/d9205d4ac72528005dc6f3104c328ecd?permalink_comment_id=4607765#gistcomment-4607765 |
This comment has been minimized.
This comment has been minimized.
* Product form implementation Shopify/hydrogen-internal#23
* Product form implementation https://github.com/Shopify/hydrogen-internal/issues/23
WHY are these changes introduced?
Implements: https://github.com/Shopify/hydrogen-internal/issues/23
See https://gist.github.com/blittle/d9205d4ac72528005dc6f3104c328ecd for a public explanation.
WHAT is this pull request doing?
HOW to test your changes?
Post-merge steps
Checklist
Docs WIP: https://shopify-dev.shopify-dev-4mgc.bret-little.us.spin.dev/docs/api/hydrogen/2023-04/unstable/components/variantselector