- ));
-}
-```
-
-The problem with this code is that it can feel slow. If a new item is added to the cart, it won't render until the server action completes and the client revalidates the root loader with the new cart data.
-
-If we update the cart implementation with a new `useOptimisticCart()` hook, Hydrogen can take the pending add to cart action, and apply it locally with the existing cart data:
-
-```tsx
-export function Cart({cart}) {
- const optimisticCart = useOptimisticCart(cart);
-
- if (!optimisticCart?.lines?.nodes?.length) return
- ));
-}
-```
-
-This works automatically with the `CartForm.ACTIONS.LinesUpdate` and `CartForm.ACTIONS.LinesRemove`. To make it work with `CartForm.Actions.LinesAdd`, update the `CartForm` to include the `selectedVariant`:
-
-```tsx
-export function ProductCard({product}) {
- return (
-
-
{product.title}
-
-
-
-
- );
-}
-```
-
-Sometimes line items need to render differently when they have yet to process on the server. A new isOptimistic flag is added to each line item:
-
-```tsx
-export function Cart({cart}) {
- const optimisticCart = useOptimisticCart(cart);
-
- if (!cart?.lines?.nodes?.length) return
- ));
-}
-```
diff --git a/.changeset/curly-olives-dream.md b/.changeset/curly-olives-dream.md
deleted file mode 100644
index 4faf853984..0000000000
--- a/.changeset/curly-olives-dream.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'skeleton': patch
-'@shopify/cli-hydrogen': patch
-'@shopify/create-hydrogen': patch
----
-
-Update remix to v2.9.2
diff --git a/.changeset/flat-camels-dress.md b/.changeset/flat-camels-dress.md
deleted file mode 100644
index 12f5bf81eb..0000000000
--- a/.changeset/flat-camels-dress.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen': patch
----
-
-Adds type support for the script-src-elem directive for CSPs
diff --git a/.changeset/gorgeous-ghosts-yawn.md b/.changeset/gorgeous-ghosts-yawn.md
deleted file mode 100644
index 52ad63de82..0000000000
--- a/.changeset/gorgeous-ghosts-yawn.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen-react': patch
----
-
-Fix shopify cookie domain setting
diff --git a/.changeset/honest-penguins-guess.md b/.changeset/honest-penguins-guess.md
deleted file mode 100644
index 6e6abfa0a9..0000000000
--- a/.changeset/honest-penguins-guess.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/cli-hydrogen': patch
----
-
-The CLI now tries to add optimizable dependencies to Vite's ssr.optimizeDeps.include automatically.
diff --git a/.changeset/large-rivers-fold.md b/.changeset/large-rivers-fold.md
deleted file mode 100644
index 789023601b..0000000000
--- a/.changeset/large-rivers-fold.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen': patch
----
-
-Fix `storefrontRedirect` to strip trailing slashes when querying for redirects. Resolves [#2090](https://github.com/Shopify/hydrogen/issues/2090)
diff --git a/.changeset/long-candles-cover.md b/.changeset/long-candles-cover.md
deleted file mode 100644
index 45b0c50d6c..0000000000
--- a/.changeset/long-candles-cover.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-'@shopify/hydrogen-react': patch
----
-
-Add a RichText component to easily render \`rich_text_field\` metafields. Thank you @bastienrobert for the original implementation. Example usage:
-
-```tsx
-import {RichText} from '@shopify/hydrogen-react';
-
-export function MainRichText({metaFieldData}: {metaFieldData: string}) {
- return (
- {node.children}
;
- },
- }}
- />
- );
-}
-```
diff --git a/.changeset/long-emus-cry.md b/.changeset/long-emus-cry.md
deleted file mode 100644
index 7f6416f831..0000000000
--- a/.changeset/long-emus-cry.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/cli-hydrogen': patch
----
-
-Fix Hydrogen upgrade notification when running the dev command.
diff --git a/.changeset/purple-carrots-melt.md b/.changeset/purple-carrots-melt.md
deleted file mode 100644
index 7299ea4d47..0000000000
--- a/.changeset/purple-carrots-melt.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/mini-oxygen': patch
----
-
-Update server in development when entry point (`/server.js`) changes.
diff --git a/.changeset/quick-beers-sing.md b/.changeset/quick-beers-sing.md
deleted file mode 100644
index 6f427cdfb0..0000000000
--- a/.changeset/quick-beers-sing.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen': patch
----
-
-Ignore `/favicon.ico` route in Subrequest Profiler.
diff --git a/.changeset/red-grapes-change.md b/.changeset/red-grapes-change.md
deleted file mode 100644
index 317f8852ef..0000000000
--- a/.changeset/red-grapes-change.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/cli-hydrogen': patch
----
-
-Hide non actionable warning about ts-node.
diff --git a/.changeset/slow-colts-chew.md b/.changeset/slow-colts-chew.md
deleted file mode 100644
index 24b7124f16..0000000000
--- a/.changeset/slow-colts-chew.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/cli-hydrogen': minor
----
-
-Support Vite projects in `h2 debug cpu` command.
diff --git a/.changeset/strong-buckets-occur.md b/.changeset/strong-buckets-occur.md
deleted file mode 100644
index 87315464c4..0000000000
--- a/.changeset/strong-buckets-occur.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@shopify/mini-oxygen': patch
-'@shopify/hydrogen': patch
----
-
-Improve errors when a CJS dependency needs to be added to Vite's ssr.optimizeDeps.include.
diff --git a/.changeset/thin-hairs-travel.md b/.changeset/thin-hairs-travel.md
deleted file mode 100644
index 5c4f954a4f..0000000000
--- a/.changeset/thin-hairs-travel.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'skeleton': patch
-'@shopify/hydrogen': patch
-'@shopify/cli-hydrogen': patch
----
-
-`` and `useAnalytics` are now stable.
diff --git a/.changeset/tiny-pans-help.md b/.changeset/tiny-pans-help.md
deleted file mode 100644
index 90d4254dba..0000000000
--- a/.changeset/tiny-pans-help.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@shopify/cli-hydrogen': minor
----
-
-The `h2 preview` command now supports `--build` and `--watch` flags to preview the project using the build process instead of Vite's dev process.
-
\ No newline at end of file
diff --git a/.changeset/two-trees-hammer.md b/.changeset/two-trees-hammer.md
deleted file mode 100644
index e94bf77695..0000000000
--- a/.changeset/two-trees-hammer.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen': patch
----
-
-Improve VariantSelector to return variant object in option values. Thank you @NabeelAhmed1721
diff --git a/.changeset/unlucky-students-tan.md b/.changeset/unlucky-students-tan.md
deleted file mode 100644
index a99c009cad..0000000000
--- a/.changeset/unlucky-students-tan.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen': patch
----
-
-Fix: Use exiting `id_token` during Customer Account API token refresh because it does not get return in the API.
\ No newline at end of file
diff --git a/.changeset/weak-rabbits-rest.md b/.changeset/weak-rabbits-rest.md
deleted file mode 100644
index 84bf52ddcf..0000000000
--- a/.changeset/weak-rabbits-rest.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/cli-hydrogen': patch
----
-
-Updated internal CLI dependencies to `3.60.0`.
diff --git a/.changeset/witty-camels-type.md b/.changeset/witty-camels-type.md
deleted file mode 100644
index 0ae646384c..0000000000
--- a/.changeset/witty-camels-type.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'skeleton': patch
----
-
-Update the skeleton template to use React state in the aside dialogs
diff --git a/.changeset/young-dolls-punch.md b/.changeset/young-dolls-punch.md
deleted file mode 100644
index aa9229bebb..0000000000
--- a/.changeset/young-dolls-punch.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@shopify/hydrogen': patch
----
-
-Fix optimizing deps when using PNPM.
diff --git a/examples/express/package.json b/examples/express/package.json
index e0e53eabc3..f4ce299c07 100644
--- a/examples/express/package.json
+++ b/examples/express/package.json
@@ -17,8 +17,8 @@
"@remix-run/react": "^2.9.2",
"@remix-run/server-runtime": "^2.9.2",
"@shopify/cli": "3.60.0",
- "@shopify/cli-hydrogen": "^8.0.4",
- "@shopify/hydrogen": "2024.4.2",
+ "@shopify/cli-hydrogen": "^8.1.0",
+ "@shopify/hydrogen": "2024.4.3",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"express": "^4.19.2",
diff --git a/examples/multipass/package.json b/examples/multipass/package.json
index 92661fa899..e6e3c5ac00 100644
--- a/examples/multipass/package.json
+++ b/examples/multipass/package.json
@@ -14,8 +14,8 @@
"dependencies": {
"@remix-run/react": "^2.9.2",
"@shopify/cli": "3.60.0",
- "@shopify/cli-hydrogen": "^8.0.4",
- "@shopify/hydrogen": "2024.4.2",
+ "@shopify/cli-hydrogen": "^8.1.0",
+ "@shopify/hydrogen": "2024.4.3",
"@shopify/remix-oxygen": "^2.0.4",
"crypto-js": "^4.2.0",
"graphql": "^16.6.0",
@@ -28,7 +28,7 @@
"devDependencies": {
"@remix-run/dev": "^2.9.2",
"@remix-run/eslint-config": "^2.9.2",
- "@shopify/mini-oxygen": "^3.0.2",
+ "@shopify/mini-oxygen": "^3.0.3",
"@shopify/oxygen-workers-types": "^4.0.0",
"@shopify/prettier-config": "^1.1.2",
"@total-typescript/ts-reset": "^0.4.2",
diff --git a/examples/partytown/package.json b/examples/partytown/package.json
index f45f71a072..3daaf5f530 100644
--- a/examples/partytown/package.json
+++ b/examples/partytown/package.json
@@ -17,8 +17,8 @@
"@builder.io/partytown": "^0.8.1",
"@remix-run/react": "^2.9.2",
"@shopify/cli": "3.60.0",
- "@shopify/cli-hydrogen": "^8.0.4",
- "@shopify/hydrogen": "2024.4.2",
+ "@shopify/cli-hydrogen": "^8.1.0",
+ "@shopify/hydrogen": "2024.4.3",
"@shopify/remix-oxygen": "^2.0.4",
"graphql": "^16.6.0",
"graphql-tag": "^2.12.6",
@@ -29,7 +29,7 @@
"devDependencies": {
"@remix-run/dev": "^2.9.2",
"@remix-run/eslint-config": "^2.9.2",
- "@shopify/mini-oxygen": "^3.0.2",
+ "@shopify/mini-oxygen": "^3.0.3",
"@shopify/oxygen-workers-types": "^4.0.0",
"@shopify/prettier-config": "^1.1.2",
"@total-typescript/ts-reset": "^0.4.2",
diff --git a/examples/subscriptions/package.json b/examples/subscriptions/package.json
index 3876d9d642..9d4a1d4f2c 100644
--- a/examples/subscriptions/package.json
+++ b/examples/subscriptions/package.json
@@ -14,8 +14,8 @@
"dependencies": {
"@remix-run/react": "^2.9.2",
"@shopify/cli": "3.60.0",
- "@shopify/cli-hydrogen": "^8.0.4",
- "@shopify/hydrogen": "2024.4.2",
+ "@shopify/cli-hydrogen": "^8.1.0",
+ "@shopify/hydrogen": "2024.4.3",
"@shopify/remix-oxygen": "^2.0.4",
"graphql": "^16.6.0",
"graphql-tag": "^2.12.6",
@@ -26,7 +26,7 @@
"devDependencies": {
"@remix-run/dev": "^2.9.2",
"@remix-run/eslint-config": "^2.9.2",
- "@shopify/mini-oxygen": "^3.0.2",
+ "@shopify/mini-oxygen": "^3.0.3",
"@shopify/oxygen-workers-types": "^4.0.0",
"@shopify/prettier-config": "^1.1.2",
"@tailwindcss/forms": "^0.5.3",
diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md
index 203cd90d73..e340d2f2b3 100644
--- a/packages/cli/CHANGELOG.md
+++ b/packages/cli/CHANGELOG.md
@@ -1,5 +1,30 @@
# @shopify/cli-hydrogen
+## 8.1.0
+
+### Minor Changes
+
+- Support Vite projects in `h2 debug cpu` command. ([#2124](https://github.com/Shopify/hydrogen/pull/2124)) by [@frandiox](https://github.com/frandiox)
+
+- The `h2 preview` command now supports `--build` and `--watch` flags to preview the project using the build process instead of Vite's dev process. ([#2100](https://github.com/Shopify/hydrogen/pull/2100)) by [@frandiox](https://github.com/frandiox)
+
+### Patch Changes
+
+- Update remix to v2.9.2 ([#2135](https://github.com/Shopify/hydrogen/pull/2135)) by [@michenly](https://github.com/michenly)
+
+- The CLI now tries to add optimizable dependencies to Vite's ssr.optimizeDeps.include automatically. ([#2106](https://github.com/Shopify/hydrogen/pull/2106)) by [@frandiox](https://github.com/frandiox)
+
+- Fix Hydrogen upgrade notification when running the dev command. ([#2120](https://github.com/Shopify/hydrogen/pull/2120)) by [@frandiox](https://github.com/frandiox)
+
+- Hide non actionable warning about ts-node. ([#2123](https://github.com/Shopify/hydrogen/pull/2123)) by [@frandiox](https://github.com/frandiox)
+
+- `` and `useAnalytics` are now stable. ([#2141](https://github.com/Shopify/hydrogen/pull/2141)) by [@wizardlyhel](https://github.com/wizardlyhel)
+
+- Updated internal CLI dependencies to `3.60.0`. ([#2087](https://github.com/Shopify/hydrogen/pull/2087)) by [@isaacroldan](https://github.com/isaacroldan)
+
+- Updated dependencies [[`cd888ec5`](https://github.com/Shopify/hydrogen/commit/cd888ec5ae5a0677aff7cd41962f5a44f155184e), [`27e51abf`](https://github.com/Shopify/hydrogen/commit/27e51abfc1f5444afa952c503886bfa12fc55c7e)]:
+ - @shopify/mini-oxygen@3.0.3
+
## 8.0.4
### Patch Changes
diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json
index 0b80a7eb71..c2d504cf56 100644
--- a/packages/cli/oclif.manifest.json
+++ b/packages/cli/oclif.manifest.json
@@ -1667,5 +1667,5 @@
]
}
},
- "version": "8.0.4"
+ "version": "8.1.0"
}
\ No newline at end of file
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 8fbcd58b72..137e256d38 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.0.4",
+ "version": "8.1.0",
"license": "MIT",
"type": "module",
"scripts": {
@@ -60,7 +60,7 @@
"@graphql-codegen/cli": "^5.0.2",
"@remix-run/dev": "^2.1.0",
"@shopify/hydrogen-codegen": "^0.3.1",
- "@shopify/mini-oxygen": "^3.0.2",
+ "@shopify/mini-oxygen": "^3.0.3",
"graphql-config": "^5.0.3",
"vite": "^5.1.0"
},
diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md
index e9f46785a3..42fa0f2d20 100644
--- a/packages/create-hydrogen/CHANGELOG.md
+++ b/packages/create-hydrogen/CHANGELOG.md
@@ -1,5 +1,14 @@
# @shopify/create-hydrogen
+## 4.3.10
+
+### Patch Changes
+
+- Update remix to v2.9.2 ([#2135](https://github.com/Shopify/hydrogen/pull/2135)) by [@michenly](https://github.com/michenly)
+
+- Updated dependencies [[`32d4c33e`](https://github.com/Shopify/hydrogen/commit/32d4c33e4421a9c56f62a8c392f5417edddd0402), [`27e51abf`](https://github.com/Shopify/hydrogen/commit/27e51abfc1f5444afa952c503886bfa12fc55c7e), [`7b838beb`](https://github.com/Shopify/hydrogen/commit/7b838beb7c43380ffc9c32c2bb9f34291912fa42), [`ca4cf045`](https://github.com/Shopify/hydrogen/commit/ca4cf045f7fb72ad98b62af7bd172ff8cf553de2), [`5a554b2e`](https://github.com/Shopify/hydrogen/commit/5a554b2e9d91894c2db8032f0c29666dce1ea3f2), [`5d6465b3`](https://github.com/Shopify/hydrogen/commit/5d6465b32d90052e5580fcb81d98427bcb8ad528), [`608389d6`](https://github.com/Shopify/hydrogen/commit/608389d6d69c6a9801935d528507c165d1dd4ccf), [`65239c76`](https://github.com/Shopify/hydrogen/commit/65239c76ca1d0b294b59b1ad53624485859c4da5)]:
+ - @shopify/cli-hydrogen@8.1.0
+
## 4.3.9
### Patch Changes
diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json
index 442dde00fe..f7951967ab 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": "4.3.9",
+ "version": "4.3.10",
"type": "module",
"scripts": {
"build": "tsup --clean",
@@ -13,7 +13,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
- "@shopify/cli-hydrogen": "^8.0.4"
+ "@shopify/cli-hydrogen": "^8.1.0"
},
"bin": "dist/create-app.js",
"files": [
diff --git a/packages/hydrogen-react/CHANGELOG.md b/packages/hydrogen-react/CHANGELOG.md
index 7660ed0bd4..66af395d8e 100644
--- a/packages/hydrogen-react/CHANGELOG.md
+++ b/packages/hydrogen-react/CHANGELOG.md
@@ -1,5 +1,30 @@
# @shopify/hydrogen-react
+## 2024.4.3
+
+### Patch Changes
+
+- Fix shopify cookie domain setting ([#2142](https://github.com/Shopify/hydrogen/pull/2142)) by [@wizardlyhel](https://github.com/wizardlyhel)
+
+- Add a RichText component to easily render \`rich_text_field\` metafields. Thank you @bastienrobert for the original implementation. Example usage: ([#2144](https://github.com/Shopify/hydrogen/pull/2144)) by [@blittle](https://github.com/blittle)
+
+ ```tsx
+ import {RichText} from '@shopify/hydrogen-react';
+
+ export function MainRichText({metaFieldData}: {metaFieldData: string}) {
+ return (
+ {node.children};
+ },
+ }}
+ />
+ );
+ }
+ ```
+
## 2024.4.2
### Patch Changes
diff --git a/packages/hydrogen-react/package.json b/packages/hydrogen-react/package.json
index 46ff087f6f..ad6827a913 100644
--- a/packages/hydrogen-react/package.json
+++ b/packages/hydrogen-react/package.json
@@ -1,6 +1,6 @@
{
"name": "@shopify/hydrogen-react",
- "version": "2024.4.2",
+ "version": "2024.4.3",
"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 d4cb4916b7..08f1bc62aa 100644
--- a/packages/hydrogen/CHANGELOG.md
+++ b/packages/hydrogen/CHANGELOG.md
@@ -1,5 +1,129 @@
# @shopify/hydrogen
+## 2024.4.3
+
+### Patch Changes
+
+- Add the `useOptimisticCart()` hook. This hook takes the cart object as a parameter, and processes all pending cart actions, locally mutating the cart with optimistic state. An optimistic cart makes cart actions immediately render in the browser while the action syncs to the server. This increases the perceived performance of the application. ([#2069](https://github.com/Shopify/hydrogen/pull/2069)) by [@blittle](https://github.com/blittle)
+
+ Example usage:
+
+ ```tsx
+ // Root loader returns the cart data
+ export async function loader({context}: LoaderFunctionArgs) {
+ return defer({
+ cart: context.cart.get(),
+ });
+ }
+
+ // The cart component renders each line item in the cart.
+ export function Cart({cart}) {
+ if (!cart?.lines?.nodes?.length) return
Nothing in cart
;
+
+ return cart.lines.nodes.map((line) => (
+
+
+ {line.merchandise.product.title}
+
+
+ ));
+ }
+ ```
+
+ The problem with this code is that it can feel slow. If a new item is added to the cart, it won't render until the server action completes and the client revalidates the root loader with the new cart data.
+
+ If we update the cart implementation with a new `useOptimisticCart()` hook, Hydrogen can take the pending add to cart action, and apply it locally with the existing cart data:
+
+ ```tsx
+ export function Cart({cart}) {
+ const optimisticCart = useOptimisticCart(cart);
+
+ if (!optimisticCart?.lines?.nodes?.length) return
+ ));
+ }
+ ```
+
+ This works automatically with the `CartForm.ACTIONS.LinesUpdate` and `CartForm.ACTIONS.LinesRemove`. To make it work with `CartForm.Actions.LinesAdd`, update the `CartForm` to include the `selectedVariant`:
+
+ ```tsx
+ export function ProductCard({product}) {
+ return (
+
+
{product.title}
+
+
+
+
+ );
+ }
+ ```
+
+ Sometimes line items need to render differently when they have yet to process on the server. A new isOptimistic flag is added to each line item:
+
+ ```tsx
+ export function Cart({cart}) {
+ const optimisticCart = useOptimisticCart(cart);
+
+ if (!cart?.lines?.nodes?.length) return