Skip to content

Commit dc5a3f9

Browse files
[ci] back-fix release 2025-04 (#2950)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 02047ae commit dc5a3f9

File tree

11 files changed

+77
-67
lines changed

11 files changed

+77
-67
lines changed

.changeset/heavy-schools-speak.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/sweet-hotels-hunt.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@remix-run/react": "^2.16.1",
1616
"@remix-run/server-runtime": "^2.16.1",
1717
"@remix-run/eslint-config": "^2.16.1",
18-
"@shopify/hydrogen": "2025.4.0",
18+
"@shopify/hydrogen": "2025.4.1",
1919
"compression": "^1.7.4",
2020
"cross-env": "^7.0.3",
2121
"express": "^4.19.2",

packages/cli/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @shopify/cli-hydrogen
22

3+
## 10.1.0
4+
5+
### Minor Changes
6+
7+
- 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)
8+
39
## 10.0.2
410

511
### Patch Changes

packages/cli/oclif.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1749,5 +1749,5 @@
17491749
]
17501750
}
17511751
},
1752-
"version": "10.0.2"
1752+
"version": "10.1.0"
17531753
}

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"access": "public",
55
"@shopify:registry": "https://registry.npmjs.org"
66
},
7-
"version": "10.0.2",
7+
"version": "10.1.0",
88
"license": "MIT",
99
"type": "module",
1010
"repository": {

packages/hydrogen/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# @shopify/hydrogen
22

3+
## 2025.4.1
4+
5+
### Patch Changes
6+
7+
- 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)
8+
9+
```ts
10+
const hydrogenContext = createHydrogenContext({
11+
// ...
12+
buyerIdentity: {
13+
companyLocationId: '...',
14+
},
15+
});
16+
```
17+
318
## 2025.4.0
419

520
### Patch Changes

packages/hydrogen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"@shopify:registry": "https://registry.npmjs.org"
66
},
77
"type": "module",
8-
"version": "2025.4.0",
8+
"version": "2025.4.1",
99
"license": "MIT",
1010
"main": "dist/index.cjs",
1111
"module": "dist/production/index.js",

packages/hydrogen/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const LIB_VERSION = '2025.4.0';
1+
export const LIB_VERSION = '2025.4.1';

templates/skeleton/CHANGELOG.md

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# skeleton
22

3+
## 2025.4.1
4+
5+
### Patch Changes
6+
7+
- 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)
8+
9+
- Updated dependencies [[`d44fab3d`](https://github.com/Shopify/hydrogen/commit/d44fab3d07c5e255edcd22745d4d7e2db2c3e60f)]:
10+
- @shopify/hydrogen@2025.4.1
11+
312
## 2025.4.0
413

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

166175
```ts
167-
import {flatRoutes} from '@remix-run/fs-routes';
168-
import {layout, type RouteConfig} from '@remix-run/route-config';
169-
import {hydrogenRoutes} from '@shopify/hydrogen';
176+
import { flatRoutes } from "@remix-run/fs-routes";
177+
import { layout, type RouteConfig } from "@remix-run/route-config";
178+
import { hydrogenRoutes } from "@shopify/hydrogen";
170179
171180
export default hydrogenRoutes([
172181
// Your entire app reading from routes folder using Layout from layout.tsx
173-
layout('./layout.tsx', await flatRoutes()),
182+
layout("./layout.tsx", await flatRoutes()),
174183
]) satisfies RouteConfig;
175184
```
176185

@@ -761,25 +770,25 @@
761770
8. Update the `ProductForm` component.
762771
763772
```tsx
764-
import {Link, useNavigate} from '@remix-run/react';
765-
import {type MappedProductOptions} from '@shopify/hydrogen';
773+
import { Link, useNavigate } from "@remix-run/react";
774+
import { type MappedProductOptions } from "@shopify/hydrogen";
766775
import type {
767776
Maybe,
768777
ProductOptionValueSwatch,
769-
} from '@shopify/hydrogen/storefront-api-types';
770-
import {AddToCartButton} from './AddToCartButton';
771-
import {useAside} from './Aside';
772-
import type {ProductFragment} from 'storefrontapi.generated';
778+
} from "@shopify/hydrogen/storefront-api-types";
779+
import { AddToCartButton } from "./AddToCartButton";
780+
import { useAside } from "./Aside";
781+
import type { ProductFragment } from "storefrontapi.generated";
773782

774783
export function ProductForm({
775784
productOptions,
776785
selectedVariant,
777786
}: {
778787
productOptions: MappedProductOptions[];
779-
selectedVariant: ProductFragment['selectedOrFirstAvailableVariant'];
788+
selectedVariant: ProductFragment["selectedOrFirstAvailableVariant"];
780789
}) {
781790
const navigate = useNavigate();
782-
const {open} = useAside();
791+
const { open } = useAside();
783792
return (
784793
<div className="product-form">
785794
{productOptions.map((option) => (
@@ -813,8 +822,8 @@
813822
to={`/products/${handle}?${variantUriQuery}`}
814823
style={{
815824
border: selected
816-
? '1px solid black'
817-
: '1px solid transparent',
825+
? "1px solid black"
826+
: "1px solid transparent",
818827
opacity: available ? 1 : 0.3,
819828
}}
820829
>
@@ -831,13 +840,13 @@
831840
<button
832841
type="button"
833842
className={`product-options-item${
834-
exists && !selected ? ' link' : ''
843+
exists && !selected ? " link" : ""
835844
}`}
836845
key={option.name + name}
837846
style={{
838847
border: selected
839-
? '1px solid black'
840-
: '1px solid transparent',
848+
? "1px solid black"
849+
: "1px solid transparent",
841850
opacity: available ? 1 : 0.3,
842851
}}
843852
disabled={!exists}
@@ -861,7 +870,7 @@
861870
<AddToCartButton
862871
disabled={!selectedVariant || !selectedVariant.availableForSale}
863872
onClick={() => {
864-
open('cart');
873+
open("cart");
865874
}}
866875
lines={
867876
selectedVariant
@@ -875,7 +884,7 @@
875884
: []
876885
}
877886
>
878-
{selectedVariant?.availableForSale ? 'Add to cart' : 'Sold out'}
887+
{selectedVariant?.availableForSale ? "Add to cart" : "Sold out"}
879888
</AddToCartButton>
880889
</div>
881890
);
@@ -898,7 +907,7 @@
898907
aria-label={name}
899908
className="product-option-label-swatch"
900909
style={{
901-
backgroundColor: color || 'transparent',
910+
backgroundColor: color || "transparent",
902911
}}
903912
>
904913
{!!image && <img src={image} alt={name} />}
@@ -1399,21 +1408,21 @@
13991408
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).
14001409
14011410
```ts
1402-
const withCache = createWithCache({cache, waitUntil, request});
1411+
const withCache = createWithCache({ cache, waitUntil, request });
14031412

1404-
const {data, response} = await withCache.fetch<{data: T; error: string}>(
1405-
'my-cms.com/api',
1413+
const { data, response } = await withCache.fetch<{ data: T; error: string }>(
1414+
"my-cms.com/api",
14061415
{
1407-
method: 'POST',
1408-
headers: {'Content-type': 'application/json'},
1416+
method: "POST",
1417+
headers: { "Content-type": "application/json" },
14091418
body,
14101419
},
14111420
{
14121421
cacheStrategy: CacheLong(),
14131422
// Cache if there are no data errors or a specific data that make this result not suited for caching
14141423
shouldCacheResponse: (result) => !result?.error,
1415-
cacheKey: ['my-cms', body],
1416-
displayName: 'My CMS query',
1424+
cacheKey: ["my-cms", body],
1425+
displayName: "My CMS query",
14171426
},
14181427
);
14191428
```
@@ -1989,9 +1998,9 @@
19891998

19901999
```tsx
19912000
// app/lib/root-data.ts
1992-
import {useMatches} from '@remix-run/react';
1993-
import type {SerializeFrom} from '@shopify/remix-oxygen';
1994-
import type {loader} from '~/root';
2001+
import { useMatches } from "@remix-run/react";
2002+
import type { SerializeFrom } from "@shopify/remix-oxygen";
2003+
import type { loader } from "~/root";
19952004
19962005
/**
19972006
* Access the result of the root loader from a React component.
@@ -2153,18 +2162,18 @@
21532162
- 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)
21542163

21552164
```ts
2156-
import {type LoaderFunctionArgs} from '@remix-run/server-runtime';
2165+
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
21572166
2158-
export async function loader({params, context}: LoaderFunctionArgs) {
2159-
const {language, country} = context.storefront.i18n;
2167+
export async function loader({ params, context }: LoaderFunctionArgs) {
2168+
const { language, country } = context.storefront.i18n;
21602169
21612170
if (
21622171
params.locale &&
21632172
params.locale.toLowerCase() !== `${language}-${country}`.toLowerCase()
21642173
) {
21652174
// If the locale URL param is defined, yet we still are still at the default locale
21662175
// then the the locale param must be invalid, send to the 404 page
2167-
throw new Response(null, {status: 404});
2176+
throw new Response(null, { status: 404 });
21682177
}
21692178
21702179
return null;
@@ -2220,11 +2229,11 @@
22202229
```yaml
22212230
projects:
22222231
default:
2223-
schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'
2232+
schema: "node_modules/@shopify/hydrogen/storefront.schema.json"
22242233
documents:
2225-
- '!*.d.ts'
2226-
- '*.{ts,tsx,js,jsx}'
2227-
- 'app/**/*.{ts,tsx,js,jsx}'
2234+
- "!*.d.ts"
2235+
- "*.{ts,tsx,js,jsx}"
2236+
- "app/**/*.{ts,tsx,js,jsx}"
22282237
```
22292238

22302239
- Improve resiliency of `HydrogenSession` ([#1583](https://github.com/Shopify/hydrogen/pull/1583)) by [@blittle](https://github.com/blittle)
@@ -2439,8 +2448,8 @@
24392448
```ts
24402449
// root.tsx
24412450
2442-
import {useMatches} from '@remix-run/react';
2443-
import {type SerializeFrom} from '@shopify/remix-oxygen';
2451+
import { useMatches } from "@remix-run/react";
2452+
import { type SerializeFrom } from "@shopify/remix-oxygen";
24442453
24452454
export const useRootLoaderData = () => {
24462455
const [root] = useMatches();

0 commit comments

Comments
 (0)