@shopify/create-hydrogen 4.3.13 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/hydrogen/bundle/analyzer.html +2045 -0
- package/dist/assets/hydrogen/i18n/domains.ts +28 -0
- package/dist/assets/hydrogen/i18n/mock-i18n-types.ts +3 -0
- package/dist/assets/hydrogen/i18n/subdomains.ts +27 -0
- package/dist/assets/hydrogen/i18n/subfolders.ts +29 -0
- package/dist/assets/hydrogen/routes/locale-check.ts +16 -0
- package/dist/assets/hydrogen/starter/.eslintignore +5 -0
- package/dist/assets/hydrogen/starter/.eslintrc.cjs +19 -0
- package/dist/assets/hydrogen/starter/.graphqlrc.yml +12 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +709 -0
- package/dist/assets/hydrogen/starter/README.md +45 -0
- package/dist/assets/hydrogen/starter/app/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +37 -0
- package/dist/assets/hydrogen/starter/app/components/Aside.tsx +76 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +150 -0
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +68 -0
- package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +101 -0
- package/dist/assets/hydrogen/starter/app/components/Footer.tsx +129 -0
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +230 -0
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +126 -0
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +80 -0
- package/dist/assets/hydrogen/starter/app/components/ProductImage.tsx +23 -0
- package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +27 -0
- package/dist/assets/hydrogen/starter/app/components/Search.tsx +514 -0
- package/dist/assets/hydrogen/starter/app/entry.client.tsx +12 -0
- package/dist/assets/hydrogen/starter/app/entry.server.tsx +47 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerAddressMutations.ts +61 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerDetailsQuery.ts +40 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrderQuery.ts +87 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrdersQuery.ts +58 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerUpdateMutation.ts +24 -0
- package/dist/assets/hydrogen/starter/app/lib/fragments.ts +174 -0
- package/dist/assets/hydrogen/starter/app/lib/search.ts +29 -0
- package/dist/assets/hydrogen/starter/app/lib/session.ts +72 -0
- package/dist/assets/hydrogen/starter/app/lib/variants.ts +46 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +191 -0
- package/dist/assets/hydrogen/starter/app/routes/$.tsx +11 -0
- package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +118 -0
- package/dist/assets/hydrogen/starter/app/routes/[sitemap.xml].tsx +177 -0
- package/dist/assets/hydrogen/starter/app/routes/_index.tsx +182 -0
- package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +8 -0
- package/dist/assets/hydrogen/starter/app/routes/account._index.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +513 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +195 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +107 -0
- package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +136 -0
- package/dist/assets/hydrogen/starter/app/routes/account.tsx +88 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.authorize.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.login.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.logout.tsx +10 -0
- package/dist/assets/hydrogen/starter/app/routes/api.predictive-search.tsx +318 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +113 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +188 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +119 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.$lines.tsx +69 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +102 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +225 -0
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +146 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +185 -0
- package/dist/assets/hydrogen/starter/app/routes/discount.$code.tsx +47 -0
- package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +84 -0
- package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +93 -0
- package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +63 -0
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +299 -0
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +177 -0
- package/dist/assets/hydrogen/starter/app/styles/app.css +486 -0
- package/dist/assets/hydrogen/starter/app/styles/reset.css +129 -0
- package/dist/assets/hydrogen/starter/customer-accountapi.generated.d.ts +509 -0
- package/dist/assets/hydrogen/starter/env.d.ts +54 -0
- package/dist/assets/hydrogen/starter/package.json +50 -0
- package/dist/assets/hydrogen/starter/public/.gitkeep +0 -0
- package/dist/assets/hydrogen/starter/server.ts +119 -0
- package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +1211 -0
- package/dist/assets/hydrogen/starter/tsconfig.json +23 -0
- package/dist/assets/hydrogen/starter/vite.config.ts +41 -0
- package/dist/assets/hydrogen/tailwind/package.json +8 -0
- package/dist/assets/hydrogen/tailwind/tailwind.css +6 -0
- package/dist/assets/hydrogen/vanilla-extract/package.json +8 -0
- package/dist/assets/hydrogen/virtual-routes/assets/debug-network.css +592 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon-dark.svg +20 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/virtual-routes/assets/inter-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/styles.css +238 -0
- package/dist/assets/hydrogen/virtual-routes/components/FlameChartWrapper.jsx +123 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseBW.jsx +32 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseColor.jsx +47 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconBanner.jsx +292 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconClose.jsx +38 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconDiscard.jsx +44 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconError.jsx +61 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconGithub.jsx +23 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconTwitter.jsx +21 -0
- package/dist/assets/hydrogen/virtual-routes/components/PageLayout.jsx +7 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestDetails.jsx +178 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestTable.jsx +91 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestWaterfall.jsx +151 -0
- package/dist/assets/hydrogen/virtual-routes/lib/useDebugNetworkServer.jsx +178 -0
- package/dist/assets/hydrogen/virtual-routes/routes/graphiql.jsx +5 -0
- package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +265 -0
- package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +243 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +64 -0
- package/dist/assets/hydrogen/vite/package.json +14 -0
- package/dist/assets/hydrogen/vite/vite.config.js +41 -0
- package/dist/chokidar-2CKIHN27.js +12 -0
- package/dist/chunk-EO6F7WJJ.js +2 -0
- package/dist/chunk-FB327AH7.js +5 -0
- package/dist/chunk-FJPX4XUR.js +2 -0
- package/dist/chunk-JKOXGRAA.js +10 -0
- package/dist/chunk-LNQWGFTB.js +45 -0
- package/dist/chunk-M6JXYI3V.js +23 -0
- package/dist/chunk-MNT4XW23.js +2 -0
- package/dist/chunk-N7HFZHSO.js +1145 -0
- package/dist/chunk-PMDMUCNY.js +2 -0
- package/dist/chunk-QGLB6FFL.js +3 -0
- package/dist/chunk-VMIOG46Y.js +2 -0
- package/dist/create-app.js +1867 -34
- package/dist/del-CZGKV5SQ.js +11 -0
- package/dist/devtools-ZCRGQE64.js +8 -0
- package/dist/error-handler-GEQXZJ25.js +2 -0
- package/dist/lib-NJYCLW6W.js +22 -0
- package/dist/morph-ZJCCGFNC.js +30499 -0
- package/dist/multipart-parser-6HGDQWV7.js +3 -0
- package/dist/open-OD6DRFEG.js +2 -0
- package/dist/out-7KAQXZLP.js +2 -0
- package/dist/yoga.wasm +0 -0
- package/package.json +7 -3
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
# skeleton
|
|
2
|
+
|
|
3
|
+
## 2024.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update `@shopify/oxygen-workers-types` to fix issues on Windows. ([#2252](https://github.com/Shopify/hydrogen/pull/2252)) by [@michenly](https://github.com/michenly)
|
|
8
|
+
|
|
9
|
+
- [**Breaking change**] ([#2113](https://github.com/Shopify/hydrogen/pull/2113)) by [@blittle](https://github.com/blittle)
|
|
10
|
+
|
|
11
|
+
Previously the `VariantSelector` component would filter out options that only had one value. This is undesireable for some apps. We've removed that filter, if you'd like to retain the existing functionality, simply filter the options prop before it is passed to the `VariantSelector` component:
|
|
12
|
+
|
|
13
|
+
```diff
|
|
14
|
+
<VariantSelector
|
|
15
|
+
handle={product.handle}
|
|
16
|
+
+ options={product.options.filter((option) => option.values.length > 1)}
|
|
17
|
+
- options={product.options}
|
|
18
|
+
variants={variants}>
|
|
19
|
+
</VariantSelector>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Fixes [#1198](https://github.com/Shopify/hydrogen/discussions/1198)
|
|
23
|
+
|
|
24
|
+
- Update remix to v2.10.1 ([#2290](https://github.com/Shopify/hydrogen/pull/2290)) by [@michenly](https://github.com/michenly)
|
|
25
|
+
|
|
26
|
+
- Update root to use [Remix's Layout Export pattern](https://remix.run/docs/en/main/file-conventions/root#layout-export) and eliminate the use of `useLoaderData` in root. ([#2292](https://github.com/Shopify/hydrogen/pull/2292)) by [@michenly](https://github.com/michenly)
|
|
27
|
+
|
|
28
|
+
The diff below showcase how you can make this refactor in existing application.
|
|
29
|
+
|
|
30
|
+
```diff
|
|
31
|
+
import {
|
|
32
|
+
Outlet,
|
|
33
|
+
- useLoaderData,
|
|
34
|
+
+ useRouteLoaderData,
|
|
35
|
+
} from '@remix-run/react';
|
|
36
|
+
-import {Layout} from '~/components/Layout';
|
|
37
|
+
+import {PageLayout} from '~/components/PageLayout';
|
|
38
|
+
|
|
39
|
+
-export default function App() {
|
|
40
|
+
+export function Layout({children}: {children?: React.ReactNode}) {
|
|
41
|
+
const nonce = useNonce();
|
|
42
|
+
- const data = useLoaderData<typeof loader>();
|
|
43
|
+
+ const data = useRouteLoaderData<typeof loader>('root');
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<html>
|
|
47
|
+
...
|
|
48
|
+
<body>
|
|
49
|
+
- <Layout {...data}>
|
|
50
|
+
- <Outlet />
|
|
51
|
+
- </Layout>
|
|
52
|
+
+ {data? (
|
|
53
|
+
+ <PageLayout {...data}>{children}</PageLayout>
|
|
54
|
+
+ ) : (
|
|
55
|
+
+ children
|
|
56
|
+
+ )}
|
|
57
|
+
</body>
|
|
58
|
+
</html>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
+export default function App() {
|
|
63
|
+
+ return <Outlet />;
|
|
64
|
+
+}
|
|
65
|
+
|
|
66
|
+
export function ErrorBoundary() {
|
|
67
|
+
- const rootData = useLoaderData<typeof loader>();
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
- <html>
|
|
71
|
+
- ...
|
|
72
|
+
- <body>
|
|
73
|
+
- <Layout {...rootData}>
|
|
74
|
+
- <div className="route-error">
|
|
75
|
+
- <h1>Error</h1>
|
|
76
|
+
- ...
|
|
77
|
+
- </div>
|
|
78
|
+
- </Layout>
|
|
79
|
+
- </body>
|
|
80
|
+
- </html>
|
|
81
|
+
+ <div className="route-error">
|
|
82
|
+
+ <h1>Error</h1>
|
|
83
|
+
+ ...
|
|
84
|
+
+ </div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- Refactor the cart and product form components ([#2132](https://github.com/Shopify/hydrogen/pull/2132)) by [@blittle](https://github.com/blittle)
|
|
91
|
+
|
|
92
|
+
- Remove manual setting of session in headers and recommend setting it in server after response is created. ([#2137](https://github.com/Shopify/hydrogen/pull/2137)) by [@michenly](https://github.com/michenly)
|
|
93
|
+
|
|
94
|
+
Step 1: Add `isPending` implementation in session
|
|
95
|
+
|
|
96
|
+
```diff
|
|
97
|
+
// in app/lib/session.ts
|
|
98
|
+
export class AppSession implements HydrogenSession {
|
|
99
|
+
+ public isPending = false;
|
|
100
|
+
|
|
101
|
+
get unset() {
|
|
102
|
+
+ this.isPending = true;
|
|
103
|
+
return this.#session.unset;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
get set() {
|
|
107
|
+
+ this.isPending = true;
|
|
108
|
+
return this.#session.set;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
commit() {
|
|
112
|
+
+ this.isPending = false;
|
|
113
|
+
return this.#sessionStorage.commitSession(this.#session);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Step 2: update response header if `session.isPending` is true
|
|
119
|
+
|
|
120
|
+
```diff
|
|
121
|
+
// in server.ts
|
|
122
|
+
export default {
|
|
123
|
+
async fetch(request: Request): Promise<Response> {
|
|
124
|
+
try {
|
|
125
|
+
const response = await handleRequest(request);
|
|
126
|
+
|
|
127
|
+
+ if (session.isPending) {
|
|
128
|
+
+ response.headers.set('Set-Cookie', await session.commit());
|
|
129
|
+
+ }
|
|
130
|
+
|
|
131
|
+
return response;
|
|
132
|
+
} catch (error) {
|
|
133
|
+
...
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Step 3: remove setting cookie with session.commit() in routes
|
|
140
|
+
|
|
141
|
+
```diff
|
|
142
|
+
// in route files
|
|
143
|
+
export async function loader({context}: LoaderFunctionArgs) {
|
|
144
|
+
return json({},
|
|
145
|
+
- {
|
|
146
|
+
- headers: {
|
|
147
|
+
- 'Set-Cookie': await context.session.commit(),
|
|
148
|
+
- },
|
|
149
|
+
},
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- Moved `@shopify/cli` from `dependencies` to `devDependencies`. ([#2312](https://github.com/Shopify/hydrogen/pull/2312)) by [@frandiox](https://github.com/frandiox)
|
|
155
|
+
|
|
156
|
+
- The `@shopify/cli` package now bundles the `@shopify/cli-hydrogen` plugin. Therefore, you can now remove the latter from your local dependencies: ([#2306](https://github.com/Shopify/hydrogen/pull/2306)) by [@frandiox](https://github.com/frandiox)
|
|
157
|
+
|
|
158
|
+
```diff
|
|
159
|
+
"@shopify/cli": "3.64.0",
|
|
160
|
+
- "@shopify/cli-hydrogen": "^8.1.1",
|
|
161
|
+
"@shopify/hydrogen": "2024.7.0",
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
- Updated dependencies [[`a0e84d76`](https://github.com/Shopify/hydrogen/commit/a0e84d76b67d4c57c4defee06185949c41782eab), [`426bb390`](https://github.com/Shopify/hydrogen/commit/426bb390b25f51e57499ff6673aef70ded935e87), [`4337200c`](https://github.com/Shopify/hydrogen/commit/4337200c7908d56c039171c283a4d92c31a8b7b6), [`710625c7`](https://github.com/Shopify/hydrogen/commit/710625c740a6656488d4b419e2d2451bef9d076f), [`8b9c726d`](https://github.com/Shopify/hydrogen/commit/8b9c726d34f3482b5b5a0da4c7c0c2f20e2c9caa), [`10a419bf`](https://github.com/Shopify/hydrogen/commit/10a419bf1db79cdfd8c41c0223ce695959f60da9), [`6a6278bb`](https://github.com/Shopify/hydrogen/commit/6a6278bb9187b3b5a98cd98ec9dd278882d03c0d), [`66236ca6`](https://github.com/Shopify/hydrogen/commit/66236ca65ddefac99eaa553c7877c85863d84cc2), [`dcbd0bbf`](https://github.com/Shopify/hydrogen/commit/dcbd0bbf4073a3e35e96f3cce257f7b19b2b2aea), [`a5e03e2a`](https://github.com/Shopify/hydrogen/commit/a5e03e2a1e99fcd83ee5a2be7bf6f5f6b47984b3), [`c2690653`](https://github.com/Shopify/hydrogen/commit/c2690653b6b24f7318e9088551a37195255a2247), [`54c2f7ad`](https://github.com/Shopify/hydrogen/commit/54c2f7ad3d0d52e6be10b2a54a1a4fd0cc107a35), [`4337200c`](https://github.com/Shopify/hydrogen/commit/4337200c7908d56c039171c283a4d92c31a8b7b6), [`e96b332b`](https://github.com/Shopify/hydrogen/commit/e96b332ba1aba79aa3d5c2ce18001292070faf49), [`f3065371`](https://github.com/Shopify/hydrogen/commit/f3065371c1dda222c6e40bd8c20528dc9fdea9a5), [`6cd5554b`](https://github.com/Shopify/hydrogen/commit/6cd5554b160d314d35964a5ee8976ed60972bf17), [`9eb60d73`](https://github.com/Shopify/hydrogen/commit/9eb60d73e552c3d22b9325ecbcd5878810893ad3), [`e432533e`](https://github.com/Shopify/hydrogen/commit/e432533e7391ec3fe16a4a24f2b3363206842580), [`de3f70be`](https://github.com/Shopify/hydrogen/commit/de3f70be1a838eda746903cbb38cc25cf0e09fa3), [`83cb96f4`](https://github.com/Shopify/hydrogen/commit/83cb96f42078bf79b20a153d8a8461f75d573ab1)]:
|
|
165
|
+
- @shopify/remix-oxygen@2.0.5
|
|
166
|
+
- @shopify/cli-hydrogen@8.2.0
|
|
167
|
+
- @shopify/hydrogen@2024.7.1
|
|
168
|
+
|
|
169
|
+
## 2024.4.5
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- Update remix to v2.9.2 ([#2135](https://github.com/Shopify/hydrogen/pull/2135)) by [@michenly](https://github.com/michenly)
|
|
174
|
+
|
|
175
|
+
- `<Analytics>` and `useAnalytics` are now stable. ([#2141](https://github.com/Shopify/hydrogen/pull/2141)) by [@wizardlyhel](https://github.com/wizardlyhel)
|
|
176
|
+
|
|
177
|
+
- Update the skeleton template to use React state in the aside dialogs ([#2088](https://github.com/Shopify/hydrogen/pull/2088)) by [@blittle](https://github.com/blittle)
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [[`fe82119f`](https://github.com/Shopify/hydrogen/commit/fe82119f5e75df5a0f727bab6a2186e679abc73d), [`32d4c33e`](https://github.com/Shopify/hydrogen/commit/32d4c33e4421a9c56f62a8c392f5417edddd0402), [`8eea75ec`](https://github.com/Shopify/hydrogen/commit/8eea75ec5ead4de98d7d1b2baedce8511029bcae), [`27e51abf`](https://github.com/Shopify/hydrogen/commit/27e51abfc1f5444afa952c503886bfa12fc55c7e), [`f29c9085`](https://github.com/Shopify/hydrogen/commit/f29c9085eb1adbde9e01226484eba8a85b5074ed), [`7b838beb`](https://github.com/Shopify/hydrogen/commit/7b838beb7c43380ffc9c32c2bb9f34291912fa42), [`d702aec2`](https://github.com/Shopify/hydrogen/commit/d702aec2214646a78cdafc2c25d510489db73f6d), [`ca4cf045`](https://github.com/Shopify/hydrogen/commit/ca4cf045f7fb72ad98b62af7bd172ff8cf553de2), [`5a554b2e`](https://github.com/Shopify/hydrogen/commit/5a554b2e9d91894c2db8032f0c29666dce1ea3f2), [`27e51abf`](https://github.com/Shopify/hydrogen/commit/27e51abfc1f5444afa952c503886bfa12fc55c7e), [`5d6465b3`](https://github.com/Shopify/hydrogen/commit/5d6465b32d90052e5580fcb81d98427bcb8ad528), [`608389d6`](https://github.com/Shopify/hydrogen/commit/608389d6d69c6a9801935d528507c165d1dd4ccf), [`9dfd1cfe`](https://github.com/Shopify/hydrogen/commit/9dfd1cfeb3e96c6d3426427a4b5d97ef475dab6d), [`7def3e9f`](https://github.com/Shopify/hydrogen/commit/7def3e9fa6e28f4fde7af43e2f346aa32267c38e), [`65239c76`](https://github.com/Shopify/hydrogen/commit/65239c76ca1d0b294b59b1ad53624485859c4da5), [`ca7f2888`](https://github.com/Shopify/hydrogen/commit/ca7f28887367a4882e57a67c4e248b0f0bba1c9b)]:
|
|
180
|
+
- @shopify/hydrogen@2024.4.3
|
|
181
|
+
- @shopify/cli-hydrogen@8.1.0
|
|
182
|
+
|
|
183
|
+
## 2024.4.4
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Add JSdoc to `getSelectedProductOptions` utility and cleanup the skeleton implementation ([#2089](https://github.com/Shopify/hydrogen/pull/2089)) by [@juanpprieto](https://github.com/juanpprieto)
|
|
188
|
+
|
|
189
|
+
- Updated dependencies [[`286589ee`](https://github.com/Shopify/hydrogen/commit/286589ee281c161ad323e3d45a8b9b859aa5b11f), [`6f5061d9`](https://github.com/Shopify/hydrogen/commit/6f5061d9432f749fde7902548894e98c0d3f899c), [`ae262b61`](https://github.com/Shopify/hydrogen/commit/ae262b616127a7173d23a1a38a6e658af3105ce8), [`2c11ca3b`](https://github.com/Shopify/hydrogen/commit/2c11ca3b7a00ccca2b621dbc29abd319f9598cc8), [`b70f9c2c`](https://github.com/Shopify/hydrogen/commit/b70f9c2c3db8e863c65509097454b9ad7c81cd52), [`17528db1`](https://github.com/Shopify/hydrogen/commit/17528db1eb3d1baa001bafe0684b4bce28d2e271), [`58ea9bb0`](https://github.com/Shopify/hydrogen/commit/58ea9bb0f0eee83ff89e34e2f1f6ac3c4999e213)]:
|
|
190
|
+
- @shopify/cli-hydrogen@8.0.4
|
|
191
|
+
- @shopify/hydrogen@2024.4.2
|
|
192
|
+
|
|
193
|
+
## 1.0.10
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- Update `@shopify/cli` dependency to avoid React version mismatches in your project: ([#2059](https://github.com/Shopify/hydrogen/pull/2059)) by [@frandiox](https://github.com/frandiox)
|
|
198
|
+
|
|
199
|
+
```diff
|
|
200
|
+
"dependencies": {
|
|
201
|
+
...
|
|
202
|
+
- "@shopify/cli": "3.58.0",
|
|
203
|
+
+ "@shopify/cli": "3.59.2",
|
|
204
|
+
...
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
- Updated dependencies [[`d2bc720b`](https://github.com/Shopify/hydrogen/commit/d2bc720bb5f7cfb5f42617f98ad2dfcd29891f4b)]:
|
|
209
|
+
- @shopify/cli-hydrogen@8.0.3
|
|
210
|
+
|
|
211
|
+
## 1.0.9
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- Pin React dependency to 18.2.0 to avoid mismatches. ([#2051](https://github.com/Shopify/hydrogen/pull/2051)) by [@frandiox](https://github.com/frandiox)
|
|
216
|
+
|
|
217
|
+
- Updated dependencies [[`9c36c8a5`](https://github.com/Shopify/hydrogen/commit/9c36c8a566b1ae2ceac4846c4c9fe4f63f6f4ab3)]:
|
|
218
|
+
- @shopify/cli-hydrogen@8.0.2
|
|
219
|
+
|
|
220
|
+
## 1.0.8
|
|
221
|
+
|
|
222
|
+
### Patch Changes
|
|
223
|
+
|
|
224
|
+
- Stop inlining the favicon in base64 to avoid issues with the Content-Security-Policy. In `vite.config.js`: ([#2006](https://github.com/Shopify/hydrogen/pull/2006)) by [@frandiox](https://github.com/frandiox)
|
|
225
|
+
|
|
226
|
+
```diff
|
|
227
|
+
export default defineConfig({
|
|
228
|
+
plugins: [
|
|
229
|
+
...
|
|
230
|
+
],
|
|
231
|
+
+ build: {
|
|
232
|
+
+ assetsInlineLimit: 0,
|
|
233
|
+
+ },
|
|
234
|
+
});
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
- To improve HMR in Vite, move the `useRootLoaderData` function from `app/root.tsx` to a separate file like `app/lib/root-data.ts`. This change avoids circular imports: ([#2014](https://github.com/Shopify/hydrogen/pull/2014)) by [@frandiox](https://github.com/frandiox)
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
// app/lib/root-data.ts
|
|
241
|
+
import {useMatches} from '@remix-run/react';
|
|
242
|
+
import type {SerializeFrom} from '@shopify/remix-oxygen';
|
|
243
|
+
import type {loader} from '~/root';
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Access the result of the root loader from a React component.
|
|
247
|
+
*/
|
|
248
|
+
export const useRootLoaderData = () => {
|
|
249
|
+
const [root] = useMatches();
|
|
250
|
+
return root?.data as SerializeFrom<typeof loader>;
|
|
251
|
+
};
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Import this hook from `~/lib/root-data` instead of `~/root` in your components.
|
|
255
|
+
|
|
256
|
+
- Updated dependencies [[`b4dfda32`](https://github.com/Shopify/hydrogen/commit/b4dfda320ca52855b2d4493a4306d15a883ca843), [`ffa57bdb`](https://github.com/Shopify/hydrogen/commit/ffa57bdbcdf51e03d565736f9388b5bb4f46292c), [`ac4e1670`](https://github.com/Shopify/hydrogen/commit/ac4e1670f0361a2cd2c6827e4162bbbee0ca37f3), [`0af624d5`](https://github.com/Shopify/hydrogen/commit/0af624d51afc7250db889ba5e736c85a6070c8b2), [`9723eaf3`](https://github.com/Shopify/hydrogen/commit/9723eaf3e5a42c30e657d1cadb123ed775d620e4), [`e842f68c`](https://github.com/Shopify/hydrogen/commit/e842f68c8e879d4c54e0730f3cb55214a760d7f5)]:
|
|
257
|
+
- @shopify/cli-hydrogen@8.0.1
|
|
258
|
+
- @shopify/hydrogen@2024.4.1
|
|
259
|
+
|
|
260
|
+
## 1.0.7
|
|
261
|
+
|
|
262
|
+
### Patch Changes
|
|
263
|
+
|
|
264
|
+
- Update internal libraries for parsing `.env` files. ([#1946](https://github.com/Shopify/hydrogen/pull/1946)) by [@aswamy](https://github.com/aswamy)
|
|
265
|
+
|
|
266
|
+
Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies:
|
|
267
|
+
|
|
268
|
+
```diff
|
|
269
|
+
"dependencies": {
|
|
270
|
+
- "@shopify/cli": "3.56.3",
|
|
271
|
+
+ "@shopify/cli": "3.58.0",
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
- Add Adds magic Catalog route ([#1967](https://github.com/Shopify/hydrogen/pull/1967)) by [@juanpprieto](https://github.com/juanpprieto)
|
|
276
|
+
|
|
277
|
+
- Update Vite plugin imports, and how their options are passed to Remix: ([#1935](https://github.com/Shopify/hydrogen/pull/1935)) by [@frandiox](https://github.com/frandiox)
|
|
278
|
+
|
|
279
|
+
```diff
|
|
280
|
+
-import {hydrogen, oxygen} from '@shopify/cli-hydrogen/experimental-vite';
|
|
281
|
+
+import {hydrogen} from '@shopify/hydrogen/vite';
|
|
282
|
+
+import {oxygen} from '@shopify/mini-oxygen/vite';
|
|
283
|
+
import {vitePlugin as remix} from '@remix-run/dev';
|
|
284
|
+
|
|
285
|
+
export default defineConfig({
|
|
286
|
+
hydrogen(),
|
|
287
|
+
oxygen(),
|
|
288
|
+
remix({
|
|
289
|
+
- buildDirectory: 'dist',
|
|
290
|
+
+ presets: [hydrogen.preset()],
|
|
291
|
+
future: {
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
- Add `@shopify/mini-oxygen` as a dev dependency for local development: ([#1891](https://github.com/Shopify/hydrogen/pull/1891)) by [@frandiox](https://github.com/frandiox)
|
|
295
|
+
|
|
296
|
+
```diff
|
|
297
|
+
"devDependencies": {
|
|
298
|
+
"@remix-run/dev": "^2.8.0",
|
|
299
|
+
"@remix-run/eslint-config": "^2.8.0",
|
|
300
|
+
+ "@shopify/mini-oxygen": "^3.0.0",
|
|
301
|
+
"@shopify/oxygen-workers-types": "^4.0.0",
|
|
302
|
+
...
|
|
303
|
+
},
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
- Add the `customer-account push` command to the Hydrogen CLI. This allows you to push the current `--dev-origin` URL to the Shopify admin to enable secure connection to the Customer Account API for local development. ([#1804](https://github.com/Shopify/hydrogen/pull/1804)) by [@michenly](https://github.com/michenly)
|
|
307
|
+
|
|
308
|
+
- Fix types returned by the `session` object. ([#1869](https://github.com/Shopify/hydrogen/pull/1869)) by [@frandiox](https://github.com/frandiox)
|
|
309
|
+
|
|
310
|
+
In `remix.env.d.ts` or `env.d.ts`, add the following types:
|
|
311
|
+
|
|
312
|
+
```diff
|
|
313
|
+
import type {
|
|
314
|
+
// ...
|
|
315
|
+
HydrogenCart,
|
|
316
|
+
+ HydrogenSessionData,
|
|
317
|
+
} from '@shopify/hydrogen';
|
|
318
|
+
|
|
319
|
+
// ...
|
|
320
|
+
|
|
321
|
+
declare module '@shopify/remix-oxygen' {
|
|
322
|
+
// ...
|
|
323
|
+
|
|
324
|
+
+ interface SessionData extends HydrogenSessionData {}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
- Codegen dependencies must be now listed explicitly in `package.json`: ([#1962](https://github.com/Shopify/hydrogen/pull/1962)) by [@frandiox](https://github.com/frandiox)
|
|
329
|
+
|
|
330
|
+
```diff
|
|
331
|
+
{
|
|
332
|
+
"devDependencies": {
|
|
333
|
+
+ "@graphql-codegen/cli": "5.0.2",
|
|
334
|
+
"@remix-run/dev": "^2.8.0",
|
|
335
|
+
"@remix-run/eslint-config": "^2.8.0",
|
|
336
|
+
+ "@shopify/hydrogen-codegen": "^0.3.0",
|
|
337
|
+
"@shopify/mini-oxygen": "^2.2.5",
|
|
338
|
+
"@shopify/oxygen-workers-types": "^4.0.0",
|
|
339
|
+
...
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
- Updated dependencies [[`4eaec272`](https://github.com/Shopify/hydrogen/commit/4eaec272696f1a718aa7cab1070a54385ebc3686), [`14bb5df1`](https://github.com/Shopify/hydrogen/commit/14bb5df1c1513a7991183d34e72220cb2b139cf5), [`646b78d4`](https://github.com/Shopify/hydrogen/commit/646b78d4bc26310121b16000ed4d1c5d5e63957d), [`87072950`](https://github.com/Shopify/hydrogen/commit/870729505f7eb1f1c709799dd036ad02fd94be95), [`5f1295fe`](https://github.com/Shopify/hydrogen/commit/5f1295fe60b86396f364fefef339248a444c988a), [`3c8a7313`](https://github.com/Shopify/hydrogen/commit/3c8a7313cafb0ca21bbca19ac0b3f8ef4ab12655), [`ca1dcbb7`](https://github.com/Shopify/hydrogen/commit/ca1dcbb7d69c458006e25892c86c4478d394a428), [`11879b17`](https://github.com/Shopify/hydrogen/commit/11879b175d78e3326de090a56a044d1e55d0bae8), [`f4d6e5b0`](https://github.com/Shopify/hydrogen/commit/f4d6e5b0244392a7c13b9fa51c5046fd103c3e4f), [`788d86b3`](https://github.com/Shopify/hydrogen/commit/788d86b3a737bff53b4ec3aa9667458b2d45ade7), [`ebaf5529`](https://github.com/Shopify/hydrogen/commit/ebaf5529287b24a70b3146444b18f95b64f9f336), [`da95bb1c`](https://github.com/Shopify/hydrogen/commit/da95bb1c8c644f450053ce649b40dc380e7375dc), [`5bb43304`](https://github.com/Shopify/hydrogen/commit/5bb43304c08427786cfd4f2529e59bd38f593252), [`140e4768`](https://github.com/Shopify/hydrogen/commit/140e4768c880aaed4ba95b1d4c707df6963e011c), [`062d6be7`](https://github.com/Shopify/hydrogen/commit/062d6be7e031c388498ec3d359de51a4bfdfdfd8), [`b3323e59`](https://github.com/Shopify/hydrogen/commit/b3323e59a4381647f1df797c5dc54793f6e0a29a), [`ab0df5a5`](https://github.com/Shopify/hydrogen/commit/ab0df5a52bc587515880ae26f4edd18ba2be83cd), [`ebaf5529`](https://github.com/Shopify/hydrogen/commit/ebaf5529287b24a70b3146444b18f95b64f9f336), [`ebaf5529`](https://github.com/Shopify/hydrogen/commit/ebaf5529287b24a70b3146444b18f95b64f9f336), [`9e899218`](https://github.com/Shopify/hydrogen/commit/9e8992181ce7d27548d35f98b5a4f78b80795ce8), [`a209019f`](https://github.com/Shopify/hydrogen/commit/a209019f722ece4b65f8d5f37c8018c949956b1e), [`d007b7bc`](https://github.com/Shopify/hydrogen/commit/d007b7bc6f6c36e984d937108230ecc7c202fa42), [`a5511cd7`](https://github.com/Shopify/hydrogen/commit/a5511cd7bf9b0f0c4ef0e52cd72418f78c04785b), [`4afedb4d`](https://github.com/Shopify/hydrogen/commit/4afedb4d7202715df9a153e877e8eb281cc3e928), [`34fbae23`](https://github.com/Shopify/hydrogen/commit/34fbae23999eefbd1af1dff44816a52813d75b44), [`e3baaba5`](https://github.com/Shopify/hydrogen/commit/e3baaba54c701a48923ab3fe8078278f2db2c53f), [`99d72f7a`](https://github.com/Shopify/hydrogen/commit/99d72f7afc354abb66ed0e4ffb020bede2781286), [`9351f9f5`](https://github.com/Shopify/hydrogen/commit/9351f9f564267124bcbf986f5550a542c4bf1e30)]:
|
|
345
|
+
- @shopify/cli-hydrogen@8.0.0
|
|
346
|
+
- @shopify/hydrogen@2024.4.0
|
|
347
|
+
- @shopify/remix-oxygen@2.0.4
|
|
348
|
+
|
|
349
|
+
## 1.0.6
|
|
350
|
+
|
|
351
|
+
### Patch Changes
|
|
352
|
+
|
|
353
|
+
- Improve performance of predictive search: ([#1823](https://github.com/Shopify/hydrogen/pull/1823)) by [@frandiox](https://github.com/frandiox)
|
|
354
|
+
|
|
355
|
+
- Change the request to be GET instead of POST to avoid Remix route revalidations.
|
|
356
|
+
- Add Cache-Control headers to the response to get quicker results when typing.
|
|
357
|
+
|
|
358
|
+
Aside from that, it now shows a loading state when fetching the results instead of "No results found.".
|
|
359
|
+
|
|
360
|
+
- Updated dependencies [[`351b3c1b`](https://github.com/Shopify/hydrogen/commit/351b3c1b7768870793ff072ba91426107ba0180c), [`5060cf57`](https://github.com/Shopify/hydrogen/commit/5060cf57f69d8391b425b54acaa487af1f7405ae), [`2888014e`](https://github.com/Shopify/hydrogen/commit/2888014e54fab72c150e9eca55df3c6dd789503e)]:
|
|
361
|
+
- @shopify/hydrogen@2024.1.4
|
|
362
|
+
- @shopify/cli-hydrogen@7.1.2
|
|
363
|
+
|
|
364
|
+
## 1.0.5
|
|
365
|
+
|
|
366
|
+
### Patch Changes
|
|
367
|
+
|
|
368
|
+
- Update the `@shopify/cli` dependency: ([#1786](https://github.com/Shopify/hydrogen/pull/1786)) by [@frandiox](https://github.com/frandiox)
|
|
369
|
+
|
|
370
|
+
```diff
|
|
371
|
+
- "@shopify/cli": "3.52.0",
|
|
372
|
+
+ "@shopify/cli": "3.56.3",
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
- Update Remix and associated packages to 2.8.0. ([#1781](https://github.com/Shopify/hydrogen/pull/1781)) by [@frandiox](https://github.com/frandiox)
|
|
376
|
+
|
|
377
|
+
```diff
|
|
378
|
+
"dependencies": {
|
|
379
|
+
- "@remix-run/react": "^2.6.0",
|
|
380
|
+
- "@remix-run/server-runtime": "^2.6.0",
|
|
381
|
+
+ "@remix-run/react": "^2.8.0",
|
|
382
|
+
+ "@remix-run/server-runtime": "^2.8.0",
|
|
383
|
+
//...
|
|
384
|
+
},
|
|
385
|
+
"devDependencies": {
|
|
386
|
+
- "@remix-run/dev": "^2.6.0",
|
|
387
|
+
- "@remix-run/eslint-config": "^2.6.0",
|
|
388
|
+
+ "@remix-run/dev": "^2.8.0",
|
|
389
|
+
+ "@remix-run/eslint-config": "^2.8.0",
|
|
390
|
+
//...
|
|
391
|
+
},
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
- Updated dependencies [[`ced1d4cb`](https://github.com/Shopify/hydrogen/commit/ced1d4cb5b1eeeb4303449eb1d60aac44f33480e), [`fc013401`](https://github.com/Shopify/hydrogen/commit/fc013401c5727948b602c9c6b6963a2df21cbd38), [`e641255e`](https://github.com/Shopify/hydrogen/commit/e641255eccc5783b41c8fabbc88313a610f539d0), [`d7e04cb6`](https://github.com/Shopify/hydrogen/commit/d7e04cb6a33d40ea86fa8ac2712d7a5ea785de2d), [`eedd9c49`](https://github.com/Shopify/hydrogen/commit/eedd9c497b36aba47a641cecbc710e18f5b14e46)]:
|
|
395
|
+
- @shopify/cli-hydrogen@7.1.1
|
|
396
|
+
- @shopify/hydrogen@2024.1.3
|
|
397
|
+
|
|
398
|
+
## 1.0.4
|
|
399
|
+
|
|
400
|
+
### Patch Changes
|
|
401
|
+
|
|
402
|
+
- 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)
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
import {type LoaderFunctionArgs} from '@remix-run/server-runtime';
|
|
406
|
+
|
|
407
|
+
export async function loader({params, context}: LoaderFunctionArgs) {
|
|
408
|
+
const {language, country} = context.storefront.i18n;
|
|
409
|
+
|
|
410
|
+
if (
|
|
411
|
+
params.locale &&
|
|
412
|
+
params.locale.toLowerCase() !== `${language}-${country}`.toLowerCase()
|
|
413
|
+
) {
|
|
414
|
+
// If the locale URL param is defined, yet we still are still at the default locale
|
|
415
|
+
// then the the locale param must be invalid, send to the 404 page
|
|
416
|
+
throw new Response(null, {status: 404});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
- Add defensive null checks to the default cart implementation in the starter template ([#1746](https://github.com/Shopify/hydrogen/pull/1746)) by [@blittle](https://github.com/blittle)
|
|
424
|
+
|
|
425
|
+
- 🐛 Fix issue where customer login does not persist to checkout ([#1719](https://github.com/Shopify/hydrogen/pull/1719)) by [@michenly](https://github.com/michenly)
|
|
426
|
+
|
|
427
|
+
✨ Add `customerAccount` option to `createCartHandler`. Where a `?logged_in=true` will be added to the checkoutUrl for cart query if a customer is logged in.
|
|
428
|
+
|
|
429
|
+
- Updated dependencies [[`faeba9f8`](https://github.com/Shopify/hydrogen/commit/faeba9f8947d6b9420b33274a0f39b62418ff2e5), [`6d585026`](https://github.com/Shopify/hydrogen/commit/6d585026623204e99d54a5f2efa3d1c74f690bb6), [`fcecfb23`](https://github.com/Shopify/hydrogen/commit/fcecfb2307210b9d73a7cc90ba865508937217ba), [`28864d6f`](https://github.com/Shopify/hydrogen/commit/28864d6ffbb19b62a5fb8f4c9bbe27568de62411), [`c0ec7714`](https://github.com/Shopify/hydrogen/commit/c0ec77141fb1d7a713d91219b8777bc541780ae8), [`226cf478`](https://github.com/Shopify/hydrogen/commit/226cf478a5bdef1cca33fe8f69832ae0e557d9d9), [`06d9fd91`](https://github.com/Shopify/hydrogen/commit/06d9fd91140bd52a8ee41a20bc114ce2e7fb67dc)]:
|
|
430
|
+
- @shopify/cli-hydrogen@7.1.0
|
|
431
|
+
- @shopify/hydrogen@2024.1.2
|
|
432
|
+
|
|
433
|
+
## 1.0.3
|
|
434
|
+
|
|
435
|
+
### Patch Changes
|
|
436
|
+
|
|
437
|
+
- ♻️ `CustomerClient` type is deprecated and replaced by `CustomerAccount` ([#1692](https://github.com/Shopify/hydrogen/pull/1692)) by [@michenly](https://github.com/michenly)
|
|
438
|
+
|
|
439
|
+
- Updated dependencies [[`02798786`](https://github.com/Shopify/hydrogen/commit/02798786bf8ae5c53f6430723a86d62b8e94d120), [`52b15df4`](https://github.com/Shopify/hydrogen/commit/52b15df457ce723bbc83ad594ded73a7b06447d6), [`a2664362`](https://github.com/Shopify/hydrogen/commit/a2664362a7d89b34835553a9b0eb7af55ca70ae4), [`eee5d927`](https://github.com/Shopify/hydrogen/commit/eee5d9274b72404dfb0ffef30d5503fd553be5fe), [`c7b2017f`](https://github.com/Shopify/hydrogen/commit/c7b2017f11a2cb4d280dfd8f170e65a908b9ea02), [`06320ee4`](https://github.com/Shopify/hydrogen/commit/06320ee48b94dbfece945461031a252f454fd0a3)]:
|
|
440
|
+
- @shopify/hydrogen@2024.1.1
|
|
441
|
+
- @shopify/cli-hydrogen@7.0.1
|
|
442
|
+
|
|
443
|
+
## 1.0.2
|
|
444
|
+
|
|
445
|
+
### Patch Changes
|
|
446
|
+
|
|
447
|
+
- Use new parameters introduced in Storefront API v2024-01 to fix redirection to the product's default variant when there are unknown query params in the URL. ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel)
|
|
448
|
+
|
|
449
|
+
```diff
|
|
450
|
+
- selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions) {
|
|
451
|
+
+ selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions, ignoreUnknownOptions: true, caseInsensitiveMatch: true) {
|
|
452
|
+
...ProductVariant
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
- Update the GraphQL config in `.graphqlrc.yml` to use the more modern `projects` structure: ([#1577](https://github.com/Shopify/hydrogen/pull/1577)) by [@frandiox](https://github.com/frandiox)
|
|
457
|
+
|
|
458
|
+
```diff
|
|
459
|
+
-schema: node_modules/@shopify/hydrogen/storefront.schema.json
|
|
460
|
+
+projects:
|
|
461
|
+
+ default:
|
|
462
|
+
+ schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
This allows you to add additional projects to the GraphQL config, such as third party CMS schemas.
|
|
466
|
+
|
|
467
|
+
Also, you can modify the document paths used for the Storefront API queries. This is useful if you have a large codebase and want to exclude certain files from being used for codegen or other GraphQL utilities:
|
|
468
|
+
|
|
469
|
+
```yaml
|
|
470
|
+
projects:
|
|
471
|
+
default:
|
|
472
|
+
schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'
|
|
473
|
+
documents:
|
|
474
|
+
- '!*.d.ts'
|
|
475
|
+
- '*.{ts,tsx,js,jsx}'
|
|
476
|
+
- 'app/**/*.{ts,tsx,js,jsx}'
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
- Improve resiliency of `HydrogenSession` ([#1583](https://github.com/Shopify/hydrogen/pull/1583)) by [@blittle](https://github.com/blittle)
|
|
480
|
+
|
|
481
|
+
- Update `@shopify/cli` dependency in `package.json`: ([#1579](https://github.com/Shopify/hydrogen/pull/1579)) by [@frandiox](https://github.com/frandiox)
|
|
482
|
+
|
|
483
|
+
```diff
|
|
484
|
+
- "@shopify/cli": "3.51.0",
|
|
485
|
+
+ "@shopify/cli": "3.52.0",
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
- - Update example and template Remix versions to `^2.5.1` ([#1639](https://github.com/Shopify/hydrogen/pull/1639)) by [@wizardlyhel](https://github.com/wizardlyhel)
|
|
489
|
+
|
|
490
|
+
- Enable Remix future flags:
|
|
491
|
+
- [`v3_fetcherPersist`](https://remix.run/docs/en/main/hooks/use-fetchers#additional-resources)
|
|
492
|
+
- [`v3_relativeSplatpath`](https://remix.run/docs/en/main/hooks/use-resolved-path#splat-paths)
|
|
493
|
+
|
|
494
|
+
- Updated dependencies [[`810f48cf`](https://github.com/Shopify/hydrogen/commit/810f48cf5d55f0cfcac6e01fe481db8c76e77cd2), [`8c477cb5`](https://github.com/Shopify/hydrogen/commit/8c477cb565c3e018bf4e13bad01804c21611fb8a), [`42ac4138`](https://github.com/Shopify/hydrogen/commit/42ac4138553c7e1a438b075c4f9cb781edffebc4), [`0241b7d2`](https://github.com/Shopify/hydrogen/commit/0241b7d2dcb887d259ce9033aca356d391bc07df), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912), [`0ff63bed`](https://github.com/Shopify/hydrogen/commit/0ff63bed840f5b8a5eb9968b67bd9a5a57099253), [`6bc1d61c`](https://github.com/Shopify/hydrogen/commit/6bc1d61c17a9c9be13f52338d2ab940e64e73495), [`eb0f4bcc`](https://github.com/Shopify/hydrogen/commit/eb0f4bccb57966a00ecb2b88d17dd694599da340), [`400bfee6`](https://github.com/Shopify/hydrogen/commit/400bfee6836a51c6ab5e4804e8b1e9ad48856dcb), [`a69c21ca`](https://github.com/Shopify/hydrogen/commit/a69c21caa15dfedb88afd50f262f17bf86f74836), [`970073e7`](https://github.com/Shopify/hydrogen/commit/970073e78258880505e0de563136b5379d5d24af), [`772118ca`](https://github.com/Shopify/hydrogen/commit/772118ca6aefbd47841fffc6ce42856c2dc779bd), [`335375a6`](https://github.com/Shopify/hydrogen/commit/335375a6b1a512f70e169a82bc87a8392dc8c92c), [`335371ce`](https://github.com/Shopify/hydrogen/commit/335371ceb6e1bd5aebb6104f131d3f22798a245f), [`94509b75`](https://github.com/Shopify/hydrogen/commit/94509b750afefd686971198ed86277e2c70f3176), [`36d6fa2c`](https://github.com/Shopify/hydrogen/commit/36d6fa2c4fa54ff79f06ef17aa41f60478977bc0), [`3e7b6e8a`](https://github.com/Shopify/hydrogen/commit/3e7b6e8a3bf66bad7fc0f9c224f1c163dbe3e288), [`cce65795`](https://github.com/Shopify/hydrogen/commit/cce6579580f849bec9a28cf575f7130ba3627f6b), [`9e3d88d4`](https://github.com/Shopify/hydrogen/commit/9e3d88d498efaa20fe23de9837e0f444180bc787), [`ca1161b2`](https://github.com/Shopify/hydrogen/commit/ca1161b29ad7b4d0838953782fb114d5fe82193a), [`92840e51`](https://github.com/Shopify/hydrogen/commit/92840e51820e5c7822f731affd3f591c0099be10), [`952fedf2`](https://github.com/Shopify/hydrogen/commit/952fedf27b869164550954d1c15f53b32ec02675), [`1bc053c9`](https://github.com/Shopify/hydrogen/commit/1bc053c94ba1be14ddc28be9eb70be7219b295d1)]:
|
|
495
|
+
- @shopify/hydrogen@2024.1.0
|
|
496
|
+
- @shopify/cli-hydrogen@7.0.0
|
|
497
|
+
- @shopify/remix-oxygen@2.0.3
|
|
498
|
+
|
|
499
|
+
## 1.0.1
|
|
500
|
+
|
|
501
|
+
### Patch Changes
|
|
502
|
+
|
|
503
|
+
- Sync up environment variable names across all example & type files. ([#1542](https://github.com/Shopify/hydrogen/pull/1542)) by [@michenly](https://github.com/michenly)
|
|
504
|
+
|
|
505
|
+
- Remove error boundary from robots.txt file in the Skeleton template ([#1492](https://github.com/Shopify/hydrogen/pull/1492)) by [@andrewcohen](https://github.com/andrewcohen)
|
|
506
|
+
|
|
507
|
+
- Use the worker runtime by default when running the `dev` or `preview` commands. ([#1525](https://github.com/Shopify/hydrogen/pull/1525)) by [@frandiox](https://github.com/frandiox)
|
|
508
|
+
|
|
509
|
+
Enable it in your project by adding the `--worker` flag to your package.json scripts:
|
|
510
|
+
|
|
511
|
+
```diff
|
|
512
|
+
"scripts": {
|
|
513
|
+
"build": "shopify hydrogen build",
|
|
514
|
+
- "dev": "shopify hydrogen dev --codegen",
|
|
515
|
+
+ "dev": "shopify hydrogen dev --worker --codegen",
|
|
516
|
+
- "preview": "npm run build && shopify hydrogen preview",
|
|
517
|
+
+ "preview": "npm run build && shopify hydrogen preview --worker",
|
|
518
|
+
...
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
- Update to the latest version of `@shopify/oxygen-workers-types`. ([#1494](https://github.com/Shopify/hydrogen/pull/1494)) by [@frandiox](https://github.com/frandiox)
|
|
523
|
+
|
|
524
|
+
In TypeScript projects, when updating to the latest `@shopify/remix-oxygen` adapter release, you should also update to the latest version of `@shopify/oxygen-workers-types`:
|
|
525
|
+
|
|
526
|
+
```diff
|
|
527
|
+
"devDependencies": {
|
|
528
|
+
"@remix-run/dev": "2.1.0",
|
|
529
|
+
"@remix-run/eslint-config": "2.1.0",
|
|
530
|
+
- "@shopify/oxygen-workers-types": "^3.17.3",
|
|
531
|
+
+ "@shopify/oxygen-workers-types": "^4.0.0",
|
|
532
|
+
"@shopify/prettier-config": "^1.1.2",
|
|
533
|
+
...
|
|
534
|
+
},
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
- Update internal dependencies for bug resolution. ([#1496](https://github.com/Shopify/hydrogen/pull/1496)) by [@vincentezw](https://github.com/vincentezw)
|
|
538
|
+
|
|
539
|
+
Update your `@shopify/cli` dependency to avoid duplicated sub-dependencies:
|
|
540
|
+
|
|
541
|
+
```diff
|
|
542
|
+
"dependencies": {
|
|
543
|
+
- "@shopify/cli": "3.50.2",
|
|
544
|
+
+ "@shopify/cli": "3.51.0",
|
|
545
|
+
}
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
- Update all Node.js dependencies to version 18. (Not a breaking change, since Node.js 18 is already required by Remix v2.) ([#1543](https://github.com/Shopify/hydrogen/pull/1543)) by [@michenly](https://github.com/michenly)
|
|
549
|
+
|
|
550
|
+
- 🐛 fix undefined menu error ([#1533](https://github.com/Shopify/hydrogen/pull/1533)) by [@michenly](https://github.com/michenly)
|
|
551
|
+
|
|
552
|
+
- Add `@remix-run/server-runtime` dependency. ([#1489](https://github.com/Shopify/hydrogen/pull/1489)) by [@frandiox](https://github.com/frandiox)
|
|
553
|
+
|
|
554
|
+
Since Remix is now a peer dependency of `@shopify/remix-oxygen`, you need to add `@remix-run/server-runtime` to your dependencies, with the same version as the rest of your Remix dependencies.
|
|
555
|
+
|
|
556
|
+
```diff
|
|
557
|
+
"dependencies": {
|
|
558
|
+
"@remix-run/react": "2.1.0"
|
|
559
|
+
+ "@remix-run/server-runtime": "2.1.0"
|
|
560
|
+
...
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
- Updated dependencies [[`b2a350a7`](https://github.com/Shopify/hydrogen/commit/b2a350a754ea2d29bc267c260dc298a02f8f4470), [`9b4f4534`](https://github.com/Shopify/hydrogen/commit/9b4f453407338874bd8f1a1f619b607670e021d0), [`74ea1dba`](https://github.com/Shopify/hydrogen/commit/74ea1dba9af37a146882df7ed9674be5659862b5), [`2be9ce82`](https://github.com/Shopify/hydrogen/commit/2be9ce82fd4a5121f1772bbb7349e96ed530e84e), [`a9b8bcde`](https://github.com/Shopify/hydrogen/commit/a9b8bcde96c22cedef7d87631d429199810b4a7a), [`bca112ed`](https://github.com/Shopify/hydrogen/commit/bca112ed7db49e533fe49898b663fa0dd318e6ba), [`848c6260`](https://github.com/Shopify/hydrogen/commit/848c6260a2db3a9cb0c86351f0f7128f61e028f0), [`d53b4ed7`](https://github.com/Shopify/hydrogen/commit/d53b4ed752eb0530622a666ea7dcf4b40239cafa), [`961fd8c6`](https://github.com/Shopify/hydrogen/commit/961fd8c630727784f77b9f693d2e8ff8601969fc), [`2bff9fc7`](https://github.com/Shopify/hydrogen/commit/2bff9fc75916fa95f9a9279d069408fb7a33755c), [`c8e8f6fd`](https://github.com/Shopify/hydrogen/commit/c8e8f6fd233e52cf5570b1904af710d6b907aae5), [`8fce70de`](https://github.com/Shopify/hydrogen/commit/8fce70de32bd61ee86a6d895ac43cc1f78f1bf49), [`f90e4d47`](https://github.com/Shopify/hydrogen/commit/f90e4d4713c6c1fc1e921a7ecd08e95fe5da1744), [`e8cc49fe`](https://github.com/Shopify/hydrogen/commit/e8cc49feff18f5ee72d5f6965ff2094addc23466)]:
|
|
565
|
+
- @shopify/cli-hydrogen@6.1.0
|
|
566
|
+
- @shopify/remix-oxygen@2.0.2
|
|
567
|
+
- @shopify/hydrogen@2023.10.3
|
|
568
|
+
|
|
569
|
+
## 1.0.0
|
|
570
|
+
|
|
571
|
+
### Major Changes
|
|
572
|
+
|
|
573
|
+
- The Storefront API 2023-10 now returns menu item URLs that include the `primaryDomainUrl`, instead of defaulting to the Shopify store ID URL (example.myshopify.com). The skeleton template requires changes to check for the `primaryDomainUrl`: by [@blittle](https://github.com/blittle)
|
|
574
|
+
|
|
575
|
+
1. Update the `HeaderMenu` component to accept a `primaryDomainUrl` and include
|
|
576
|
+
it in the internal url check
|
|
577
|
+
|
|
578
|
+
```diff
|
|
579
|
+
// app/components/Header.tsx
|
|
580
|
+
|
|
581
|
+
+ import type {HeaderQuery} from 'storefrontapi.generated';
|
|
582
|
+
|
|
583
|
+
export function HeaderMenu({
|
|
584
|
+
menu,
|
|
585
|
+
+ primaryDomainUrl,
|
|
586
|
+
viewport,
|
|
587
|
+
}: {
|
|
588
|
+
menu: HeaderProps['header']['menu'];
|
|
589
|
+
+ primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
|
|
590
|
+
viewport: Viewport;
|
|
591
|
+
}) {
|
|
592
|
+
|
|
593
|
+
// ...code
|
|
594
|
+
|
|
595
|
+
// if the url is internal, we strip the domain
|
|
596
|
+
const url =
|
|
597
|
+
item.url.includes('myshopify.com') ||
|
|
598
|
+
item.url.includes(publicStoreDomain) ||
|
|
599
|
+
+ item.url.includes(primaryDomainUrl)
|
|
600
|
+
? new URL(item.url).pathname
|
|
601
|
+
: item.url;
|
|
602
|
+
|
|
603
|
+
// ...code
|
|
604
|
+
|
|
605
|
+
}
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
2. Update the `FooterMenu` component to accept a `primaryDomainUrl` prop and include
|
|
609
|
+
it in the internal url check
|
|
610
|
+
|
|
611
|
+
```diff
|
|
612
|
+
// app/components/Footer.tsx
|
|
613
|
+
|
|
614
|
+
- import type {FooterQuery} from 'storefrontapi.generated';
|
|
615
|
+
+ import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated';
|
|
616
|
+
|
|
617
|
+
function FooterMenu({
|
|
618
|
+
menu,
|
|
619
|
+
+ primaryDomainUrl,
|
|
620
|
+
}: {
|
|
621
|
+
menu: FooterQuery['menu'];
|
|
622
|
+
+ primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
|
|
623
|
+
}) {
|
|
624
|
+
// code...
|
|
625
|
+
|
|
626
|
+
// if the url is internal, we strip the domain
|
|
627
|
+
const url =
|
|
628
|
+
item.url.includes('myshopify.com') ||
|
|
629
|
+
item.url.includes(publicStoreDomain) ||
|
|
630
|
+
+ item.url.includes(primaryDomainUrl)
|
|
631
|
+
? new URL(item.url).pathname
|
|
632
|
+
: item.url;
|
|
633
|
+
|
|
634
|
+
// ...code
|
|
635
|
+
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
3. Update the `Footer` component to accept a `shop` prop
|
|
641
|
+
|
|
642
|
+
```diff
|
|
643
|
+
export function Footer({
|
|
644
|
+
menu,
|
|
645
|
+
+ shop,
|
|
646
|
+
}: FooterQuery & {shop: HeaderQuery['shop']}) {
|
|
647
|
+
return (
|
|
648
|
+
<footer className="footer">
|
|
649
|
+
- <FooterMenu menu={menu} />
|
|
650
|
+
+ <FooterMenu menu={menu} primaryDomainUrl={shop.primaryDomain.url} />
|
|
651
|
+
</footer>
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
4. Update `Layout.tsx` to pass the `shop` prop
|
|
657
|
+
|
|
658
|
+
```diff
|
|
659
|
+
export function Layout({
|
|
660
|
+
cart,
|
|
661
|
+
children = null,
|
|
662
|
+
footer,
|
|
663
|
+
header,
|
|
664
|
+
isLoggedIn,
|
|
665
|
+
}: LayoutProps) {
|
|
666
|
+
return (
|
|
667
|
+
<>
|
|
668
|
+
<CartAside cart={cart} />
|
|
669
|
+
<SearchAside />
|
|
670
|
+
<MobileMenuAside menu={header.menu} shop={header.shop} />
|
|
671
|
+
<Header header={header} cart={cart} isLoggedIn={isLoggedIn} />
|
|
672
|
+
<main>{children}</main>
|
|
673
|
+
<Suspense>
|
|
674
|
+
<Await resolve={footer}>
|
|
675
|
+
- {(footer) => <Footer menu={footer.menu} />}
|
|
676
|
+
+ {(footer) => <Footer menu={footer.menu} shop={header.shop} />}
|
|
677
|
+
</Await>
|
|
678
|
+
</Suspense>
|
|
679
|
+
</>
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
### Patch Changes
|
|
685
|
+
|
|
686
|
+
- If you are calling `useMatches()` in different places of your app to access the data returned by the root loader, you may want to update it to the following pattern to enhance types: ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox)
|
|
687
|
+
|
|
688
|
+
```ts
|
|
689
|
+
// root.tsx
|
|
690
|
+
|
|
691
|
+
import {useMatches} from '@remix-run/react';
|
|
692
|
+
import {type SerializeFrom} from '@shopify/remix-oxygen';
|
|
693
|
+
|
|
694
|
+
export const useRootLoaderData = () => {
|
|
695
|
+
const [root] = useMatches();
|
|
696
|
+
return root?.data as SerializeFrom<typeof loader>;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
export function loader(context) {
|
|
700
|
+
// ...
|
|
701
|
+
}
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
This way, you can import `useRootLoaderData()` anywhere in your app and get the correct type for the data returned by the root loader.
|
|
705
|
+
|
|
706
|
+
- Updated dependencies [[`81400439`](https://github.com/Shopify/hydrogen/commit/814004397c1d17ef0a53a425ed28a42cf67765cf), [`a6f397b6`](https://github.com/Shopify/hydrogen/commit/a6f397b64dc6a0d856cb7961731ee1f86bf80292), [`3464ec04`](https://github.com/Shopify/hydrogen/commit/3464ec04a084e1ceb30ee19874dc1b9171ce2b34), [`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`867e0b03`](https://github.com/Shopify/hydrogen/commit/867e0b033fc9eb04b7250baea97d8fd49d26ccca), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`f24e3424`](https://github.com/Shopify/hydrogen/commit/f24e3424c8e2b363b181b71fcbd3e45f696fdd3f), [`66a48573`](https://github.com/Shopify/hydrogen/commit/66a4857387148b6a104df5783314c74aca8aada0), [`0ae7cbe2`](https://github.com/Shopify/hydrogen/commit/0ae7cbe280d8351126e11dc13f35d7277d9b2d86), [`8198c1be`](https://github.com/Shopify/hydrogen/commit/8198c1befdfafb39fbcc88d71f91d21eae252973), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3)]:
|
|
707
|
+
- @shopify/hydrogen@2023.10.0
|
|
708
|
+
- @shopify/remix-oxygen@2.0.0
|
|
709
|
+
- @shopify/cli-hydrogen@6.0.0
|