@shopify/hydrogen@2024.7.1
版本发布时间: 2024-07-11 22:03:13
Shopify/hydrogen最新发布版本:@shopify/mini-oxygen@3.0.6(2024-10-02 11:24:35)
Patch Changes
-
customerAccount
no longer commit session automatically. -
Previously the
VariantSelector
component would filter out options that only had one value. This is undesireable for some apps. We've removed that filter, if you'd like to retain the existing functionality, simply filter the options prop before it is passed to theVariantSelector
component:<VariantSelector handle={product.handle} + options={product.options.filter((option) => option.values.length > 1)} - options={product.options} variants={variants}> </VariantSelector>
Fixes #1198
-
Improve the types for
useOptimisticCart()
(#2269) by @blittle -
Fix a small rounding issue when checking stale-while-revalidate timing. (#2220) by @frandiox
-
Update virtual route to use Layout component in the root file. (#2292) by @michenly
-
Add
sellingPlanId
support toBuyNowButton
. (#2254) by @dvisockas -
Fix customData from Analytics.Provider not being passed to page view events (#2224) by @wizardlyhel
-
Auto cookie domain detection for customer privacy api and better error message for missing analytics fields (#2256) by @wizardlyhel
-
Add a
useOptimisticVariant
hook for optimistically rendering product variant changes. This makes switching product variants instantaneous. Example usage:function Product() { const {product, variants} = useLoaderData<typeof loader>(); // The selectedVariant optimistically changes during page // transitions with one of the preloaded product variants const selectedVariant = useOptimisticVariant( product.selectedVariant, variants, ); return <ProductMain selectedVariant={selectedVariant} />; }
This also introduces a small breaking change to the
VariantSelector
component, which now immediately updates which variant is active. If you'd like to retain the current functionality, and have theVariantSelector
wait for the page navigation to complete before updating, use thewaitForNavigation
prop:<VariantSelector handle={product.handle} options={product.options} waitForNavigation > ... </VariantSelector>
-
Return
null
instead of empty object fromcart.get()
when the cart id is invalid. (#2258) by @frandiox -
Updated dependencies [
54c2f7ad
]:- @shopify/hydrogen-react@2024.7.1