From b40a817043d25707c64178d1c8ec0dec1ee08761 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 Jul 2024 19:49:49 +0000 Subject: [PATCH] [ci] release 2024-07 --- .changeset/big-otters-brake.md | 6 - .changeset/brave-falcons-repair.md | 5 - .changeset/bright-wombats-count.md | 7 -- .changeset/chilled-points-give.md | 5 - .changeset/cold-foxes-draw.md | 19 --- .changeset/dull-needles-doubt.md | 5 - .changeset/fifty-melons-film.md | 5 - .changeset/happy-rabbits-draw.md | 5 - .changeset/khaki-maps-kiss.md | 67 ----------- .changeset/light-balloons-hide.md | 5 - .changeset/metal-kids-exercise.md | 5 - .changeset/old-snails-care.md | 5 - .changeset/plenty-clocks-hide.md | 5 - .changeset/purple-eggs-fly.md | 5 - .changeset/rare-bags-attack.md | 5 - .changeset/red-apes-exercise.md | 6 - .changeset/red-lamps-switch.md | 65 ---------- .changeset/six-pumas-allow.md | 5 - .changeset/strange-keys-glow.md | 5 - .changeset/strong-chefs-hammer.md | 5 - .changeset/stupid-falcons-wash.md | 5 - .changeset/tall-elephants-drum.md | 5 - .changeset/tender-lies-mate.md | 5 - .changeset/two-chefs-yawn.md | 11 -- .changeset/wet-apricots-fix.md | 5 - .changeset/wet-yaks-think.md | 34 ------ .changeset/wise-badgers-march.md | 5 - .changeset/young-gifts-learn.md | 5 - examples/express/package.json | 2 +- packages/cli/CHANGELOG.md | 25 ++++ packages/cli/oclif.manifest.json | 2 +- packages/cli/package.json | 4 +- packages/create-hydrogen/CHANGELOG.md | 6 + packages/create-hydrogen/package.json | 2 +- packages/hydrogen-react/CHANGELOG.md | 6 + packages/hydrogen-react/package.json | 2 +- packages/hydrogen/CHANGELOG.md | 73 +++++++++++ packages/hydrogen/package.json | 4 +- packages/hydrogen/src/version.ts | 2 +- packages/mini-oxygen/CHANGELOG.md | 6 + packages/mini-oxygen/package.json | 2 +- packages/remix-oxygen/CHANGELOG.md | 6 + packages/remix-oxygen/package.json | 2 +- templates/skeleton/CHANGELOG.md | 166 ++++++++++++++++++++++++++ templates/skeleton/package.json | 8 +- 45 files changed, 303 insertions(+), 330 deletions(-) delete mode 100644 .changeset/big-otters-brake.md delete mode 100644 .changeset/brave-falcons-repair.md delete mode 100644 .changeset/bright-wombats-count.md delete mode 100644 .changeset/chilled-points-give.md delete mode 100644 .changeset/cold-foxes-draw.md delete mode 100644 .changeset/dull-needles-doubt.md delete mode 100644 .changeset/fifty-melons-film.md delete mode 100644 .changeset/happy-rabbits-draw.md delete mode 100644 .changeset/khaki-maps-kiss.md delete mode 100644 .changeset/light-balloons-hide.md delete mode 100644 .changeset/metal-kids-exercise.md delete mode 100644 .changeset/old-snails-care.md delete mode 100644 .changeset/plenty-clocks-hide.md delete mode 100644 .changeset/purple-eggs-fly.md delete mode 100644 .changeset/rare-bags-attack.md delete mode 100644 .changeset/red-apes-exercise.md delete mode 100644 .changeset/red-lamps-switch.md delete mode 100644 .changeset/six-pumas-allow.md delete mode 100644 .changeset/strange-keys-glow.md delete mode 100644 .changeset/strong-chefs-hammer.md delete mode 100644 .changeset/stupid-falcons-wash.md delete mode 100644 .changeset/tall-elephants-drum.md delete mode 100644 .changeset/tender-lies-mate.md delete mode 100644 .changeset/two-chefs-yawn.md delete mode 100644 .changeset/wet-apricots-fix.md delete mode 100644 .changeset/wet-yaks-think.md delete mode 100644 .changeset/wise-badgers-march.md delete mode 100644 .changeset/young-gifts-learn.md diff --git a/.changeset/big-otters-brake.md b/.changeset/big-otters-brake.md deleted file mode 100644 index b99f15c788..0000000000 --- a/.changeset/big-otters-brake.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/remix-oxygen': patch -'skeleton': patch ---- - -Update `@shopify/oxygen-workers-types` to fix issues on Windows. diff --git a/.changeset/brave-falcons-repair.md b/.changeset/brave-falcons-repair.md deleted file mode 100644 index ac1401d94b..0000000000 --- a/.changeset/brave-falcons-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Fix Codegen config resolution when project directory contains dots. diff --git a/.changeset/bright-wombats-count.md b/.changeset/bright-wombats-count.md deleted file mode 100644 index 5c3347d396..0000000000 --- a/.changeset/bright-wombats-count.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -[**Breaking change**] - -`customerAccount` no longer commit session automatically. diff --git a/.changeset/chilled-points-give.md b/.changeset/chilled-points-give.md deleted file mode 100644 index 515e5e6f58..0000000000 --- a/.changeset/chilled-points-give.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -[Bug fix] Allow env-branch to be passed when running `h2 deploy` in CI diff --git a/.changeset/cold-foxes-draw.md b/.changeset/cold-foxes-draw.md deleted file mode 100644 index 1b1b9046d9..0000000000 --- a/.changeset/cold-foxes-draw.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'skeleton': patch -'@shopify/hydrogen': patch ---- - -[**Breaking change**] - -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: - -```diff - option.values.length > 1)} -- options={product.options} - variants={variants}> - -``` - -Fixes [#1198](https://github.com/Shopify/hydrogen/discussions/1198) diff --git a/.changeset/dull-needles-doubt.md b/.changeset/dull-needles-doubt.md deleted file mode 100644 index 534a955fe3..0000000000 --- a/.changeset/dull-needles-doubt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/mini-oxygen': patch ---- - -Security updates diff --git a/.changeset/fifty-melons-film.md b/.changeset/fifty-melons-film.md deleted file mode 100644 index e33a6d747b..0000000000 --- a/.changeset/fifty-melons-film.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Fix CLI upgrade notification when running from a global process. diff --git a/.changeset/happy-rabbits-draw.md b/.changeset/happy-rabbits-draw.md deleted file mode 100644 index 622f56d7bf..0000000000 --- a/.changeset/happy-rabbits-draw.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'skeleton': patch ---- - -Update remix to v2.10.1 diff --git a/.changeset/khaki-maps-kiss.md b/.changeset/khaki-maps-kiss.md deleted file mode 100644 index ec4f536818..0000000000 --- a/.changeset/khaki-maps-kiss.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -'skeleton': patch ---- - -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. - -The diff below showcase how you can make this refactor in existing application. - -```diff -import { - Outlet, -- useLoaderData, -+ useRouteLoaderData, -} from '@remix-run/react'; --import {Layout} from '~/components/Layout'; -+import {PageLayout} from '~/components/PageLayout'; - --export default function App() { -+export function Layout({children}: {children?: React.ReactNode}) { - const nonce = useNonce(); -- const data = useLoaderData(); -+ const data = useRouteLoaderData('root'); - - return ( - - ... - -- -- -- -+ {data? ( -+ {children} -+ ) : ( -+ children -+ )} - - - ); -} - -+export default function App() { -+ return ; -+} - -export function ErrorBoundary() { -- const rootData = useLoaderData(); - - return ( -- -- ... -- -- --
--

Error

-- ... --
--
-- -- -+
-+

Error

-+ ... -+
- ); -} - -``` diff --git a/.changeset/light-balloons-hide.md b/.changeset/light-balloons-hide.md deleted file mode 100644 index 05273a5c68..0000000000 --- a/.changeset/light-balloons-hide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'skeleton': patch ---- - -Refactor the cart and product form components diff --git a/.changeset/metal-kids-exercise.md b/.changeset/metal-kids-exercise.md deleted file mode 100644 index 6a5627c2a7..0000000000 --- a/.changeset/metal-kids-exercise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix the types for optimistic cart diff --git a/.changeset/old-snails-care.md b/.changeset/old-snails-care.md deleted file mode 100644 index 3b27f8eb96..0000000000 --- a/.changeset/old-snails-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Improve the types for `useOptimisticCart()` diff --git a/.changeset/plenty-clocks-hide.md b/.changeset/plenty-clocks-hide.md deleted file mode 100644 index ea45793523..0000000000 --- a/.changeset/plenty-clocks-hide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix a small rounding issue when checking stale-while-revalidate timing. diff --git a/.changeset/purple-eggs-fly.md b/.changeset/purple-eggs-fly.md deleted file mode 100644 index 86c0061bea..0000000000 --- a/.changeset/purple-eggs-fly.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Update virtual route to use Layout component in the root file. diff --git a/.changeset/rare-bags-attack.md b/.changeset/rare-bags-attack.md deleted file mode 100644 index 60a3161b8d..0000000000 --- a/.changeset/rare-bags-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Support Vite projects in `h2 setup css` command to setup Tailwind and vanilla-extract. Drop CSS setup support for classic Remix projects. diff --git a/.changeset/red-apes-exercise.md b/.changeset/red-apes-exercise.md deleted file mode 100644 index f3a80d4861..0000000000 --- a/.changeset/red-apes-exercise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/hydrogen': patch -'@shopify/hydrogen-react': patch ---- - -Add `sellingPlanId` support to `BuyNowButton`. diff --git a/.changeset/red-lamps-switch.md b/.changeset/red-lamps-switch.md deleted file mode 100644 index a5c69e40a6..0000000000 --- a/.changeset/red-lamps-switch.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -'skeleton': patch ---- - -Remove manual setting of session in headers and recommend setting it in server after response is created. - -Step 1: Add `isPending` implementation in session - -```diff -// in app/lib/session.ts -export class AppSession implements HydrogenSession { -+ public isPending = false; - - get unset() { -+ this.isPending = true; - return this.#session.unset; - } - - get set() { -+ this.isPending = true; - return this.#session.set; - } - - commit() { -+ this.isPending = false; - return this.#sessionStorage.commitSession(this.#session); - } -} -``` - -Step 2: update response header if `session.isPending` is true - -```diff -// in server.ts -export default { - async fetch(request: Request): Promise { - try { - const response = await handleRequest(request); - -+ if (session.isPending) { -+ response.headers.set('Set-Cookie', await session.commit()); -+ } - - return response; - } catch (error) { - ... - } - }, -}; -``` - -Step 3: remove setting cookie with session.commit() in routes - -```diff -// in route files -export async function loader({context}: LoaderFunctionArgs) { - return json({}, -- { -- headers: { -- 'Set-Cookie': await context.session.commit(), -- }, - }, - ); -} -``` diff --git a/.changeset/six-pumas-allow.md b/.changeset/six-pumas-allow.md deleted file mode 100644 index f37fd2fe09..0000000000 --- a/.changeset/six-pumas-allow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -skeleton template was updated to do session commit in server call instead of routes diff --git a/.changeset/strange-keys-glow.md b/.changeset/strange-keys-glow.md deleted file mode 100644 index ddbdb462ed..0000000000 --- a/.changeset/strange-keys-glow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix customData from Analytics.Provider not being passed to page view events diff --git a/.changeset/strong-chefs-hammer.md b/.changeset/strong-chefs-hammer.md deleted file mode 100644 index 8926d43eb0..0000000000 --- a/.changeset/strong-chefs-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -The build process in Vite projects now generates a bundle analysis tool for the server files. diff --git a/.changeset/stupid-falcons-wash.md b/.changeset/stupid-falcons-wash.md deleted file mode 100644 index d4410c5a55..0000000000 --- a/.changeset/stupid-falcons-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Auto cookie domain detection for customer privacy api and better error message for missing analytics fields diff --git a/.changeset/tall-elephants-drum.md b/.changeset/tall-elephants-drum.md deleted file mode 100644 index bc11d08eeb..0000000000 --- a/.changeset/tall-elephants-drum.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Remove `PUBLIC_STORE_DOMAIN` environment variable from `.env` when creating new projects with mock.shop. diff --git a/.changeset/tender-lies-mate.md b/.changeset/tender-lies-mate.md deleted file mode 100644 index 2f180dcd40..0000000000 --- a/.changeset/tender-lies-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'skeleton': patch ---- - -Moved `@shopify/cli` from `dependencies` to `devDependencies`. diff --git a/.changeset/two-chefs-yawn.md b/.changeset/two-chefs-yawn.md deleted file mode 100644 index 658361b1fc..0000000000 --- a/.changeset/two-chefs-yawn.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'skeleton': patch ---- - -The `@shopify/cli` package now bundles the `@shopify/cli-hydrogen` plugin. Therefore, you can now remove the latter from your local dependencies: - -```diff - "@shopify/cli": "3.64.0", -- "@shopify/cli-hydrogen": "^8.1.1", - "@shopify/hydrogen": "2024.7.0", -``` diff --git a/.changeset/wet-apricots-fix.md b/.changeset/wet-apricots-fix.md deleted file mode 100644 index 7424b2b9a5..0000000000 --- a/.changeset/wet-apricots-fix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/create-hydrogen': major ---- - -The code is now bundled to enhance installation speed. diff --git a/.changeset/wet-yaks-think.md b/.changeset/wet-yaks-think.md deleted file mode 100644 index 6e3a756af6..0000000000 --- a/.changeset/wet-yaks-think.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -[**New Features**] - -Add a `useOptimisticVariant` hook for optimistically rendering product variant changes. This makes switching product variants instantaneous. Example usage: - -```tsx -function Product() { - const {product, variants} = useLoaderData(); - - // The selectedVariant optimistically changes during page - // transitions with one of the preloaded product variants - const selectedVariant = useOptimisticVariant( - product.selectedVariant, - variants, - ); - - return ; -} -``` - -This also introduces a small breaking change to the `VariantSelector` component, which now immediately updates which variant is active. If you'd like to retain the current functionality, and have the `VariantSelector` wait for the page navigation to complete before updating, use the `waitForNavigation` prop: - -```tsx - - ... - -``` diff --git a/.changeset/wise-badgers-march.md b/.changeset/wise-badgers-march.md deleted file mode 100644 index 00aee55696..0000000000 --- a/.changeset/wise-badgers-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Return `null` instead of empty object from `cart.get()` when the cart id is invalid. diff --git a/.changeset/young-gifts-learn.md b/.changeset/young-gifts-learn.md deleted file mode 100644 index 4847266237..0000000000 --- a/.changeset/young-gifts-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Added an `--auth-bypass-token-duration` flag to the `deploy` command to allow for specified token duration between 1 to 12 hours. diff --git a/examples/express/package.json b/examples/express/package.json index b24f5c6258..b0169a3e70 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -15,7 +15,7 @@ "@remix-run/react": "^2.10.1", "@remix-run/server-runtime": "^2.10.1", "@shopify/cli": "^3.63.2", - "@shopify/hydrogen": "2024.7.0", + "@shopify/hydrogen": "2024.7.1", "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 e340d2f2b3..cde1451f2d 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,30 @@ # @shopify/cli-hydrogen +## 8.2.0 + +### Minor Changes + +- Support Vite projects in `h2 setup css` command to setup Tailwind and vanilla-extract. Drop CSS setup support for classic Remix projects. ([#2245](https://github.com/Shopify/hydrogen/pull/2245)) by [@frandiox](https://github.com/frandiox) + +- The build process in Vite projects now generates a bundle analysis tool for the server files. ([#2138](https://github.com/Shopify/hydrogen/pull/2138)) by [@frandiox](https://github.com/frandiox) + +### Patch Changes + +- Fix Codegen config resolution when project directory contains dots. ([#2293](https://github.com/Shopify/hydrogen/pull/2293)) by [@frandiox](https://github.com/frandiox) + +- [Bug fix] Allow env-branch to be passed when running `h2 deploy` in CI ([#2281](https://github.com/Shopify/hydrogen/pull/2281)) by [@aswamy](https://github.com/aswamy) + +- Fix CLI upgrade notification when running from a global process. ([#2184](https://github.com/Shopify/hydrogen/pull/2184)) by [@frandiox](https://github.com/frandiox) + +- skeleton template was updated to do session commit in server call instead of routes ([#2137](https://github.com/Shopify/hydrogen/pull/2137)) by [@michenly](https://github.com/michenly) + +- Remove `PUBLIC_STORE_DOMAIN` environment variable from `.env` when creating new projects with mock.shop. ([#2221](https://github.com/Shopify/hydrogen/pull/2221)) by [@frandiox](https://github.com/frandiox) + +- Added an `--auth-bypass-token-duration` flag to the `deploy` command to allow for specified token duration between 1 to 12 hours. ([#2182](https://github.com/Shopify/hydrogen/pull/2182)) by [@NelsonLee-Code](https://github.com/NelsonLee-Code) + +- Updated dependencies [[`0924410f`](https://github.com/Shopify/hydrogen/commit/0924410fa2a1d13d46f09ca42fb1f1de3e0a4f57)]: + - @shopify/mini-oxygen@3.0.4 + ## 8.1.0 ### Minor Changes diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index dd8c36932b..8d340bb430 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1714,5 +1714,5 @@ ] } }, - "version": "8.1.1" + "version": "8.2.0" } \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index a38224a981..2af8713c03 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.1.1", + "version": "8.2.0", "license": "MIT", "type": "module", "scripts": { @@ -56,7 +56,7 @@ "@graphql-codegen/cli": "^5.0.2", "@remix-run/dev": "^2.1.0", "@shopify/hydrogen-codegen": "^0.3.1", - "@shopify/mini-oxygen": "^3.0.3", + "@shopify/mini-oxygen": "^3.0.4", "graphql-config": "^5.0.3", "vite": "^5.1.0" }, diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md index 42fa0f2d20..fe9a8af160 100644 --- a/packages/create-hydrogen/CHANGELOG.md +++ b/packages/create-hydrogen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/create-hydrogen +## 5.0.0 + +### Major Changes + +- The code is now bundled to enhance installation speed. ([#2184](https://github.com/Shopify/hydrogen/pull/2184)) by [@frandiox](https://github.com/frandiox) + ## 4.3.10 ### Patch Changes diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json index cf6a64c1db..7096fda427 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.14", + "version": "5.0.0", "type": "module", "scripts": { "build": "tsup --clean", diff --git a/packages/hydrogen-react/CHANGELOG.md b/packages/hydrogen-react/CHANGELOG.md index 66af395d8e..17ec4b37d4 100644 --- a/packages/hydrogen-react/CHANGELOG.md +++ b/packages/hydrogen-react/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/hydrogen-react +## 2024.7.1 + +### Patch Changes + +- Add `sellingPlanId` support to `BuyNowButton`. ([#2254](https://github.com/Shopify/hydrogen/pull/2254)) by [@dvisockas](https://github.com/dvisockas) + ## 2024.4.3 ### Patch Changes diff --git a/packages/hydrogen-react/package.json b/packages/hydrogen-react/package.json index 0597f9584a..4d640383ce 100644 --- a/packages/hydrogen-react/package.json +++ b/packages/hydrogen-react/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/hydrogen-react", - "version": "2024.7.0", + "version": "2024.7.1", "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 cef033d6a2..92f2a595b9 100644 --- a/packages/hydrogen/CHANGELOG.md +++ b/packages/hydrogen/CHANGELOG.md @@ -1,5 +1,78 @@ # @shopify/hydrogen +## 2024.7.1 + +### Patch Changes + +- [**Breaking change**] ([#2137](https://github.com/Shopify/hydrogen/pull/2137)) by [@michenly](https://github.com/michenly) + + `customerAccount` no longer commit session automatically. + +- [**Breaking change**] ([#2113](https://github.com/Shopify/hydrogen/pull/2113)) by [@blittle](https://github.com/blittle) + + 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: + + ```diff + option.values.length > 1)} + - options={product.options} + variants={variants}> + + ``` + + Fixes [#1198](https://github.com/Shopify/hydrogen/discussions/1198) + +- Fix the types for optimistic cart ([#2132](https://github.com/Shopify/hydrogen/pull/2132)) by [@blittle](https://github.com/blittle) + +- Improve the types for `useOptimisticCart()` ([#2269](https://github.com/Shopify/hydrogen/pull/2269)) by [@blittle](https://github.com/blittle) + +- Fix a small rounding issue when checking stale-while-revalidate timing. ([#2220](https://github.com/Shopify/hydrogen/pull/2220)) by [@frandiox](https://github.com/frandiox) + +- Update virtual route to use Layout component in the root file. ([#2292](https://github.com/Shopify/hydrogen/pull/2292)) by [@michenly](https://github.com/michenly) + +- Add `sellingPlanId` support to `BuyNowButton`. ([#2254](https://github.com/Shopify/hydrogen/pull/2254)) by [@dvisockas](https://github.com/dvisockas) + +- Fix customData from Analytics.Provider not being passed to page view events ([#2224](https://github.com/Shopify/hydrogen/pull/2224)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Auto cookie domain detection for customer privacy api and better error message for missing analytics fields ([#2256](https://github.com/Shopify/hydrogen/pull/2256)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- [**New Features**] ([#2183](https://github.com/Shopify/hydrogen/pull/2183)) by [@blittle](https://github.com/blittle) + + Add a `useOptimisticVariant` hook for optimistically rendering product variant changes. This makes switching product variants instantaneous. Example usage: + + ```tsx + function Product() { + const {product, variants} = useLoaderData(); + + // The selectedVariant optimistically changes during page + // transitions with one of the preloaded product variants + const selectedVariant = useOptimisticVariant( + product.selectedVariant, + variants, + ); + + return ; + } + ``` + + This also introduces a small breaking change to the `VariantSelector` component, which now immediately updates which variant is active. If you'd like to retain the current functionality, and have the `VariantSelector` wait for the page navigation to complete before updating, use the `waitForNavigation` prop: + + ```tsx + + ... + + ``` + +- Return `null` instead of empty object from `cart.get()` when the cart id is invalid. ([#2258](https://github.com/Shopify/hydrogen/pull/2258)) by [@frandiox](https://github.com/frandiox) + +- Updated dependencies [[`54c2f7ad`](https://github.com/Shopify/hydrogen/commit/54c2f7ad3d0d52e6be10b2a54a1a4fd0cc107a35)]: + - @shopify/hydrogen-react@2024.7.1 + ## 2024.4.3 ### Patch Changes diff --git a/packages/hydrogen/package.json b/packages/hydrogen/package.json index 8380604170..2f68ea02c6 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.0", + "version": "2024.7.1", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", @@ -63,7 +63,7 @@ "dist" ], "dependencies": { - "@shopify/hydrogen-react": "2024.7.0", + "@shopify/hydrogen-react": "2024.7.1", "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 a58492b284..0ea0d79ceb 100644 --- a/packages/hydrogen/src/version.ts +++ b/packages/hydrogen/src/version.ts @@ -1 +1 @@ -export const LIB_VERSION = '2024.7.0'; +export const LIB_VERSION = '2024.7.1'; diff --git a/packages/mini-oxygen/CHANGELOG.md b/packages/mini-oxygen/CHANGELOG.md index 0c8a004849..e5c1fa8096 100644 --- a/packages/mini-oxygen/CHANGELOG.md +++ b/packages/mini-oxygen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/mini-oxygen +## 3.0.4 + +### Patch Changes + +- Security updates ([#2263](https://github.com/Shopify/hydrogen/pull/2263)) by [@dependabot](https://github.com/apps/dependabot) + ## 3.0.3 ### Patch Changes diff --git a/packages/mini-oxygen/package.json b/packages/mini-oxygen/package.json index 20ceee0efd..434a9d28c5 100644 --- a/packages/mini-oxygen/package.json +++ b/packages/mini-oxygen/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "3.0.3", + "version": "3.0.4", "license": "MIT", "type": "module", "description": "Development assistant for custom Shopify Oxygen hosted storefronts", diff --git a/packages/remix-oxygen/CHANGELOG.md b/packages/remix-oxygen/CHANGELOG.md index 31ce34d1a6..28d3d3550a 100644 --- a/packages/remix-oxygen/CHANGELOG.md +++ b/packages/remix-oxygen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/remix-oxygen +## 2.0.5 + +### Patch Changes + +- Update `@shopify/oxygen-workers-types` to fix issues on Windows. ([#2252](https://github.com/Shopify/hydrogen/pull/2252)) by [@michenly](https://github.com/michenly) + ## 2.0.4 ### Patch Changes diff --git a/packages/remix-oxygen/package.json b/packages/remix-oxygen/package.json index 9fdec4e039..1a969d6f9d 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.4", + "version": "2.0.5", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", diff --git a/templates/skeleton/CHANGELOG.md b/templates/skeleton/CHANGELOG.md index f525a06afb..6b175625a8 100644 --- a/templates/skeleton/CHANGELOG.md +++ b/templates/skeleton/CHANGELOG.md @@ -1,5 +1,171 @@ # skeleton +## 2024.7.1 + +### Patch Changes + +- Update `@shopify/oxygen-workers-types` to fix issues on Windows. ([#2252](https://github.com/Shopify/hydrogen/pull/2252)) by [@michenly](https://github.com/michenly) + +- [**Breaking change**] ([#2113](https://github.com/Shopify/hydrogen/pull/2113)) by [@blittle](https://github.com/blittle) + + 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: + + ```diff + option.values.length > 1)} + - options={product.options} + variants={variants}> + + ``` + + Fixes [#1198](https://github.com/Shopify/hydrogen/discussions/1198) + +- Update remix to v2.10.1 ([#2290](https://github.com/Shopify/hydrogen/pull/2290)) by [@michenly](https://github.com/michenly) + +- 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) + + The diff below showcase how you can make this refactor in existing application. + + ```diff + import { + Outlet, + - useLoaderData, + + useRouteLoaderData, + } from '@remix-run/react'; + -import {Layout} from '~/components/Layout'; + +import {PageLayout} from '~/components/PageLayout'; + + -export default function App() { + +export function Layout({children}: {children?: React.ReactNode}) { + const nonce = useNonce(); + - const data = useLoaderData(); + + const data = useRouteLoaderData('root'); + + return ( + + ... + + - + - + - + + {data? ( + + {children} + + ) : ( + + children + + )} + + + ); + } + + +export default function App() { + + return ; + +} + + export function ErrorBoundary() { + - const rootData = useLoaderData(); + + return ( + - + - ... + - + - + -
+ -

Error

+ - ... + -
+ -
+ - + - + +
+ +

Error

+ + ... + +
+ ); + } + + ``` + +- Refactor the cart and product form components ([#2132](https://github.com/Shopify/hydrogen/pull/2132)) by [@blittle](https://github.com/blittle) + +- 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) + + Step 1: Add `isPending` implementation in session + + ```diff + // in app/lib/session.ts + export class AppSession implements HydrogenSession { + + public isPending = false; + + get unset() { + + this.isPending = true; + return this.#session.unset; + } + + get set() { + + this.isPending = true; + return this.#session.set; + } + + commit() { + + this.isPending = false; + return this.#sessionStorage.commitSession(this.#session); + } + } + ``` + + Step 2: update response header if `session.isPending` is true + + ```diff + // in server.ts + export default { + async fetch(request: Request): Promise { + try { + const response = await handleRequest(request); + + + if (session.isPending) { + + response.headers.set('Set-Cookie', await session.commit()); + + } + + return response; + } catch (error) { + ... + } + }, + }; + ``` + + Step 3: remove setting cookie with session.commit() in routes + + ```diff + // in route files + export async function loader({context}: LoaderFunctionArgs) { + return json({}, + - { + - headers: { + - 'Set-Cookie': await context.session.commit(), + - }, + }, + ); + } + ``` + +- Moved `@shopify/cli` from `dependencies` to `devDependencies`. ([#2312](https://github.com/Shopify/hydrogen/pull/2312)) by [@frandiox](https://github.com/frandiox) + +- 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) + + ```diff + "@shopify/cli": "3.64.0", + - "@shopify/cli-hydrogen": "^8.1.1", + "@shopify/hydrogen": "2024.7.0", + ``` + +- 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)]: + - @shopify/remix-oxygen@2.0.5 + - @shopify/cli-hydrogen@8.2.0 + - @shopify/hydrogen@2024.7.1 + ## 2024.4.5 ### Patch Changes diff --git a/templates/skeleton/package.json b/templates/skeleton/package.json index b4e469d5c5..7d66b7880c 100644 --- a/templates/skeleton/package.json +++ b/templates/skeleton/package.json @@ -2,7 +2,7 @@ "name": "skeleton", "private": true, "sideEffects": false, - "version": "2024.7.0", + "version": "2024.7.1", "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.0", - "@shopify/remix-oxygen": "^2.0.4", + "@shopify/hydrogen": "2024.7.1", + "@shopify/remix-oxygen": "^2.0.5", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.8.0", @@ -31,7 +31,7 @@ "@remix-run/eslint-config": "^2.10.1", "@shopify/cli": "^3.63.2", "@shopify/hydrogen-codegen": "^0.3.1", - "@shopify/mini-oxygen": "^3.0.3", + "@shopify/mini-oxygen": "^3.0.4", "@shopify/oxygen-workers-types": "^4.1.2", "@shopify/prettier-config": "^1.1.2", "@total-typescript/ts-reset": "^0.4.2",