Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .changeset/add-to-cart-parent-line.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/api-version-2025-10.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/article-reference-metafield.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/bun-lock-support.md

This file was deleted.

29 changes: 0 additions & 29 deletions .changeset/delivery-address-empty-array-docs.md

This file was deleted.

30 changes: 0 additions & 30 deletions .changeset/delivery-address-replace-mutation.md

This file was deleted.

70 changes: 0 additions & 70 deletions .changeset/gift-card-add-mutation.md

This file was deleted.

32 changes: 0 additions & 32 deletions .changeset/nested-cart-lines.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/visitor-consent-incontext.md

This file was deleted.

102 changes: 102 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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';

<CartForm action={CartForm.ACTIONS.GiftCardCodesAdd} inputs={{giftCardCodes: ['CODE1', 'CODE2']}}>
<button>Add Gift Cards</button>
</CartForm>
```

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
<AddToCartButton
lines={[
{merchandiseId: 'gid://shopify/ProductVariant/laptop-456', quantity: 1},
{
merchandiseId: 'gid://shopify/ProductVariant/warranty-123',
quantity: 1,
parent: {merchandiseId: 'gid://shopify/ProductVariant/laptop-456'},
},
]}
>
Add to Cart with Warranty
</AddToCartButton>
```

## 11.1.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1683,5 +1683,5 @@
]
}
},
"version": "11.1.7"
"version": "11.1.8"
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading