@shopify/hydrogen@2023.7.0
What’s new
⭐️ Check out our blog post with all the latest updates on Hydrogen, and what’s coming on the roadmap.
The latest version of Hydrogen comes with new and updated components and utilities that can help you speed up your build:
- An updated server-side Cart component with built-in abstractions to handle most common cart operations, including adding, updating, or deleting line items, applying discounts, and more.
- A drop-in
<Pagination/>
component to make it easier to handle large product collections. - A new
<VariantSelector/>
component that makes it faster to build progressively enhanced product forms. - Improved support for predictive search and local pickup options through Storefront API version 2023-07.
Breaking Changes
-
createWithCache
is now stable. All imports need to be updated: (#1151) by @blittle- import {createWithCache_unstable} from '@shopify/hydrogen'; + import {createWithCache} from '@shopify/hydrogen';
-
Pagination
andgetPaginationVariables
are now stable. (#1129) by @blittleAll imports to each should be updated:
- import {Pagiatinon__unstable, getPaginationVariables__unstable} from '@shopify/hydrogen'; + import {Pagiatinon, getPaginationVariables} from '@shopify/hydrogen';
Patch Changes
-
Function and component for cart management: (#786) by @wizardlyhel
createCartHandler
- Creates an object instance that simplifies cart operations such as add/update/remove from cart.CartForm
- A form component that helps you sets up form inputs for cart handler.
Documentation:
- Updated how-to guides
createCartHandler
CartForm
-
Export useLoadScript (#1080) by @wizardlyhel
-
Throw error when
storeDomain
is not passed tocreateStorefrontClient
. (#1128) by @frandiox -
Improve warning and error format for known Hydrogen messages in development. (#1093) by @frandiox
-
Add an example using the new Customer Account API (#1126) by @blittle
-
Corrected the
$attributes
type inCART_ATTRIBUTES_UPDATE_MUTATION
to match the expected one (#1117) by @remcolakens -
Fix cache key by url encode the sub request keys (#1105) by @wizardlyhel
Add a <VariantSelector>
component to make building product forms easier. Also added the getSelectedProductOptions
helper function. See the guide on using the VariantSelector. (#1027) by @blittle