diff --git a/.changeset/serious-crabs-chew.md b/.changeset/serious-crabs-chew.md deleted file mode 100644 index c22b5723..00000000 --- a/.changeset/serious-crabs-chew.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Adds the functions `getStorefrontApiUrl()` and `getPublicTokenHeaders()` to the object returned by `useShop()` (and provided by ``). - -For example: - -```ts -const {storefrontId, getPublicTokenHeaders, getStorefrontApiUrl} = useShop(); - -fetch(getStorefrontApiUrl(), { - headers: getPublicTokenHeaders({contentType: 'json'}) - body: {...} -}) -``` diff --git a/.changeset/sharp-squids-accept.md b/.changeset/sharp-squids-accept.md deleted file mode 100644 index 15e752c7..00000000 --- a/.changeset/sharp-squids-accept.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Adds CartLines components and hooks. - -- The `CartLineProvider` component creates a context for using a cart line. -- The `useCartLine` hook provides access to the cart line object. It must be a descendent of a `CartProvider` component. diff --git a/.changeset/swift-olives-beam.md b/.changeset/swift-olives-beam.md deleted file mode 100644 index 24690491..00000000 --- a/.changeset/swift-olives-beam.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Provide a mapping of Storefront API's custom scalars to their actual types, for use with GraphQL CodeGen. - -For example: - -```ts -import {storefrontApiCustomScalars} from '@shopify/hydrogen-react'; - -const config: CodegenConfig = { - // Use the schema that's bundled with @shopify/hydrogen-react - schema: './node_modules/@shopify/hydrogen-react/storefront.schema.json', - generates: { - './gql/': { - preset: 'client', - plugins: [], - config: { - // Use the custom scalar definitions that @shopify/hydrogen-react provides to improve the custom scalar types - scalars: storefrontApiCustomScalars, - }, - }, - }, -}; -``` diff --git a/.changeset/two-birds-complain.md b/.changeset/two-birds-complain.md deleted file mode 100644 index 7b6f6e84..00000000 --- a/.changeset/two-birds-complain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Adds additional builds for Node-specific targets, to help ensure that server-side code was getting compiled for server-side runtimes, instead of browser-side code for server-side runtimes. diff --git a/.changeset/witty-maps-ring.md b/.changeset/witty-maps-ring.md deleted file mode 100644 index ced261f0..00000000 --- a/.changeset/witty-maps-ring.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Add a new utility helper for getting the myshopify domain for the site: - -```ts -const client = createStorefrontClient(...); -client.getShopifyDomain() === `https://testing.myshopify.com`; -``` diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 4dd1db7e..5fc1f78b 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,58 @@ # @shopify/hydrogen-react +## 2022.10.3 + +### Patch Changes + +- ccfbbbd: Adds the functions `getStorefrontApiUrl()` and `getPublicTokenHeaders()` to the object returned by `useShop()` (and provided by ``). + + For example: + + ```ts + const {storefrontId, getPublicTokenHeaders, getStorefrontApiUrl} = useShop(); + + fetch(getStorefrontApiUrl(), { + headers: getPublicTokenHeaders({contentType: 'json'}) + body: {...} + }) + ``` + +- 0683765: Adds CartLines components and hooks. + + - The `CartLineProvider` component creates a context for using a cart line. + - The `useCartLine` hook provides access to the cart line object. It must be a descendent of a `CartProvider` component. + +- 94fdddd: Provide a mapping of Storefront API's custom scalars to their actual types, for use with GraphQL CodeGen. + + For example: + + ```ts + import {storefrontApiCustomScalars} from '@shopify/hydrogen-react'; + + const config: CodegenConfig = { + // Use the schema that's bundled with @shopify/hydrogen-react + schema: './node_modules/@shopify/hydrogen-react/storefront.schema.json', + generates: { + './gql/': { + preset: 'client', + plugins: [], + config: { + // Use the custom scalar definitions that @shopify/hydrogen-react provides to improve the custom scalar types + scalars: storefrontApiCustomScalars, + }, + }, + }, + }; + ``` + +- 676eb75: Adds additional builds for Node-specific targets, to help ensure that server-side code was getting compiled for server-side runtimes, instead of browser-side code for server-side runtimes. +- 2dc6ac4: Add a new utility helper for getting the myshopify domain for the site: + + ```ts + const client = createStorefrontClient(...); + client.getShopifyDomain() === `https://testing.myshopify.com`; + ``` + ## 2022.10.2 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 8d0e89a7..bb587dc4 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/hydrogen-react", - "version": "2022.10.2", + "version": "2022.10.3", "description": "React components, hooks, and utilities for creating custom Shopify storefronts", "homepage": "https://github.com/Shopify/hydrogen-ui/tree/main/packages/react", "license": "MIT",