@shopify/storefront-kit-react@2023.1.1
Changes
-
9bff83c: Updated to Storefront API version
2023-01Storefront API Changes
The Storefront API changelog can be viewed here. There are not any breaking changes in the Storefront API itself.
Storefront Kit changes
Breaking Changes
-
The default Cart query no longer uses
compareAtPriceV2andpriceV2; usecompareAtPriceandpriceinstead. TheV2fields will be removed in an upcoming version of the Storefront API. -
The storefront client and ShopifyProvider now provide the
storeDomainexactly as it is received; it's recommended that you pass the domain with the protocol and the fully-qualified domain name for your Storefront. For example:https://hydrogen-test.myshopify.com -
parseMetafield's implementation has been updated and vastly improved so that it is correctly parsing all the metafield types.-
The parsed metafield will now be found on the
parsedValueproperty. For example:const metafield = parseMetafield(rawMetafield); console.log(metafield.parsedValue);
-
Additionally, a new TypeScript type called
ParsedMetafieldis provided to help theparseMetafieldfunction return the correct TypeScript types, by passing the type of metafield into theParsedMetafieldtype. For example:const metafield = parseMetafield<ParsedMetafield['boolean']>(rawMetafield); // parsedValue is a boolean if (metafield.parsedValue === true) { }
-
-
The
<Metafield/>component has been removed; useparseMetafield().parsedValueto have control over what you want to render
Other Changes
- The TypeScript types for the returned value of
flattenConnection()should now be friendlier: if you are using aPartialDeepobject, you'll still get aPartialDeepobject in return; if you're NOT using aPartialDeepobject, then the returned type will not be wrapped inPartialDeep.
-