From 159ff099ab233a66438f0586b4b44e45a18ec0bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 02:15:15 +0000 Subject: [PATCH] [ci] release 2025.10.0 --- .changeset/add-to-cart-parent-line.md | 40 ----- .changeset/api-version-2025-10.md | 8 - .changeset/article-reference-metafield.md | 7 - .changeset/bun-lock-support.md | 5 - .../delivery-address-empty-array-docs.md | 29 ---- .../delivery-address-replace-mutation.md | 30 ---- .changeset/gift-card-add-mutation.md | 70 --------- .changeset/nested-cart-lines.md | 32 ---- .changeset/visitor-consent-incontext.md | 15 -- packages/cli/CHANGELOG.md | 102 ++++++++++++ packages/cli/oclif.manifest.json | 2 +- packages/cli/package.json | 2 +- packages/create-hydrogen/CHANGELOG.md | 71 +++++++++ packages/create-hydrogen/package.json | 2 +- packages/hydrogen-react/CHANGELOG.md | 62 ++++++++ packages/hydrogen-react/package.json | 2 +- packages/hydrogen/CHANGELOG.md | 146 ++++++++++++++++++ packages/hydrogen/package.json | 4 +- packages/hydrogen/src/version.ts | 2 +- templates/skeleton/CHANGELOG.md | 38 +++++ templates/skeleton/package.json | 4 +- 21 files changed, 428 insertions(+), 245 deletions(-) delete mode 100644 .changeset/add-to-cart-parent-line.md delete mode 100644 .changeset/api-version-2025-10.md delete mode 100644 .changeset/article-reference-metafield.md delete mode 100644 .changeset/bun-lock-support.md delete mode 100644 .changeset/delivery-address-empty-array-docs.md delete mode 100644 .changeset/delivery-address-replace-mutation.md delete mode 100644 .changeset/gift-card-add-mutation.md delete mode 100644 .changeset/nested-cart-lines.md delete mode 100644 .changeset/visitor-consent-incontext.md diff --git a/.changeset/add-to-cart-parent-line.md b/.changeset/add-to-cart-parent-line.md deleted file mode 100644 index 8d45e6ab29..0000000000 --- a/.changeset/add-to-cart-parent-line.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Add `parent` prop to `AddToCartButton` for nested cart lines - -The `AddToCartButton` component now accepts an optional `parent` prop, allowing you to add items as children of an existing cart line. This enables adding warranties, gift wrapping, or other add-ons that should be associated with a parent product. - -### Usage - -```tsx -import {AddToCartButton} from '@shopify/hydrogen-react'; - -// Add a warranty as a child of an existing cart line (by line ID) - - Add Extended Warranty - - -// Add a warranty as a child of a cart line (by merchandise ID) -// Useful when you know the product variant but not the cart line ID - - Add Extended Warranty - -``` - -### Type - -```ts -interface AddToCartButtonPropsBase { - // ... existing props - /** The parent line item of the item being added to the cart. Used for nested cart lines. */ - parent?: CartLineParentInput; -} -``` diff --git a/.changeset/api-version-2025-10.md b/.changeset/api-version-2025-10.md deleted file mode 100644 index e993d85b1f..0000000000 --- a/.changeset/api-version-2025-10.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@shopify/hydrogen': major -'@shopify/hydrogen-react': major -'@shopify/cli-hydrogen': patch -'skeleton': major ---- - -Update Storefront API and Customer Account API to version 2025-10 diff --git a/.changeset/article-reference-metafield.md b/.changeset/article-reference-metafield.md deleted file mode 100644 index 62aa5df434..0000000000 --- a/.changeset/article-reference-metafield.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Add support for `article_reference` and `list.article_reference` metafield types - -These new metafield types were introduced in Storefront API 2025-10, allowing merchants to reference blog articles in metafields. diff --git a/.changeset/bun-lock-support.md b/.changeset/bun-lock-support.md deleted file mode 100644 index af66609c04..0000000000 --- a/.changeset/bun-lock-support.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Add support for Bun's text-based lockfile (`bun.lock`) introduced in Bun 1.2, and npm's shrinkwrap lockfile (`npm-shrinkwrap.json`), as alternatives to their respective primary lockfiles (`bun.lockb` and `package-lock.json`). diff --git a/.changeset/delivery-address-empty-array-docs.md b/.changeset/delivery-address-empty-array-docs.md deleted file mode 100644 index b2629167b8..0000000000 --- a/.changeset/delivery-address-empty-array-docs.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -`cart.updateDeliveryAddresses` mutation now clears all delivery addresses when passed an empty array - -## Breaking Behavior Change in Storefront API 2025-10 - -The `cartDeliveryAddressesUpdate` mutation now clears all delivery addresses when passed an empty array. This behavior was undefined in previous API versions. - -## What Changed - -**Before (API ≤ 2025-07):** -Passing an empty array did not update any addresses, essentially a no-op. - -**After (API ≥ 2025-10):** -Passing an empty array explicitly clears all delivery addresses from the cart. - -## Usage - -```typescript -context.cart.updateDeliveryAddresses([]) -``` - -## Migration - -If you are relying on `cart.updateDeliveryAddresses([])` in your codebase, verify if the new behavior is compatible with your expectations. - -Otherwise, no migration is required. diff --git a/.changeset/delivery-address-replace-mutation.md b/.changeset/delivery-address-replace-mutation.md deleted file mode 100644 index 2736ca6c06..0000000000 --- a/.changeset/delivery-address-replace-mutation.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -'@shopify/hydrogen': minor ---- - -Add `cartDeliveryAddressesReplaceDefault` to handle the new `cartDeliveryAddressesReplace` Storefront API mutation (2025-10) - -This new mutation replaces all delivery addresses on a cart in a single operation. - -**Usage via cart handler:** -```typescript -const result = await cart.replaceDeliveryAddresses([ - { - address: { - deliveryAddress: { - address1: '123 Main St', - city: 'Anytown', - countryCode: 'US' - } - }, - selected: true - } -]); -``` - -**Usage via CartForm:** -```tsx - - {/* form inputs */} - -``` diff --git a/.changeset/gift-card-add-mutation.md b/.changeset/gift-card-add-mutation.md deleted file mode 100644 index 9dc0f8fff1..0000000000 --- a/.changeset/gift-card-add-mutation.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -'@shopify/hydrogen': minor -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch ---- - -Add `cartGiftCardCodesAdd` mutation - -## New Feature: cartGiftCardCodesAdd - -Adds gift card codes without replacing existing ones. - -**Before (2025-07):** -```typescript -const codes = ['EXISTING1', 'EXISTING2']; -await cart.updateGiftCardCodes(['EXISTING1', 'EXISTING2', 'NEW_CODE']); -``` - -**After (2025-10):** -```typescript -await cart.addGiftCardCodes(['NEW_CODE']); -``` - -## Verified API Behavior - -| Scenario | Behavior | -|----------|----------| -| Valid gift card code | Applied successfully | -| UPPERCASE code | Works (API is case-insensitive) | -| Duplicate code in same call | Idempotent - applied once, no error | -| Re-applying already applied code | Idempotent - no error, no duplicate | -| Multiple different codes | All applied successfully | -| Invalid code | Silently rejected (no error surfaced) | -| Code with whitespace | Rejected (API does not trim whitespace) | -| Empty input | Graceful no-op | - -**Note:** The API handles duplicate gift card codes gracefully - submitting an already-applied code results in silent success (idempotent behavior), not an error. No `DUPLICATE_GIFT_CARD` error code exists. - -**Note on whitespace:** The API does NOT trim whitespace from codes. Ensure codes are trimmed before submission if accepting user input. - -## API Reference - -**New method:** -- `cart.addGiftCardCodes(codes)` - Appends codes to cart -- `CartForm.ACTIONS.GiftCardCodesAdd` - Form action - -## Skeleton Template Changes - -The skeleton template has been updated to use the new `cartGiftCardCodesAdd` mutation: -- Removed `UpdateGiftCardForm` component from `CartSummary.tsx` -- Added `AddGiftCardForm` component using `CartForm.ACTIONS.GiftCardCodesAdd` - -If you customized the gift card form in your project, you may want to migrate to the new `Add` action for simpler code. - -## Usage - -```typescript -import {CartForm} from '@shopify/hydrogen'; - - - - -``` - -Or with createCartHandler: - -```typescript -const cart = createCartHandler({storefront, getCartId, setCartId}); -await cart.addGiftCardCodes(['SUMMER2025', 'WELCOME10']); -``` diff --git a/.changeset/nested-cart-lines.md b/.changeset/nested-cart-lines.md deleted file mode 100644 index 7ba52eba43..0000000000 --- a/.changeset/nested-cart-lines.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch -'skeleton': patch ---- - -Add support for nested cart line items (warranties, gift wrapping, etc.) - -Storefront API 2025-10 introduces `parentRelationship` on cart line items, enabling parent-child relationships for add-ons. This update displays nested line items in the cart. - -### Changes - -- Updates GraphQL fragments to include `parentRelationship` and `lineComponents` fields -- Updates `CartMain` and `CartLineItem` to render child line items with visual hierarchy - -### Note - -This update focuses on **displaying** nested line items. To add both a product and its child (e.g., warranty) in a single action: - -```tsx - - Add to Cart with Warranty - -``` diff --git a/.changeset/visitor-consent-incontext.md b/.changeset/visitor-consent-incontext.md deleted file mode 100644 index f60981073d..0000000000 --- a/.changeset/visitor-consent-incontext.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@shopify/hydrogen': minor -'@shopify/hydrogen-react': minor ---- - -Add `visitorConsent` support to `@inContext` directive for Storefront API parity - -**Note: Most Hydrogen storefronts do NOT need this feature.** - -This API addition provides Storefront API 2025-10 parity for the `visitorConsent` parameter in `@inContext` directives. However, if you're using Hydrogen's analytics provider or Shopify's Customer Privacy API (including third-party consent services integrated with it), consent is already handled automatically and you don't need to use this. - -This feature is primarily intended for Checkout Kit and other non-Hydrogen integrations that manage consent outside of Shopify's standard consent flow. - -**What it does:** -When explicitly provided, `visitorConsent` encodes buyer consent preferences (analytics, marketing, preferences, saleOfData) into the cart's `checkoutUrl` via the `_cs` parameter. diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index d4a420a55f..51f973c0ba 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,107 @@ # @shopify/cli-hydrogen +## 11.1.8 + +### Patch Changes + +- Update Storefront API and Customer Account API to version 2025-10 ([#3352](https://github.com/Shopify/hydrogen/pull/3352)) by [@fredericoo](https://github.com/fredericoo) + +- Add support for Bun's text-based lockfile (`bun.lock`) introduced in Bun 1.2, and npm's shrinkwrap lockfile (`npm-shrinkwrap.json`), as alternatives to their respective primary lockfiles (`bun.lockb` and `package-lock.json`). ([#3405](https://github.com/Shopify/hydrogen/pull/3405)) by [@thomasKn](https://github.com/thomasKn) + +- Add `cartGiftCardCodesAdd` mutation ([#3401](https://github.com/Shopify/hydrogen/pull/3401)) by [@kdaviduik](https://github.com/kdaviduik) + + ## New Feature: cartGiftCardCodesAdd + + Adds gift card codes without replacing existing ones. + + **Before (2025-07):** + + ```typescript + const codes = ['EXISTING1', 'EXISTING2']; + await cart.updateGiftCardCodes(['EXISTING1', 'EXISTING2', 'NEW_CODE']); + ``` + + **After (2025-10):** + + ```typescript + await cart.addGiftCardCodes(['NEW_CODE']); + ``` + + ## Verified API Behavior + + | Scenario | Behavior | + | -------------------------------- | --------------------------------------- | + | Valid gift card code | Applied successfully | + | UPPERCASE code | Works (API is case-insensitive) | + | Duplicate code in same call | Idempotent - applied once, no error | + | Re-applying already applied code | Idempotent - no error, no duplicate | + | Multiple different codes | All applied successfully | + | Invalid code | Silently rejected (no error surfaced) | + | Code with whitespace | Rejected (API does not trim whitespace) | + | Empty input | Graceful no-op | + + **Note:** The API handles duplicate gift card codes gracefully - submitting an already-applied code results in silent success (idempotent behavior), not an error. No `DUPLICATE_GIFT_CARD` error code exists. + + **Note on whitespace:** The API does NOT trim whitespace from codes. Ensure codes are trimmed before submission if accepting user input. + + ## API Reference + + **New method:** + - `cart.addGiftCardCodes(codes)` - Appends codes to cart + - `CartForm.ACTIONS.GiftCardCodesAdd` - Form action + + ## Skeleton Template Changes + + The skeleton template has been updated to use the new `cartGiftCardCodesAdd` mutation: + - Removed `UpdateGiftCardForm` component from `CartSummary.tsx` + - Added `AddGiftCardForm` component using `CartForm.ACTIONS.GiftCardCodesAdd` + + If you customized the gift card form in your project, you may want to migrate to the new `Add` action for simpler code. + + ## Usage + + ```typescript + import {CartForm} from '@shopify/hydrogen'; + + + + + ``` + + Or with createCartHandler: + + ```typescript + const cart = createCartHandler({storefront, getCartId, setCartId}); + await cart.addGiftCardCodes(['SUMMER2025', 'WELCOME10']); + ``` + +- Add support for nested cart line items (warranties, gift wrapping, etc.) ([#3398](https://github.com/Shopify/hydrogen/pull/3398)) by [@fredericoo](https://github.com/fredericoo) + + Storefront API 2025-10 introduces `parentRelationship` on cart line items, enabling parent-child relationships for add-ons. This update displays nested line items in the cart. + + ### Changes + - Updates GraphQL fragments to include `parentRelationship` and `lineComponents` fields + - Updates `CartMain` and `CartLineItem` to render child line items with visual hierarchy + + ### Note + + This update focuses on **displaying** nested line items. To add both a product and its child (e.g., warranty) in a single action: + + ```tsx + + Add to Cart with Warranty + + ``` + ## 11.1.7 ### Patch Changes diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index fb5a23ebf6..3ef7f73ead 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1683,5 +1683,5 @@ ] } }, - "version": "11.1.7" + "version": "11.1.8" } \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index 3af3e0b1e9..53d69dde2f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "11.1.7", + "version": "11.1.8", "license": "MIT", "type": "module", "repository": { diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md index 3360ad5c3b..7940dfe066 100644 --- a/packages/create-hydrogen/CHANGELOG.md +++ b/packages/create-hydrogen/CHANGELOG.md @@ -1,5 +1,76 @@ # @shopify/create-hydrogen +## 5.0.28 + +### Patch Changes + +- Add `cartGiftCardCodesAdd` mutation ([#3401](https://github.com/Shopify/hydrogen/pull/3401)) by [@kdaviduik](https://github.com/kdaviduik) + + ## New Feature: cartGiftCardCodesAdd + + Adds gift card codes without replacing existing ones. + + **Before (2025-07):** + + ```typescript + const codes = ['EXISTING1', 'EXISTING2']; + await cart.updateGiftCardCodes(['EXISTING1', 'EXISTING2', 'NEW_CODE']); + ``` + + **After (2025-10):** + + ```typescript + await cart.addGiftCardCodes(['NEW_CODE']); + ``` + + ## Verified API Behavior + + | Scenario | Behavior | + | -------------------------------- | --------------------------------------- | + | Valid gift card code | Applied successfully | + | UPPERCASE code | Works (API is case-insensitive) | + | Duplicate code in same call | Idempotent - applied once, no error | + | Re-applying already applied code | Idempotent - no error, no duplicate | + | Multiple different codes | All applied successfully | + | Invalid code | Silently rejected (no error surfaced) | + | Code with whitespace | Rejected (API does not trim whitespace) | + | Empty input | Graceful no-op | + + **Note:** The API handles duplicate gift card codes gracefully - submitting an already-applied code results in silent success (idempotent behavior), not an error. No `DUPLICATE_GIFT_CARD` error code exists. + + **Note on whitespace:** The API does NOT trim whitespace from codes. Ensure codes are trimmed before submission if accepting user input. + + ## API Reference + + **New method:** + - `cart.addGiftCardCodes(codes)` - Appends codes to cart + - `CartForm.ACTIONS.GiftCardCodesAdd` - Form action + + ## Skeleton Template Changes + + The skeleton template has been updated to use the new `cartGiftCardCodesAdd` mutation: + - Removed `UpdateGiftCardForm` component from `CartSummary.tsx` + - Added `AddGiftCardForm` component using `CartForm.ACTIONS.GiftCardCodesAdd` + + If you customized the gift card form in your project, you may want to migrate to the new `Add` action for simpler code. + + ## Usage + + ```typescript + import {CartForm} from '@shopify/hydrogen'; + + + + + ``` + + Or with createCartHandler: + + ```typescript + const cart = createCartHandler({storefront, getCartId, setCartId}); + await cart.addGiftCardCodes(['SUMMER2025', 'WELCOME10']); + ``` + ## 5.0.27 ### Patch Changes diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json index f37820f460..ccffa6516a 100644 --- a/packages/create-hydrogen/package.json +++ b/packages/create-hydrogen/package.json @@ -5,7 +5,7 @@ "@shopify:registry": "https://registry.npmjs.org" }, "license": "MIT", - "version": "5.0.27", + "version": "5.0.28", "type": "module", "repository": { "type": "git", diff --git a/packages/hydrogen-react/CHANGELOG.md b/packages/hydrogen-react/CHANGELOG.md index b87a053095..c8aec33eac 100644 --- a/packages/hydrogen-react/CHANGELOG.md +++ b/packages/hydrogen-react/CHANGELOG.md @@ -1,5 +1,67 @@ # @shopify/hydrogen-react +## 2025.10.0 + +### Major Changes + +- Update Storefront API and Customer Account API to version 2025-10 ([#3352](https://github.com/Shopify/hydrogen/pull/3352)) by [@fredericoo](https://github.com/fredericoo) + +### Minor Changes + +- Add `visitorConsent` support to `@inContext` directive for Storefront API parity ([#3408](https://github.com/Shopify/hydrogen/pull/3408)) by [@kdaviduik](https://github.com/kdaviduik) + + **Note: Most Hydrogen storefronts do NOT need this feature.** + + This API addition provides Storefront API 2025-10 parity for the `visitorConsent` parameter in `@inContext` directives. However, if you're using Hydrogen's analytics provider or Shopify's Customer Privacy API (including third-party consent services integrated with it), consent is already handled automatically and you don't need to use this. + + This feature is primarily intended for Checkout Kit and other non-Hydrogen integrations that manage consent outside of Shopify's standard consent flow. + + **What it does:** + When explicitly provided, `visitorConsent` encodes buyer consent preferences (analytics, marketing, preferences, saleOfData) into the cart's `checkoutUrl` via the `_cs` parameter. + +### Patch Changes + +- Add `parent` prop to `AddToCartButton` for nested cart lines ([#3398](https://github.com/Shopify/hydrogen/pull/3398)) by [@fredericoo](https://github.com/fredericoo) + + The `AddToCartButton` component now accepts an optional `parent` prop, allowing you to add items as children of an existing cart line. This enables adding warranties, gift wrapping, or other add-ons that should be associated with a parent product. + + ### Usage + + ```tsx + import {AddToCartButton} from '@shopify/hydrogen-react'; + + // Add a warranty as a child of an existing cart line (by line ID) + + Add Extended Warranty + + + // Add a warranty as a child of a cart line (by merchandise ID) + // Useful when you know the product variant but not the cart line ID + + Add Extended Warranty + + ``` + + ### Type + + ```ts + interface AddToCartButtonPropsBase { + // ... existing props + /** The parent line item of the item being added to the cart. Used for nested cart lines. */ + parent?: CartLineParentInput; + } + ``` + +- Add support for `article_reference` and `list.article_reference` metafield types ([#3407](https://github.com/Shopify/hydrogen/pull/3407)) by [@kdaviduik](https://github.com/kdaviduik) + + These new metafield types were introduced in Storefront API 2025-10, allowing merchants to reference blog articles in metafields. + ## 2025.7.2 ### Minor Changes diff --git a/packages/hydrogen-react/package.json b/packages/hydrogen-react/package.json index 8738f469f7..82426a07ca 100644 --- a/packages/hydrogen-react/package.json +++ b/packages/hydrogen-react/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/hydrogen-react", - "version": "2025.7.2", + "version": "2025.10.0", "description": "React components, hooks, and utilities for creating custom Shopify storefronts", "homepage": "https://github.com/Shopify/hydrogen/tree/main/packages/hydrogen-react", "license": "MIT", diff --git a/packages/hydrogen/CHANGELOG.md b/packages/hydrogen/CHANGELOG.md index fad181a077..9ad415f75f 100644 --- a/packages/hydrogen/CHANGELOG.md +++ b/packages/hydrogen/CHANGELOG.md @@ -1,5 +1,151 @@ # @shopify/hydrogen +## 2025.10.0 + +### Major Changes + +- Update Storefront API and Customer Account API to version 2025-10 ([#3352](https://github.com/Shopify/hydrogen/pull/3352)) by [@fredericoo](https://github.com/fredericoo) + +### Minor Changes + +- Add `cartDeliveryAddressesReplaceDefault` to handle the new `cartDeliveryAddressesReplace` Storefront API mutation (2025-10) ([#3406](https://github.com/Shopify/hydrogen/pull/3406)) by [@kdaviduik](https://github.com/kdaviduik) + + This new mutation replaces all delivery addresses on a cart in a single operation. + + **Usage via cart handler:** + + ```typescript + const result = await cart.replaceDeliveryAddresses([ + { + address: { + deliveryAddress: { + address1: '123 Main St', + city: 'Anytown', + countryCode: 'US', + }, + }, + selected: true, + }, + ]); + ``` + + **Usage via CartForm:** + + ```tsx + + {/* form inputs */} + + ``` + +- Add `cartGiftCardCodesAdd` mutation ([#3401](https://github.com/Shopify/hydrogen/pull/3401)) by [@kdaviduik](https://github.com/kdaviduik) + + ## New Feature: cartGiftCardCodesAdd + + Adds gift card codes without replacing existing ones. + + **Before (2025-07):** + + ```typescript + const codes = ['EXISTING1', 'EXISTING2']; + await cart.updateGiftCardCodes(['EXISTING1', 'EXISTING2', 'NEW_CODE']); + ``` + + **After (2025-10):** + + ```typescript + await cart.addGiftCardCodes(['NEW_CODE']); + ``` + + ## Verified API Behavior + + | Scenario | Behavior | + | -------------------------------- | --------------------------------------- | + | Valid gift card code | Applied successfully | + | UPPERCASE code | Works (API is case-insensitive) | + | Duplicate code in same call | Idempotent - applied once, no error | + | Re-applying already applied code | Idempotent - no error, no duplicate | + | Multiple different codes | All applied successfully | + | Invalid code | Silently rejected (no error surfaced) | + | Code with whitespace | Rejected (API does not trim whitespace) | + | Empty input | Graceful no-op | + + **Note:** The API handles duplicate gift card codes gracefully - submitting an already-applied code results in silent success (idempotent behavior), not an error. No `DUPLICATE_GIFT_CARD` error code exists. + + **Note on whitespace:** The API does NOT trim whitespace from codes. Ensure codes are trimmed before submission if accepting user input. + + ## API Reference + + **New method:** + - `cart.addGiftCardCodes(codes)` - Appends codes to cart + - `CartForm.ACTIONS.GiftCardCodesAdd` - Form action + + ## Skeleton Template Changes + + The skeleton template has been updated to use the new `cartGiftCardCodesAdd` mutation: + - Removed `UpdateGiftCardForm` component from `CartSummary.tsx` + - Added `AddGiftCardForm` component using `CartForm.ACTIONS.GiftCardCodesAdd` + + If you customized the gift card form in your project, you may want to migrate to the new `Add` action for simpler code. + + ## Usage + + ```typescript + import {CartForm} from '@shopify/hydrogen'; + + + + + ``` + + Or with createCartHandler: + + ```typescript + const cart = createCartHandler({storefront, getCartId, setCartId}); + await cart.addGiftCardCodes(['SUMMER2025', 'WELCOME10']); + ``` + +- Add `visitorConsent` support to `@inContext` directive for Storefront API parity ([#3408](https://github.com/Shopify/hydrogen/pull/3408)) by [@kdaviduik](https://github.com/kdaviduik) + + **Note: Most Hydrogen storefronts do NOT need this feature.** + + This API addition provides Storefront API 2025-10 parity for the `visitorConsent` parameter in `@inContext` directives. However, if you're using Hydrogen's analytics provider or Shopify's Customer Privacy API (including third-party consent services integrated with it), consent is already handled automatically and you don't need to use this. + + This feature is primarily intended for Checkout Kit and other non-Hydrogen integrations that manage consent outside of Shopify's standard consent flow. + + **What it does:** + When explicitly provided, `visitorConsent` encodes buyer consent preferences (analytics, marketing, preferences, saleOfData) into the cart's `checkoutUrl` via the `_cs` parameter. + +### Patch Changes + +- `cart.updateDeliveryAddresses` mutation now clears all delivery addresses when passed an empty array ([#3393](https://github.com/Shopify/hydrogen/pull/3393)) by [@fredericoo](https://github.com/fredericoo) + + ## Breaking Behavior Change in Storefront API 2025-10 + + The `cartDeliveryAddressesUpdate` mutation now clears all delivery addresses when passed an empty array. This behavior was undefined in previous API versions. + + ## What Changed + + **Before (API ≤ 2025-07):** + Passing an empty array did not update any addresses, essentially a no-op. + + **After (API ≥ 2025-10):** + Passing an empty array explicitly clears all delivery addresses from the cart. + + ## Usage + + ```typescript + context.cart.updateDeliveryAddresses([]); + ``` + + ## Migration + + If you are relying on `cart.updateDeliveryAddresses([])` in your codebase, verify if the new behavior is compatible with your expectations. + + Otherwise, no migration is required. + +- Updated dependencies [[`0e61522871fd7500b9cbfa5d15db685deab4c802`](https://github.com/Shopify/hydrogen/commit/0e61522871fd7500b9cbfa5d15db685deab4c802), [`cd653456fbd1e7e1ab1f6fecff04c89a74b6cad9`](https://github.com/Shopify/hydrogen/commit/cd653456fbd1e7e1ab1f6fecff04c89a74b6cad9), [`b79b6fc39cdd28e3c73240c4f5e53339feb49561`](https://github.com/Shopify/hydrogen/commit/b79b6fc39cdd28e3c73240c4f5e53339feb49561), [`38f8a79625838a9cd4520b20c0db2e5d331f7d26`](https://github.com/Shopify/hydrogen/commit/38f8a79625838a9cd4520b20c0db2e5d331f7d26)]: + - @shopify/hydrogen-react@2026.0.0 + ## 2025.7.3 ### Minor Changes diff --git a/packages/hydrogen/package.json b/packages/hydrogen/package.json index ae95199f64..3e2cf69a7f 100644 --- a/packages/hydrogen/package.json +++ b/packages/hydrogen/package.json @@ -5,7 +5,7 @@ "@shopify:registry": "https://registry.npmjs.org" }, "type": "module", - "version": "2025.7.3", + "version": "2025.10.0", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", @@ -83,7 +83,7 @@ "dist" ], "dependencies": { - "@shopify/hydrogen-react": "2025.7.2", + "@shopify/hydrogen-react": "2025.10.0", "content-security-policy-builder": "^2.2.0", "flame-chart-js": "2.3.1", "isbot": "^5.1.21", diff --git a/packages/hydrogen/src/version.ts b/packages/hydrogen/src/version.ts index 274864c8a5..50eca86123 100644 --- a/packages/hydrogen/src/version.ts +++ b/packages/hydrogen/src/version.ts @@ -1 +1 @@ -export const LIB_VERSION = '2025.7.3'; +export const LIB_VERSION = '2025.10.0'; diff --git a/templates/skeleton/CHANGELOG.md b/templates/skeleton/CHANGELOG.md index 89cf521382..2f00ed1506 100644 --- a/templates/skeleton/CHANGELOG.md +++ b/templates/skeleton/CHANGELOG.md @@ -1,5 +1,43 @@ # skeleton +## 2025.10.0 + +### Major Changes + +- Update Storefront API and Customer Account API to version 2025-10 ([#3352](https://github.com/Shopify/hydrogen/pull/3352)) by [@fredericoo](https://github.com/fredericoo) + +### Patch Changes + +- Add support for nested cart line items (warranties, gift wrapping, etc.) ([#3398](https://github.com/Shopify/hydrogen/pull/3398)) by [@fredericoo](https://github.com/fredericoo) + + Storefront API 2025-10 introduces `parentRelationship` on cart line items, enabling parent-child relationships for add-ons. This update displays nested line items in the cart. + + ### Changes + - Updates GraphQL fragments to include `parentRelationship` and `lineComponents` fields + - Updates `CartMain` and `CartLineItem` to render child line items with visual hierarchy + + ### Note + + This update focuses on **displaying** nested line items. To add both a product and its child (e.g., warranty) in a single action: + + ```tsx + + Add to Cart with Warranty + + ``` + +- Updated dependencies [[`cd653456fbd1e7e1ab1f6fecff04c89a74b6cad9`](https://github.com/Shopify/hydrogen/commit/cd653456fbd1e7e1ab1f6fecff04c89a74b6cad9), [`24d26ad94e90ab0a859c274838f7f31e75a7808c`](https://github.com/Shopify/hydrogen/commit/24d26ad94e90ab0a859c274838f7f31e75a7808c), [`13a6f8987ea20d33a30a9c0329d7c11528b892ea`](https://github.com/Shopify/hydrogen/commit/13a6f8987ea20d33a30a9c0329d7c11528b892ea), [`403c1f5b6e266c3dfad30f7cfed229e3304570b0`](https://github.com/Shopify/hydrogen/commit/403c1f5b6e266c3dfad30f7cfed229e3304570b0), [`38f8a79625838a9cd4520b20c0db2e5d331f7d26`](https://github.com/Shopify/hydrogen/commit/38f8a79625838a9cd4520b20c0db2e5d331f7d26)]: + - @shopify/hydrogen@2026.0.0 + ## 2025.7.3 ### Patch Changes diff --git a/templates/skeleton/package.json b/templates/skeleton/package.json index 5ffa269355..66020a8297 100644 --- a/templates/skeleton/package.json +++ b/templates/skeleton/package.json @@ -2,7 +2,7 @@ "name": "skeleton", "private": true, "sideEffects": false, - "version": "2025.7.3", + "version": "2025.10.0", "type": "module", "scripts": { "build": "shopify hydrogen build --codegen", @@ -14,7 +14,7 @@ }, "prettier": "@shopify/prettier-config", "dependencies": { - "@shopify/hydrogen": "2025.7.3", + "@shopify/hydrogen": "2025.10.0", "graphql": "^16.10.0", "graphql-tag": "^2.12.6", "isbot": "^5.1.22",