From 37ec3bd1be30ba0612fec4438f92c46015fc7efb Mon Sep 17 00:00:00 2001 From: "shopify-github-actions-access[bot]" <109624739+shopify-github-actions-access[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:32:50 +0200 Subject: [PATCH] [ci] release 2024-07 (#2378) Co-authored-by: github-actions[bot] --- .changeset/calm-schools-speak.md | 5 - .changeset/eleven-wasps-mix.md | 5 - .changeset/flat-melons-design.md | 5 - .changeset/friendly-cheetahs-teach.md | 5 - .changeset/healthy-rats-confess.md | 112 ------------------ .changeset/kind-kids-chew.md | 6 - .changeset/lazy-seas-draw.md | 5 - .changeset/light-boxes-smile.md | 5 - .changeset/nice-dragons-cry.md | 5 - .changeset/quiet-falcons-draw.md | 5 - .changeset/rich-falcons-remain.md | 24 ---- .changeset/sharp-planes-judge.md | 7 -- .changeset/small-trees-juggle.md | 5 - .changeset/sour-flowers-do.md | 5 - .changeset/tiny-gorillas-thank.md | 5 - .changeset/witty-planes-tickle.md | 21 ---- examples/express/package.json | 2 +- packages/cli/CHANGELOG.md | 14 +++ packages/cli/oclif.manifest.json | 2 +- packages/cli/package.json | 2 +- packages/create-hydrogen/CHANGELOG.md | 23 ++++ packages/create-hydrogen/package.json | 2 +- packages/hydrogen-react/CHANGELOG.md | 8 ++ packages/hydrogen-react/package.json | 2 +- packages/hydrogen/CHANGELOG.md | 19 ++++ packages/hydrogen/package.json | 4 +- packages/hydrogen/src/version.ts | 2 +- packages/remix-oxygen/CHANGELOG.md | 6 + packages/remix-oxygen/package.json | 2 +- templates/skeleton/CHANGELOG.md | 158 ++++++++++++++++++++++++++ templates/skeleton/package.json | 6 +- 31 files changed, 240 insertions(+), 237 deletions(-) delete mode 100644 .changeset/calm-schools-speak.md delete mode 100644 .changeset/eleven-wasps-mix.md delete mode 100644 .changeset/flat-melons-design.md delete mode 100644 .changeset/friendly-cheetahs-teach.md delete mode 100644 .changeset/healthy-rats-confess.md delete mode 100644 .changeset/kind-kids-chew.md delete mode 100644 .changeset/lazy-seas-draw.md delete mode 100644 .changeset/light-boxes-smile.md delete mode 100644 .changeset/nice-dragons-cry.md delete mode 100644 .changeset/quiet-falcons-draw.md delete mode 100644 .changeset/rich-falcons-remain.md delete mode 100644 .changeset/sharp-planes-judge.md delete mode 100644 .changeset/small-trees-juggle.md delete mode 100644 .changeset/sour-flowers-do.md delete mode 100644 .changeset/tiny-gorillas-thank.md delete mode 100644 .changeset/witty-planes-tickle.md diff --git a/.changeset/calm-schools-speak.md b/.changeset/calm-schools-speak.md deleted file mode 100644 index f40c4bb8ae..0000000000 --- a/.changeset/calm-schools-speak.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'skeleton': patch ---- - -Search & Predictive Search improvements diff --git a/.changeset/eleven-wasps-mix.md b/.changeset/eleven-wasps-mix.md deleted file mode 100644 index f3a301d22f..0000000000 --- a/.changeset/eleven-wasps-mix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Improve performance of currency formatting diff --git a/.changeset/flat-melons-design.md b/.changeset/flat-melons-design.md deleted file mode 100644 index c16145b26b..0000000000 --- a/.changeset/flat-melons-design.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Allow passing `customLogger` in `vite.config.js`. diff --git a/.changeset/friendly-cheetahs-teach.md b/.changeset/friendly-cheetahs-teach.md deleted file mode 100644 index a24fdf015b..0000000000 --- a/.changeset/friendly-cheetahs-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Ignore `remix.config.js` file when `vite.config.js` is present, and warn about it. diff --git a/.changeset/healthy-rats-confess.md b/.changeset/healthy-rats-confess.md deleted file mode 100644 index b4566fa7c6..0000000000 --- a/.changeset/healthy-rats-confess.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -'skeleton': patch ---- - -1. Create a app/lib/context file and use `createHydrogenContext` in it. - -```.ts -// in app/lib/context - -import {createHydrogenContext} from '@shopify/hydrogen'; - -export async function createAppLoadContext( - request: Request, - env: Env, - executionContext: ExecutionContext, -) { - const hydrogenContext = createHydrogenContext({ - env, - request, - cache, - waitUntil, - session, - i18n: {language: 'EN', country: 'US'}, - cart: { - queryFragment: CART_QUERY_FRAGMENT, - }, - // ensure to overwrite any options that is not using the default values from your server.ts - }); - - return { - ...hydrogenContext, - // declare additional Remix loader context - }; -} - -``` - -2. Use `createAppLoadContext` method in server.ts Ensure to overwrite any options that is not using the default values in `createHydrogenContext`. - -```diff -// in server.ts - -- import { -- createCartHandler, -- createStorefrontClient, -- createCustomerAccountClient, -- } from '@shopify/hydrogen'; -+ import {createAppLoadContext} from '~/lib/context'; - -export default { - async fetch( - request: Request, - env: Env, - executionContext: ExecutionContext, - ): Promise { - -- const {storefront} = createStorefrontClient( -- ... -- ); - -- const customerAccount = createCustomerAccountClient( -- ... -- ); - -- const cart = createCartHandler( -- ... -- ); - -+ const appLoadContext = await createAppLoadContext( -+ request, -+ env, -+ executionContext, -+ ); - - /** - * Create a Remix request handler and pass - * Hydrogen's Storefront client to the loader context. - */ - const handleRequest = createRequestHandler({ - build: remixBuild, - mode: process.env.NODE_ENV, -- getLoadContext: (): AppLoadContext => ({ -- session, -- storefront, -- customerAccount, -- cart, -- env, -- waitUntil, -- }), -+ getLoadContext: () => appLoadContext, - }); - } -``` - -3. Use infer type for AppLoadContext in env.d.ts - -```diff -// in env.d.ts - -+ import type {createAppLoadContext} from '~/lib/context'; - -+ interface AppLoadContext extends Awaited> { -- interface AppLoadContext { -- env: Env; -- cart: HydrogenCart; -- storefront: Storefront; -- customerAccount: CustomerAccount; -- session: AppSession; -- waitUntil: ExecutionContext['waitUntil']; -} - -``` diff --git a/.changeset/kind-kids-chew.md b/.changeset/kind-kids-chew.md deleted file mode 100644 index ceac9b1196..0000000000 --- a/.changeset/kind-kids-chew.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -Prevent sending analytics data to Shopify when Chrome-Lighthouse user agent is detected diff --git a/.changeset/lazy-seas-draw.md b/.changeset/lazy-seas-draw.md deleted file mode 100644 index 609880fa87..0000000000 --- a/.changeset/lazy-seas-draw.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Support `--env-file` in env:pull, dev, and preview commands to specify custom `.env` files. diff --git a/.changeset/light-boxes-smile.md b/.changeset/light-boxes-smile.md deleted file mode 100644 index a76c9b09a8..0000000000 --- a/.changeset/light-boxes-smile.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Create `createHydrogenContext` that combined `createStorefrontClient`, `createCustomerAccountClient` and `createCartHandler`. diff --git a/.changeset/nice-dragons-cry.md b/.changeset/nice-dragons-cry.md deleted file mode 100644 index a247d62c77..0000000000 --- a/.changeset/nice-dragons-cry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/remix-oxygen': patch ---- - -Return a 400 BadRequest for HEAD and GET requests that include a body diff --git a/.changeset/quiet-falcons-draw.md b/.changeset/quiet-falcons-draw.md deleted file mode 100644 index 7213995ea3..0000000000 --- a/.changeset/quiet-falcons-draw.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/create-hydrogen': patch ---- - -starter template updated diff --git a/.changeset/rich-falcons-remain.md b/.changeset/rich-falcons-remain.md deleted file mode 100644 index c11c4e56e8..0000000000 --- a/.changeset/rich-falcons-remain.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -'skeleton': patch ---- - -Use type `HydrogenEnv` for all the env.d.ts - -```diff -// in env.d.ts - -+ import type {HydrogenEnv} from '@shopify/hydrogen'; - -+ interface Env extends HydrogenEnv {} -- interface Env { -- SESSION_SECRET: string; -- PUBLIC_STOREFRONT_API_TOKEN: string; -- PRIVATE_STOREFRONT_API_TOKEN: string; -- PUBLIC_STORE_DOMAIN: string; -- PUBLIC_STOREFRONT_ID: string; -- PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID: string; -- PUBLIC_CUSTOMER_ACCOUNT_API_URL: string; -- PUBLIC_CHECKOUT_DOMAIN: string; -- } - -``` diff --git a/.changeset/sharp-planes-judge.md b/.changeset/sharp-planes-judge.md deleted file mode 100644 index 7c165d94af..0000000000 --- a/.changeset/sharp-planes-judge.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Add a `waitForHydration` prop to the `Script` component to delay loading until after hydration. This fixes third-party scripts that modify the DOM and cause hydration errors. - -Note: For security, `nonce` is not supported when using `waitForHydration`. Instead you need to add the domain of the script directly to your [Content Securitiy Policy directives](https://shopify.dev/docs/storefronts/headless/hydrogen/content-security-policy#step-3-customize-the-content-security-policy). diff --git a/.changeset/small-trees-juggle.md b/.changeset/small-trees-juggle.md deleted file mode 100644 index 91d4c33329..0000000000 --- a/.changeset/small-trees-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Support special versions like `next` or `experimental` in CLI. diff --git a/.changeset/sour-flowers-do.md b/.changeset/sour-flowers-do.md deleted file mode 100644 index 964fdce648..0000000000 --- a/.changeset/sour-flowers-do.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix the `OptimisticCart` type to properly retain the generic of line items. The `OptimisticCartLine` type now takes a cart or cart line item generic. diff --git a/.changeset/tiny-gorillas-thank.md b/.changeset/tiny-gorillas-thank.md deleted file mode 100644 index 0503ffc406..0000000000 --- a/.changeset/tiny-gorillas-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Export `ShopAnalytics` type diff --git a/.changeset/witty-planes-tickle.md b/.changeset/witty-planes-tickle.md deleted file mode 100644 index be55e71ef2..0000000000 --- a/.changeset/witty-planes-tickle.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'skeleton': patch -'@shopify/create-hydrogen': patch ---- - -Add a hydration check for google web cache. This prevents an infinite redirect when viewing the cached version of a hydrogen site on Google. - -Update your entry.server.jsx file to include this check: - -```diff -+ if (!window.location.origin.includes("webcache.googleusercontent.com")) { - startTransition(() => { - hydrateRoot( - document, - - - - ); - }); -+ } -``` diff --git a/examples/express/package.json b/examples/express/package.json index 497f54dc34..d1bef68c32 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -14,7 +14,7 @@ "@remix-run/node": "^2.10.1", "@remix-run/react": "^2.10.1", "@remix-run/server-runtime": "^2.10.1", - "@shopify/hydrogen": "2024.7.2", + "@shopify/hydrogen": "2024.7.3", "compression": "^1.7.4", "cross-env": "^7.0.3", "express": "^4.19.2", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 9b56a1512f..071f2b0ed7 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,19 @@ # @shopify/cli-hydrogen +## 8.4.0 + +### Minor Changes + +- Support `--env-file` in env:pull, dev, and preview commands to specify custom `.env` files. ([#2392](https://github.com/Shopify/hydrogen/pull/2392)) by [@frandiox](https://github.com/frandiox) + +### Patch Changes + +- Allow passing `customLogger` in `vite.config.js`. ([#2341](https://github.com/Shopify/hydrogen/pull/2341)) by [@frandiox](https://github.com/frandiox) + +- Ignore `remix.config.js` file when `vite.config.js` is present, and warn about it. ([#2379](https://github.com/Shopify/hydrogen/pull/2379)) by [@frandiox](https://github.com/frandiox) + +- Support special versions like `next` or `experimental` in CLI. ([#2417](https://github.com/Shopify/hydrogen/pull/2417)) by [@frandiox](https://github.com/frandiox) + ## 8.3.0 ### Minor Changes diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index 019c3804ff..d1213f0e3d 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1751,5 +1751,5 @@ ] } }, - "version": "8.3.0" + "version": "8.4.0" } \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index 6cc48d619d..d2e6dd3866 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "8.3.0", + "version": "8.4.0", "license": "MIT", "type": "module", "scripts": { diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md index 1afece1aaf..196cecb082 100644 --- a/packages/create-hydrogen/CHANGELOG.md +++ b/packages/create-hydrogen/CHANGELOG.md @@ -1,5 +1,28 @@ # @shopify/create-hydrogen +## 5.0.3 + +### Patch Changes + +- starter template updated ([#2333](https://github.com/Shopify/hydrogen/pull/2333)) by [@michenly](https://github.com/michenly) + +- Add a hydration check for google web cache. This prevents an infinite redirect when viewing the cached version of a hydrogen site on Google. ([#2334](https://github.com/Shopify/hydrogen/pull/2334)) by [@blittle](https://github.com/blittle) + + Update your entry.server.jsx file to include this check: + + ```diff + + if (!window.location.origin.includes("webcache.googleusercontent.com")) { + startTransition(() => { + hydrateRoot( + document, + + + + ); + }); + + } + ``` + ## 5.0.2 ### Patch Changes diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json index 8306577673..d8530d9d0c 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.2", + "version": "5.0.3", "type": "module", "scripts": { "build": "tsup --clean", diff --git a/packages/hydrogen-react/CHANGELOG.md b/packages/hydrogen-react/CHANGELOG.md index 17ec4b37d4..657419ee5d 100644 --- a/packages/hydrogen-react/CHANGELOG.md +++ b/packages/hydrogen-react/CHANGELOG.md @@ -1,5 +1,13 @@ # @shopify/hydrogen-react +## 2024.7.2 + +### Patch Changes + +- Improve performance of currency formatting ([#2372](https://github.com/Shopify/hydrogen/pull/2372)) by [@blittle](https://github.com/blittle) + +- Prevent sending analytics data to Shopify when Chrome-Lighthouse user agent is detected ([#2401](https://github.com/Shopify/hydrogen/pull/2401)) by [@wizardlyhel](https://github.com/wizardlyhel) + ## 2024.7.1 ### Patch Changes diff --git a/packages/hydrogen-react/package.json b/packages/hydrogen-react/package.json index 4c0aaeb13d..9d3e2b72fb 100644 --- a/packages/hydrogen-react/package.json +++ b/packages/hydrogen-react/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/hydrogen-react", - "version": "2024.7.1", + "version": "2024.7.2", "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 0e675b9fca..5433721ea1 100644 --- a/packages/hydrogen/CHANGELOG.md +++ b/packages/hydrogen/CHANGELOG.md @@ -1,5 +1,24 @@ # @shopify/hydrogen +## 2024.7.3 + +### Patch Changes + +- Prevent sending analytics data to Shopify when Chrome-Lighthouse user agent is detected ([#2401](https://github.com/Shopify/hydrogen/pull/2401)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Create `createHydrogenContext` that combined `createStorefrontClient`, `createCustomerAccountClient` and `createCartHandler`. ([#2333](https://github.com/Shopify/hydrogen/pull/2333)) by [@michenly](https://github.com/michenly) + +- Add a `waitForHydration` prop to the `Script` component to delay loading until after hydration. This fixes third-party scripts that modify the DOM and cause hydration errors. ([#2389](https://github.com/Shopify/hydrogen/pull/2389)) by [@blittle](https://github.com/blittle) + + Note: For security, `nonce` is not supported when using `waitForHydration`. Instead you need to add the domain of the script directly to your [Content Securitiy Policy directives](https://shopify.dev/docs/storefronts/headless/hydrogen/content-security-policy#step-3-customize-the-content-security-policy). + +- Fix the `OptimisticCart` type to properly retain the generic of line items. The `OptimisticCartLine` type now takes a cart or cart line item generic. ([#2327](https://github.com/Shopify/hydrogen/pull/2327)) by [@blittle](https://github.com/blittle) + +- Export `ShopAnalytics` type ([#2384](https://github.com/Shopify/hydrogen/pull/2384)) by [@Braedencraig](https://github.com/Braedencraig) + +- Updated dependencies [[`cfbfc827`](https://github.com/Shopify/hydrogen/commit/cfbfc827e40e7425cf213a099eafb7a581b2885f), [`b09e9a4c`](https://github.com/Shopify/hydrogen/commit/b09e9a4ca7b931e48462c2d174ca9f67c37f1da2)]: + - @shopify/hydrogen-react@2024.7.2 + ## 2024.7.2 ### Patch Changes diff --git a/packages/hydrogen/package.json b/packages/hydrogen/package.json index 80904b49a3..92ca904944 100644 --- a/packages/hydrogen/package.json +++ b/packages/hydrogen/package.json @@ -5,7 +5,7 @@ "@shopify:registry": "https://registry.npmjs.org" }, "type": "module", - "version": "2024.7.2", + "version": "2024.7.3", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", @@ -63,7 +63,7 @@ "dist" ], "dependencies": { - "@shopify/hydrogen-react": "2024.7.1", + "@shopify/hydrogen-react": "2024.7.2", "content-security-policy-builder": "^2.2.0", "source-map-support": "^0.5.21", "type-fest": "^4.5.0", diff --git a/packages/hydrogen/src/version.ts b/packages/hydrogen/src/version.ts index dd61a8805f..04294668da 100644 --- a/packages/hydrogen/src/version.ts +++ b/packages/hydrogen/src/version.ts @@ -1 +1 @@ -export const LIB_VERSION = '2024.7.2'; +export const LIB_VERSION = '2024.7.3'; diff --git a/packages/remix-oxygen/CHANGELOG.md b/packages/remix-oxygen/CHANGELOG.md index 28d3d3550a..49fb08edd3 100644 --- a/packages/remix-oxygen/CHANGELOG.md +++ b/packages/remix-oxygen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/remix-oxygen +## 2.0.6 + +### Patch Changes + +- Return a 400 BadRequest for HEAD and GET requests that include a body ([#2360](https://github.com/Shopify/hydrogen/pull/2360)) by [@blittle](https://github.com/blittle) + ## 2.0.5 ### Patch Changes diff --git a/packages/remix-oxygen/package.json b/packages/remix-oxygen/package.json index 1a969d6f9d..96137689a9 100644 --- a/packages/remix-oxygen/package.json +++ b/packages/remix-oxygen/package.json @@ -5,7 +5,7 @@ "@shopify:registry": "https://registry.npmjs.org" }, "type": "module", - "version": "2.0.5", + "version": "2.0.6", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", diff --git a/templates/skeleton/CHANGELOG.md b/templates/skeleton/CHANGELOG.md index 54a548e97c..54020793a3 100644 --- a/templates/skeleton/CHANGELOG.md +++ b/templates/skeleton/CHANGELOG.md @@ -1,5 +1,163 @@ # skeleton +## 2024.7.4 + +### Patch Changes + +- Search & Predictive Search improvements ([#2363](https://github.com/Shopify/hydrogen/pull/2363)) by [@juanpprieto](https://github.com/juanpprieto) + +- 1. Create a app/lib/context file and use `createHydrogenContext` in it. ([#2333](https://github.com/Shopify/hydrogen/pull/2333)) by [@michenly](https://github.com/michenly) + + ```.ts + // in app/lib/context + + import {createHydrogenContext} from '@shopify/hydrogen'; + + export async function createAppLoadContext( + request: Request, + env: Env, + executionContext: ExecutionContext, + ) { + const hydrogenContext = createHydrogenContext({ + env, + request, + cache, + waitUntil, + session, + i18n: {language: 'EN', country: 'US'}, + cart: { + queryFragment: CART_QUERY_FRAGMENT, + }, + // ensure to overwrite any options that is not using the default values from your server.ts + }); + + return { + ...hydrogenContext, + // declare additional Remix loader context + }; + } + + ``` + + 2. Use `createAppLoadContext` method in server.ts Ensure to overwrite any options that is not using the default values in `createHydrogenContext`. + + ```diff + // in server.ts + + - import { + - createCartHandler, + - createStorefrontClient, + - createCustomerAccountClient, + - } from '@shopify/hydrogen'; + + import {createAppLoadContext} from '~/lib/context'; + + export default { + async fetch( + request: Request, + env: Env, + executionContext: ExecutionContext, + ): Promise { + + - const {storefront} = createStorefrontClient( + - ... + - ); + + - const customerAccount = createCustomerAccountClient( + - ... + - ); + + - const cart = createCartHandler( + - ... + - ); + + + const appLoadContext = await createAppLoadContext( + + request, + + env, + + executionContext, + + ); + + /** + * Create a Remix request handler and pass + * Hydrogen's Storefront client to the loader context. + */ + const handleRequest = createRequestHandler({ + build: remixBuild, + mode: process.env.NODE_ENV, + - getLoadContext: (): AppLoadContext => ({ + - session, + - storefront, + - customerAccount, + - cart, + - env, + - waitUntil, + - }), + + getLoadContext: () => appLoadContext, + }); + } + ``` + + 3. Use infer type for AppLoadContext in env.d.ts + + ```diff + // in env.d.ts + + + import type {createAppLoadContext} from '~/lib/context'; + + + interface AppLoadContext extends Awaited> { + - interface AppLoadContext { + - env: Env; + - cart: HydrogenCart; + - storefront: Storefront; + - customerAccount: CustomerAccount; + - session: AppSession; + - waitUntil: ExecutionContext['waitUntil']; + } + + ``` + +- Use type `HydrogenEnv` for all the env.d.ts ([#2333](https://github.com/Shopify/hydrogen/pull/2333)) by [@michenly](https://github.com/michenly) + + ```diff + // in env.d.ts + + + import type {HydrogenEnv} from '@shopify/hydrogen'; + + + interface Env extends HydrogenEnv {} + - interface Env { + - SESSION_SECRET: string; + - PUBLIC_STOREFRONT_API_TOKEN: string; + - PRIVATE_STOREFRONT_API_TOKEN: string; + - PUBLIC_STORE_DOMAIN: string; + - PUBLIC_STOREFRONT_ID: string; + - PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID: string; + - PUBLIC_CUSTOMER_ACCOUNT_API_URL: string; + - PUBLIC_CHECKOUT_DOMAIN: string; + - } + + ``` + +- Add a hydration check for google web cache. This prevents an infinite redirect when viewing the cached version of a hydrogen site on Google. ([#2334](https://github.com/Shopify/hydrogen/pull/2334)) by [@blittle](https://github.com/blittle) + + Update your entry.server.jsx file to include this check: + + ```diff + + if (!window.location.origin.includes("webcache.googleusercontent.com")) { + startTransition(() => { + hydrateRoot( + document, + + + + ); + }); + + } + ``` + +- Updated dependencies [[`a2d9acf9`](https://github.com/Shopify/hydrogen/commit/a2d9acf95e019c39df0b10f4841a1d809b810c80), [`c0d7d917`](https://github.com/Shopify/hydrogen/commit/c0d7d9176c80b996064d8e897876f954807c7640), [`b09e9a4c`](https://github.com/Shopify/hydrogen/commit/b09e9a4ca7b931e48462c2d174ca9f67c37f1da2), [`c204eacf`](https://github.com/Shopify/hydrogen/commit/c204eacf0273f625109523ee81053cdc0c4de7e1), [`bf4e3d3c`](https://github.com/Shopify/hydrogen/commit/bf4e3d3c00744a066b50250a12e4f3c675691811), [`20a8e63b`](https://github.com/Shopify/hydrogen/commit/20a8e63b5fd1c8acadda7612c5d4cc411e0c5932), [`6e5d8ea7`](https://github.com/Shopify/hydrogen/commit/6e5d8ea71a2639925d5817b662af26a6b2ba3c6d), [`7c4f67a6`](https://github.com/Shopify/hydrogen/commit/7c4f67a684ad31edea10d1407d00201bbaaa9822), [`dfb9be77`](https://github.com/Shopify/hydrogen/commit/dfb9be7721c7d10cf4354fda60db4e666625518e), [`31ea19e8`](https://github.com/Shopify/hydrogen/commit/31ea19e8957dbc4487314b014a14920444d37f78)]: + - @shopify/cli-hydrogen@8.4.0 + - @shopify/hydrogen@2024.7.3 + - @shopify/remix-oxygen@2.0.6 + ## 2024.7.3 ### Patch Changes diff --git a/templates/skeleton/package.json b/templates/skeleton/package.json index 829dffa0b4..9edba9ac4f 100644 --- a/templates/skeleton/package.json +++ b/templates/skeleton/package.json @@ -2,7 +2,7 @@ "name": "skeleton", "private": true, "sideEffects": false, - "version": "2024.7.3", + "version": "2024.7.4", "type": "module", "scripts": { "build": "shopify hydrogen build --codegen", @@ -17,8 +17,8 @@ "@remix-run/react": "^2.10.1", "@remix-run/server-runtime": "^2.10.1", "@shopify/cli-hydrogen": "*", - "@shopify/hydrogen": "2024.7.2", - "@shopify/remix-oxygen": "^2.0.5", + "@shopify/hydrogen": "2024.7.3", + "@shopify/remix-oxygen": "^2.0.6", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.8.0",