Skip to content
Merged
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
6 changes: 0 additions & 6 deletions .changeset/heavy-schools-speak.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/sweet-hotels-hunt.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@remix-run/react": "^2.16.1",
"@remix-run/server-runtime": "^2.16.1",
"@remix-run/eslint-config": "^2.16.1",
"@shopify/hydrogen": "2025.4.0",
"@shopify/hydrogen": "2025.4.1",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"express": "^4.19.2",
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @shopify/cli-hydrogen

## 10.1.0

### Minor Changes

- Add a new tokenless Storefront API route to the starter template. ([#2948](https://github.com/Shopify/hydrogen/pull/2948)) by [@blittle](https://github.com/blittle)

## 10.0.2

### 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 @@ -1749,5 +1749,5 @@
]
}
},
"version": "10.0.2"
"version": "10.1.0"
}
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": "10.0.2",
"version": "10.1.0",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
15 changes: 15 additions & 0 deletions packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @shopify/hydrogen

## 2025.4.1

### Patch Changes

- Add a `buyerIdentity` parameter to `createHydrogenContext` and `createCartHandler`. This buyer identity will be used as the default buyer identity for all new cart creations: ([#2927](https://github.com/Shopify/hydrogen/pull/2927)) by [@blittle](https://github.com/blittle)

```ts
const hydrogenContext = createHydrogenContext({
// ...
buyerIdentity: {
companyLocationId: '...',
},
});
```

## 2025.4.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"@shopify:registry": "https://registry.npmjs.org"
},
"type": "module",
"version": "2025.4.0",
"version": "2025.4.1",
"license": "MIT",
"main": "dist/index.cjs",
"module": "dist/production/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const LIB_VERSION = '2025.4.0';
export const LIB_VERSION = '2025.4.1';
89 changes: 49 additions & 40 deletions templates/skeleton/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# skeleton

## 2025.4.1

### Patch Changes

- Add a new tokenless Storefront API route to the starter template. ([#2948](https://github.com/Shopify/hydrogen/pull/2948)) by [@blittle](https://github.com/blittle)

- Updated dependencies [[`d44fab3d`](https://github.com/Shopify/hydrogen/commit/d44fab3d07c5e255edcd22745d4d7e2db2c3e60f)]:
- @shopify/hydrogen@2025.4.1

## 2025.4.0

### Patch Changes
Expand Down Expand Up @@ -164,13 +173,13 @@
1. Add a routes.ts file. This is your new Remix route configuration file.

```ts
import {flatRoutes} from '@remix-run/fs-routes';
import {layout, type RouteConfig} from '@remix-run/route-config';
import {hydrogenRoutes} from '@shopify/hydrogen';
import { flatRoutes } from "@remix-run/fs-routes";
import { layout, type RouteConfig } from "@remix-run/route-config";
import { hydrogenRoutes } from "@shopify/hydrogen";

export default hydrogenRoutes([
// Your entire app reading from routes folder using Layout from layout.tsx
layout('./layout.tsx', await flatRoutes()),
layout("./layout.tsx", await flatRoutes()),
]) satisfies RouteConfig;
```

Expand Down Expand Up @@ -761,25 +770,25 @@
8. Update the `ProductForm` component.

```tsx
import {Link, useNavigate} from '@remix-run/react';
import {type MappedProductOptions} from '@shopify/hydrogen';
import { Link, useNavigate } from "@remix-run/react";
import { type MappedProductOptions } from "@shopify/hydrogen";
import type {
Maybe,
ProductOptionValueSwatch,
} from '@shopify/hydrogen/storefront-api-types';
import {AddToCartButton} from './AddToCartButton';
import {useAside} from './Aside';
import type {ProductFragment} from 'storefrontapi.generated';
} from "@shopify/hydrogen/storefront-api-types";
import { AddToCartButton } from "./AddToCartButton";
import { useAside } from "./Aside";
import type { ProductFragment } from "storefrontapi.generated";

export function ProductForm({
productOptions,
selectedVariant,
}: {
productOptions: MappedProductOptions[];
selectedVariant: ProductFragment['selectedOrFirstAvailableVariant'];
selectedVariant: ProductFragment["selectedOrFirstAvailableVariant"];
}) {
const navigate = useNavigate();
const {open} = useAside();
const { open } = useAside();
return (
<div className="product-form">
{productOptions.map((option) => (
Expand Down Expand Up @@ -813,8 +822,8 @@
to={`/products/${handle}?${variantUriQuery}`}
style={{
border: selected
? '1px solid black'
: '1px solid transparent',
? "1px solid black"
: "1px solid transparent",
opacity: available ? 1 : 0.3,
}}
>
Expand All @@ -831,13 +840,13 @@
<button
type="button"
className={`product-options-item${
exists && !selected ? ' link' : ''
exists && !selected ? " link" : ""
}`}
key={option.name + name}
style={{
border: selected
? '1px solid black'
: '1px solid transparent',
? "1px solid black"
: "1px solid transparent",
opacity: available ? 1 : 0.3,
}}
disabled={!exists}
Expand All @@ -861,7 +870,7 @@
<AddToCartButton
disabled={!selectedVariant || !selectedVariant.availableForSale}
onClick={() => {
open('cart');
open("cart");
}}
lines={
selectedVariant
Expand All @@ -875,7 +884,7 @@
: []
}
>
{selectedVariant?.availableForSale ? 'Add to cart' : 'Sold out'}
{selectedVariant?.availableForSale ? "Add to cart" : "Sold out"}
</AddToCartButton>
</div>
);
Expand All @@ -898,7 +907,7 @@
aria-label={name}
className="product-option-label-swatch"
style={{
backgroundColor: color || 'transparent',
backgroundColor: color || "transparent",
}}
>
{!!image && <img src={image} alt={name} />}
Expand Down Expand Up @@ -1399,21 +1408,21 @@
New `withCache.fetch` is for caching simple fetch requests. This method caches the responses if they are OK responses, and you can pass `shouldCacheResponse`, `cacheKey`, etc. to modify behavior. `data` is the consumed body of the response (we need to consume to cache it).

```ts
const withCache = createWithCache({cache, waitUntil, request});
const withCache = createWithCache({ cache, waitUntil, request });

const {data, response} = await withCache.fetch<{data: T; error: string}>(
'my-cms.com/api',
const { data, response } = await withCache.fetch<{ data: T; error: string }>(
"my-cms.com/api",
{
method: 'POST',
headers: {'Content-type': 'application/json'},
method: "POST",
headers: { "Content-type": "application/json" },
body,
},
{
cacheStrategy: CacheLong(),
// Cache if there are no data errors or a specific data that make this result not suited for caching
shouldCacheResponse: (result) => !result?.error,
cacheKey: ['my-cms', body],
displayName: 'My CMS query',
cacheKey: ["my-cms", body],
displayName: "My CMS query",
},
);
```
Expand Down Expand Up @@ -1989,9 +1998,9 @@

```tsx
// app/lib/root-data.ts
import {useMatches} from '@remix-run/react';
import type {SerializeFrom} from '@shopify/remix-oxygen';
import type {loader} from '~/root';
import { useMatches } from "@remix-run/react";
import type { SerializeFrom } from "@shopify/remix-oxygen";
import type { loader } from "~/root";

/**
* Access the result of the root loader from a React component.
Expand Down Expand Up @@ -2153,18 +2162,18 @@
- This is an important fix to a bug with 404 routes and path-based i18n projects where some unknown routes would not properly render a 404. This fixes all new projects, but to fix existing projects, add a `($locale).tsx` route with the following contents: ([#1732](https://github.com/Shopify/hydrogen/pull/1732)) by [@blittle](https://github.com/blittle)

```ts
import {type LoaderFunctionArgs} from '@remix-run/server-runtime';
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";

export async function loader({params, context}: LoaderFunctionArgs) {
const {language, country} = context.storefront.i18n;
export async function loader({ params, context }: LoaderFunctionArgs) {
const { language, country } = context.storefront.i18n;

if (
params.locale &&
params.locale.toLowerCase() !== `${language}-${country}`.toLowerCase()
) {
// If the locale URL param is defined, yet we still are still at the default locale
// then the the locale param must be invalid, send to the 404 page
throw new Response(null, {status: 404});
throw new Response(null, { status: 404 });
}

return null;
Expand Down Expand Up @@ -2220,11 +2229,11 @@
```yaml
projects:
default:
schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'
schema: "node_modules/@shopify/hydrogen/storefront.schema.json"
documents:
- '!*.d.ts'
- '*.{ts,tsx,js,jsx}'
- 'app/**/*.{ts,tsx,js,jsx}'
- "!*.d.ts"
- "*.{ts,tsx,js,jsx}"
- "app/**/*.{ts,tsx,js,jsx}"
```

- Improve resiliency of `HydrogenSession` ([#1583](https://github.com/Shopify/hydrogen/pull/1583)) by [@blittle](https://github.com/blittle)
Expand Down Expand Up @@ -2439,8 +2448,8 @@
```ts
// root.tsx

import {useMatches} from '@remix-run/react';
import {type SerializeFrom} from '@shopify/remix-oxygen';
import { useMatches } from "@remix-run/react";
import { type SerializeFrom } from "@shopify/remix-oxygen";

export const useRootLoaderData = () => {
const [root] = useMatches();
Expand Down
4 changes: 2 additions & 2 deletions templates/skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "skeleton",
"private": true,
"sideEffects": false,
"version": "2025.4.0",
"version": "2025.4.1",
"type": "module",
"scripts": {
"build": "shopify hydrogen build --codegen",
Expand All @@ -17,7 +17,7 @@
"@remix-run/react": "^2.16.1",
"@remix-run/server-runtime": "^2.16.1",
"graphql": "^16.10.0",
"@shopify/hydrogen": "2025.4.0",
"@shopify/hydrogen": "2025.4.1",
"@shopify/remix-oxygen": "^2.0.12",
"graphql-tag": "^2.12.6",
"isbot": "^5.1.22",
Expand Down