From 705ad500b87c83029950e453fd34dbce2e445eeb Mon Sep 17 00:00:00 2001 From: "shopify-github-actions-access[bot]" <109624739+shopify-github-actions-access[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:45:26 -0700 Subject: [PATCH] [ci] release 2024-04 (#1855) * [ci] release 2024-04 * Fix 2024.4 versions --------- Co-authored-by: github-actions[bot] Co-authored-by: Juan P. Prieto --- .changeset/angry-games-train.md | 14 --- .changeset/big-camels-fold.md | 5 - .changeset/big-impalas-brush.md | 5 - .changeset/five-glasses-heal.md | 5 - .changeset/five-news-flash.md | 5 - .changeset/fresh-zoos-shout.md | 5 - .changeset/healthy-owls-lay.md | 33 ----- .changeset/hip-rocks-hammer.md | 5 - .changeset/itchy-dodos-crash.md | 5 - .changeset/itchy-weeks-search.md | 28 ----- .changeset/little-paws-fry.md | 20 --- .changeset/long-boxes-punch.md | 5 - .changeset/lovely-donkeys-destroy.md | 9 -- .changeset/mean-pots-carry.md | 15 --- .changeset/old-badgers-flow.md | 6 - .changeset/old-hounds-live.md | 15 --- .changeset/polite-seahorses-fail.md | 5 - .changeset/poor-boats-cheer.md | 13 -- .changeset/pretty-gifts-rest.md | 6 - .changeset/quick-walls-smash.md | 7 -- .changeset/red-geese-work.md | 16 --- .changeset/red-turkeys-sing.md | 7 -- .changeset/short-flowers-enjoy.md | 5 - .changeset/shy-bulldogs-smile.md | 5 - .changeset/shy-seas-own.md | 5 - .changeset/smooth-cooks-attend.md | 5 - .changeset/spicy-lemons-impress.md | 6 - .changeset/strong-beds-call.md | 5 - .changeset/stupid-gifts-drum.md | 5 - .changeset/tame-cobras-sort.md | 5 - .changeset/tasty-lizards-hope.md | 5 - .changeset/tiny-sheep-report.md | 106 ---------------- .changeset/twelve-apricots-study.md | 5 - .changeset/twelve-paws-prove.md | 5 - .changeset/twenty-taxis-taste.md | 23 ---- .changeset/weak-moons-call.md | 5 - .changeset/wise-rice-hope.md | 19 --- .changeset/witty-rockets-guess.md | 7 -- examples/express/package.json | 2 +- examples/multipass/package.json | 6 +- examples/partytown/package.json | 6 +- examples/subscriptions/package.json | 6 +- packages/cli/CHANGELOG.md | 70 +++++++++++ packages/cli/oclif.manifest.json | 2 +- packages/cli/package.json | 6 +- packages/create-hydrogen/CHANGELOG.md | 9 ++ packages/create-hydrogen/package.json | 4 +- packages/hydrogen-codegen/CHANGELOG.md | 6 + packages/hydrogen-codegen/package.json | 2 +- packages/hydrogen-react/CHANGELOG.md | 10 ++ packages/hydrogen/CHANGELOG.md | 168 +++++++++++++++++++++++++ packages/hydrogen/src/version.ts | 2 +- packages/mini-oxygen/CHANGELOG.md | 38 ++++++ packages/mini-oxygen/package.json | 2 +- packages/remix-oxygen/CHANGELOG.md | 6 + packages/remix-oxygen/package.json | 2 +- templates/hello-world/package.json | 6 +- templates/skeleton/CHANGELOG.md | 89 +++++++++++++ templates/skeleton/package.json | 10 +- 59 files changed, 424 insertions(+), 478 deletions(-) delete mode 100644 .changeset/angry-games-train.md delete mode 100644 .changeset/big-camels-fold.md delete mode 100644 .changeset/big-impalas-brush.md delete mode 100644 .changeset/five-glasses-heal.md delete mode 100644 .changeset/five-news-flash.md delete mode 100644 .changeset/fresh-zoos-shout.md delete mode 100644 .changeset/healthy-owls-lay.md delete mode 100644 .changeset/hip-rocks-hammer.md delete mode 100644 .changeset/itchy-dodos-crash.md delete mode 100644 .changeset/itchy-weeks-search.md delete mode 100644 .changeset/little-paws-fry.md delete mode 100644 .changeset/long-boxes-punch.md delete mode 100644 .changeset/lovely-donkeys-destroy.md delete mode 100644 .changeset/mean-pots-carry.md delete mode 100644 .changeset/old-badgers-flow.md delete mode 100644 .changeset/old-hounds-live.md delete mode 100644 .changeset/polite-seahorses-fail.md delete mode 100644 .changeset/poor-boats-cheer.md delete mode 100644 .changeset/pretty-gifts-rest.md delete mode 100644 .changeset/quick-walls-smash.md delete mode 100644 .changeset/red-geese-work.md delete mode 100644 .changeset/red-turkeys-sing.md delete mode 100644 .changeset/short-flowers-enjoy.md delete mode 100644 .changeset/shy-bulldogs-smile.md delete mode 100644 .changeset/shy-seas-own.md delete mode 100644 .changeset/smooth-cooks-attend.md delete mode 100644 .changeset/spicy-lemons-impress.md delete mode 100644 .changeset/strong-beds-call.md delete mode 100644 .changeset/stupid-gifts-drum.md delete mode 100644 .changeset/tame-cobras-sort.md delete mode 100644 .changeset/tasty-lizards-hope.md delete mode 100644 .changeset/tiny-sheep-report.md delete mode 100644 .changeset/twelve-apricots-study.md delete mode 100644 .changeset/twelve-paws-prove.md delete mode 100644 .changeset/twenty-taxis-taste.md delete mode 100644 .changeset/weak-moons-call.md delete mode 100644 .changeset/wise-rice-hope.md delete mode 100644 .changeset/witty-rockets-guess.md diff --git a/.changeset/angry-games-train.md b/.changeset/angry-games-train.md deleted file mode 100644 index dcd5a5303f..0000000000 --- a/.changeset/angry-games-train.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'skeleton': patch ---- - -Update internal libraries for parsing `.env` files. - -Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies: - -```diff -"dependencies": { -- "@shopify/cli": "3.56.3", -+ "@shopify/cli": "3.58.0", -} -``` diff --git a/.changeset/big-camels-fold.md b/.changeset/big-camels-fold.md deleted file mode 100644 index cd2ff4558d..0000000000 --- a/.changeset/big-camels-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Move the Hydrogen CLI's `env push` command to stable. diff --git a/.changeset/big-impalas-brush.md b/.changeset/big-impalas-brush.md deleted file mode 100644 index ba5de5ca8d..0000000000 --- a/.changeset/big-impalas-brush.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Make `StorefrontRedirect` case insensitive when querying redirect URLs from the Storefront API. diff --git a/.changeset/five-glasses-heal.md b/.changeset/five-glasses-heal.md deleted file mode 100644 index bd305c08b6..0000000000 --- a/.changeset/five-glasses-heal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'skeleton': patch ---- - -Add Adds magic Catalog route diff --git a/.changeset/five-news-flash.md b/.changeset/five-news-flash.md deleted file mode 100644 index 82b8602dd5..0000000000 --- a/.changeset/five-news-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Avoid throwing error in `h2 dev --codegen` when the Customer Account schema is not found. diff --git a/.changeset/fresh-zoos-shout.md b/.changeset/fresh-zoos-shout.md deleted file mode 100644 index 13a455d9d1..0000000000 --- a/.changeset/fresh-zoos-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-codegen': minor ---- - -Remove deprecated `schema` export. Use `getSchema('storefront')` instead. diff --git a/.changeset/healthy-owls-lay.md b/.changeset/healthy-owls-lay.md deleted file mode 100644 index f7af83d442..0000000000 --- a/.changeset/healthy-owls-lay.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -'@shopify/mini-oxygen': major ---- - -The default runtime exported from `@shopify/mini-oxygen` is now based on workerd. - -The previous Node.js sandbox runtime has been moved to the `@shopify/mini-oxygen/node` export. - -Example usage: - -```js -import {createMiniOxygen} from '@shopify/mini-oxygen'; - -const miniOxygen = createMiniOxygen({ - workers: [ - { - name: 'main', - modules: true, - script: `export default { - async fetch() { - const response = await fetch("https://hydrogen.shopify.dev"); - return response; - } - }`, - }, - ], -}); - -const response = await miniOxygen.dispatchFetch('http://placeholder'); -console.log(await response.text()); - -await miniOxygen.dispose(); -``` diff --git a/.changeset/hip-rocks-hammer.md b/.changeset/hip-rocks-hammer.md deleted file mode 100644 index bd83e7bfed..0000000000 --- a/.changeset/hip-rocks-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix bug where `storefrontRedirect` would return an error on soft page navigations. diff --git a/.changeset/itchy-dodos-crash.md b/.changeset/itchy-dodos-crash.md deleted file mode 100644 index cba1105b8e..0000000000 --- a/.changeset/itchy-dodos-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Bump internal workerd dependency to fix a bug when running on Node 21. diff --git a/.changeset/itchy-weeks-search.md b/.changeset/itchy-weeks-search.md deleted file mode 100644 index 280a118a7d..0000000000 --- a/.changeset/itchy-weeks-search.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix a bug where `cart` could be null, even though a new cart was created by adding a line item. - -This allows calling the cart `.get()` method right after creating a new cart with -one of the mutation methods: `create()`, `addLines()`, `updateDiscountCodes()`, `updateBuyerIdentity()`, `updateNote()`, `updateAttributes()`, `setMetafields()`. - - ```ts - import { - createCartHandler, - cartGetIdDefault, - cartSetIdDefault, - } from '@shopify/hydrogen'; - - const cartHandler = createCartHandler({ - storefront, - getCartId: cartGetIdDefault(request.headers), - setCartId: cartSetIdDefault(), - cartQueryFragment: CART_QUERY_FRAGMENT, - cartMutateFragment: CART_MUTATE_FRAGMENT, - }); - - await cartHandler.addLines([{merchandiseId: '...'}]); - // .get() now returns the cart as expected - const cart = await cartHandler.get(); - ``` diff --git a/.changeset/little-paws-fry.md b/.changeset/little-paws-fry.md deleted file mode 100644 index 0363b2946f..0000000000 --- a/.changeset/little-paws-fry.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'skeleton': patch ---- - -Update Vite plugin imports, and how their options are passed to Remix: - -```diff --import {hydrogen, oxygen} from '@shopify/cli-hydrogen/experimental-vite'; -+import {hydrogen} from '@shopify/hydrogen/vite'; -+import {oxygen} from '@shopify/mini-oxygen/vite'; -import {vitePlugin as remix} from '@remix-run/dev'; - -export default defineConfig({ - hydrogen(), - oxygen(), - remix({ -- buildDirectory: 'dist', -+ presets: [hydrogen.preset()], - future: { -``` diff --git a/.changeset/long-boxes-punch.md b/.changeset/long-boxes-punch.md deleted file mode 100644 index 7724009847..0000000000 --- a/.changeset/long-boxes-punch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Add `postLogoutRedirectUri` option to the Customer Account API client's logout method. diff --git a/.changeset/lovely-donkeys-destroy.md b/.changeset/lovely-donkeys-destroy.md deleted file mode 100644 index 8eb73019a5..0000000000 --- a/.changeset/lovely-donkeys-destroy.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Deprecate the `--env-branch` flag, in favor of `--env`. - -- `--env` accepts the environment's handle, instead of the environment's associated branch name - - Run `env list` to display all environments and their handles -- Any CLI commands that accepted the `--env-branch` flag now accept the `--env` flag. diff --git a/.changeset/mean-pots-carry.md b/.changeset/mean-pots-carry.md deleted file mode 100644 index 54ee29efbd..0000000000 --- a/.changeset/mean-pots-carry.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'skeleton': patch ---- - -Add `@shopify/mini-oxygen` as a dev dependency for local development: - -```diff - "devDependencies": { - "@remix-run/dev": "^2.8.0", - "@remix-run/eslint-config": "^2.8.0", -+ "@shopify/mini-oxygen": "^3.0.0", - "@shopify/oxygen-workers-types": "^4.0.0", - ... - }, -``` diff --git a/.changeset/old-badgers-flow.md b/.changeset/old-badgers-flow.md deleted file mode 100644 index 5d1b6e3c17..0000000000 --- a/.changeset/old-badgers-flow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -Introducing `` that also includes Shopify analytics, Customer Privacy API and Privacy banner diff --git a/.changeset/old-hounds-live.md b/.changeset/old-hounds-live.md deleted file mode 100644 index a45ef69294..0000000000 --- a/.changeset/old-hounds-live.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Support Node's `NODE_TLS_REJECT_UNAUTHORIZED` and `NODE_EXTRA_CA_CERTS` [environment variables](https://nodejs.org/api/cli.html#environment-variables) in the worker environment. - -Use this at your own risk to disable certificate validation or provide additional CA certificates when making HTTPS requests from the worker: - -```sh -# Disable certificate validation -NODE_TLS_REJECT_UNAUTHORIZED=0 npm run dev - -# Provide additional CA certificates -NODE_EXTRA_CA_CERTS=/usr/.../ca-certificates/my-file.crt npm run dev -``` diff --git a/.changeset/polite-seahorses-fail.md b/.changeset/polite-seahorses-fail.md deleted file mode 100644 index 3f1d3b22d0..0000000000 --- a/.changeset/polite-seahorses-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Export new Hydrogen Vite plugin from `@shopify/hydrogen/vite`. diff --git a/.changeset/poor-boats-cheer.md b/.changeset/poor-boats-cheer.md deleted file mode 100644 index 2c1826cf9c..0000000000 --- a/.changeset/poor-boats-cheer.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Support scaffolding projects from external repositories using the `--template` flag. - -The following examples are equivalent: - -```sh -npm create @shopify/hydrogen -- --template shopify/hydrogen-demo-store -npm create @shopify/hydrogen -- --template github.com/shopify/hydrogen-demo-store -npm create @shopify/hydrogen -- --template https://github.com/shopify/hydrogen-demo-store -``` diff --git a/.changeset/pretty-gifts-rest.md b/.changeset/pretty-gifts-rest.md deleted file mode 100644 index d08b663af6..0000000000 --- a/.changeset/pretty-gifts-rest.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch ---- - -Add `--quickstart` flag option to init/create command. diff --git a/.changeset/quick-walls-smash.md b/.changeset/quick-walls-smash.md deleted file mode 100644 index cc6bc44167..0000000000 --- a/.changeset/quick-walls-smash.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/cli-hydrogen': major ---- - -Hydrogen CLI now requires `@shopify/mini-oxygen` to be installed separately as a dev dependency. It is still used automatically under the hood so there is no need to change your application code aside from installing the dependency. - -Also, if a port provided via `--port` or `--inspector-port` flags is already in use, the CLI will now exit with an error message instead of finding a new open port. When the flags are not provided, the CLI will still find an open port. diff --git a/.changeset/red-geese-work.md b/.changeset/red-geese-work.md deleted file mode 100644 index b5bee36356..0000000000 --- a/.changeset/red-geese-work.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@shopify/hydrogen': minor ---- - -Change `storefrontRedirect` to ignore query parameters when matching redirects. For example, a redirect in the admin from `/snowboards` to `/collections/snowboards` will now match on the URL `/snowboards?utm_campaign=buffer` and redirect the user to `/collections/snowboards?utm_campaign=buffer`. - -This is a breaking change. If you want to retain the legacy functionality that is query parameter sensitive, pass `matchQueryParams` to `storefrontRedirect()`: - -```ts -storefrontRedirect({ - request, - response, - storefront, - matchQueryParams: true, -}); -``` diff --git a/.changeset/red-turkeys-sing.md b/.changeset/red-turkeys-sing.md deleted file mode 100644 index d5cfdf1f36..0000000000 --- a/.changeset/red-turkeys-sing.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'skeleton': patch -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': minor ---- - -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. diff --git a/.changeset/short-flowers-enjoy.md b/.changeset/short-flowers-enjoy.md deleted file mode 100644 index 790f943877..0000000000 --- a/.changeset/short-flowers-enjoy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Add a newline after the `h2` alias created in ZSH/Bash profiles. diff --git a/.changeset/shy-bulldogs-smile.md b/.changeset/shy-bulldogs-smile.md deleted file mode 100644 index 8842759950..0000000000 --- a/.changeset/shy-bulldogs-smile.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/remix-oxygen': patch ---- - -Fix compatibility of `/subrequest-profiler` with Vite. diff --git a/.changeset/shy-seas-own.md b/.changeset/shy-seas-own.md deleted file mode 100644 index 88f5860ee6..0000000000 --- a/.changeset/shy-seas-own.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Remove the `@shopify/cli-hydrogen/experimental-vite` import path in favor of `@shopify/hydrogen/vite` and `@shopify/mini-oxygen/vite`. diff --git a/.changeset/smooth-cooks-attend.md b/.changeset/smooth-cooks-attend.md deleted file mode 100644 index 2b5b84563d..0000000000 --- a/.changeset/smooth-cooks-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix default content security policy directive for `frameAncestors`. diff --git a/.changeset/spicy-lemons-impress.md b/.changeset/spicy-lemons-impress.md deleted file mode 100644 index d618f857c1..0000000000 --- a/.changeset/spicy-lemons-impress.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -Fall back to "mock.shop" when no value is passed in `storeDomain` to `createStorefrontClient` in development. diff --git a/.changeset/strong-beds-call.md b/.changeset/strong-beds-call.md deleted file mode 100644 index 85b772e6a2..0000000000 --- a/.changeset/strong-beds-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/mini-oxygen': minor ---- - -Export new Vite plugin from `@shopify/mini-oxygen/vite`. It integrates Vite with MiniOxygen by running the application code within a worker. diff --git a/.changeset/stupid-gifts-drum.md b/.changeset/stupid-gifts-drum.md deleted file mode 100644 index 082349cd02..0000000000 --- a/.changeset/stupid-gifts-drum.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Allow `ui_locale` to be passed to the customer account login page. diff --git a/.changeset/tame-cobras-sort.md b/.changeset/tame-cobras-sort.md deleted file mode 100644 index f9704d6c24..0000000000 --- a/.changeset/tame-cobras-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Expose `cartReady` state from the cart context. diff --git a/.changeset/tasty-lizards-hope.md b/.changeset/tasty-lizards-hope.md deleted file mode 100644 index 245a527798..0000000000 --- a/.changeset/tasty-lizards-hope.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Fix the `--markets` flag when using `npm create @shopify/hydrogen`. diff --git a/.changeset/tiny-sheep-report.md b/.changeset/tiny-sheep-report.md deleted file mode 100644 index a62e058ee6..0000000000 --- a/.changeset/tiny-sheep-report.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Deprecate the `` component in favor of directly using Remix [meta route exports](https://remix.run/docs/en/main/route/meta). Add the `getSeoMeta` to make migration easier. - -### Migration steps: - -**1. Remove the `` component from `root.jsx`:** - -```diff - export default function App() { - const nonce = useNonce(); - const data = useLoaderData(); - - return ( - - - - -- - - - - - - - - - - - - - ); - } - -``` - -**2. Add a Remix meta export to each route that returns an `seo` property from a `loader` or `handle`:** - -```diff -+import {getSeoMeta} from '@shopify/hydrogen'; - - export async function loader({context}) { - const {shop} = await context.storefront.query(` - query layout { - shop { - name - description - } - } - `); - - return { - seo: { - title: shop.title, - description: shop.description, - }, - }; - } - -+export const meta = ({data}) => { -+ return getSeoMeta(data.seo); -+}; -``` - -**3. Merge root route meta data** - -If your root route loader also returns an `seo` property, make sure to merge that data: - -```ts -export const meta = ({data, matches}) => { - return getSeoMeta( - matches[0].data.seo, - // the current route seo data overrides the root route data - data.seo, - ); -}; -``` - -Or more simply: - -```ts -export const meta = ({data, matches}) => { - return getSeoMeta(...matches.map((match) => match.data.seo)); -}; -``` - -**4. Override meta** - -Sometimes `getSeoMeta` might produce a property in a way you'd like to change. Map over the resulting array to change it. For example, Hydrogen removes query parameters from canonical URLs, add them back: - -```ts -export const meta = ({data, location}) => { - return getSeoMeta(data.seo).map((meta) => { - if (meta.rel === 'canonical') { - return { - ...meta, - href: meta.href + location.search, - }; - } - - return meta; - }); -}; -``` diff --git a/.changeset/twelve-apricots-study.md b/.changeset/twelve-apricots-study.md deleted file mode 100644 index 619d6909a1..0000000000 --- a/.changeset/twelve-apricots-study.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Handle duplicate storefront names when running `link` command. diff --git a/.changeset/twelve-paws-prove.md b/.changeset/twelve-paws-prove.md deleted file mode 100644 index 2f7211dd01..0000000000 --- a/.changeset/twelve-paws-prove.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -List uncommitted files in the `deploy` command's "uncommitted changes" error message. diff --git a/.changeset/twenty-taxis-taste.md b/.changeset/twenty-taxis-taste.md deleted file mode 100644 index 9b875c3898..0000000000 --- a/.changeset/twenty-taxis-taste.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'skeleton': patch ---- - -Fix types returned by the `session` object. - -In `remix.env.d.ts` or `env.d.ts`, add the following types: - -```diff -import type { - // ... - HydrogenCart, -+ HydrogenSessionData, -} from '@shopify/hydrogen'; - -// ... - -declare module '@shopify/remix-oxygen' { - // ... - -+ interface SessionData extends HydrogenSessionData {} -} -``` diff --git a/.changeset/weak-moons-call.md b/.changeset/weak-moons-call.md deleted file mode 100644 index 181a94434f..0000000000 --- a/.changeset/weak-moons-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Improve `h2 setup vite` command to cover more migration steps (e.g. vanilla-extract, css-modules, etc.) and keep Remix future flags. diff --git a/.changeset/wise-rice-hope.md b/.changeset/wise-rice-hope.md deleted file mode 100644 index a33964f9a6..0000000000 --- a/.changeset/wise-rice-hope.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'skeleton': patch ---- - -Codegen dependencies must be now listed explicitly in `package.json`: - -```diff -{ - "devDependencies": { -+ "@graphql-codegen/cli": "5.0.2", - "@remix-run/dev": "^2.8.0", - "@remix-run/eslint-config": "^2.8.0", -+ "@shopify/hydrogen-codegen": "^0.3.0", - "@shopify/mini-oxygen": "^2.2.5", - "@shopify/oxygen-workers-types": "^4.0.0", - ... - } -} -``` diff --git a/.changeset/witty-rockets-guess.md b/.changeset/witty-rockets-guess.md deleted file mode 100644 index 32327b59f8..0000000000 --- a/.changeset/witty-rockets-guess.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Add `--verbose` flag to `h2 dev` and `h2 preview` commands to enable verbose logging. - -Only CLI logs become verbose by default. If you also want to see verbose logs from Vite as well, use `DEBUG=* h2 dev` instead. diff --git a/examples/express/package.json b/examples/express/package.json index d915ecab00..1b02eacef6 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -17,7 +17,7 @@ "@remix-run/react": "^2.8.0", "@remix-run/server-runtime": "^2.8.0", "@shopify/cli": "3.58.0", - "@shopify/cli-hydrogen": "^7.1.2", + "@shopify/cli-hydrogen": "^8.0.0", "@shopify/hydrogen": "2024.4.0", "compression": "^1.7.4", "cross-env": "^7.0.3", diff --git a/examples/multipass/package.json b/examples/multipass/package.json index e361c7a2f2..75866a425f 100644 --- a/examples/multipass/package.json +++ b/examples/multipass/package.json @@ -14,9 +14,9 @@ "dependencies": { "@remix-run/react": "^2.8.0", "@shopify/cli": "3.58.0", - "@shopify/cli-hydrogen": "^7.1.2", + "@shopify/cli-hydrogen": "^8.0.0", "@shopify/hydrogen": "2024.4.0", - "@shopify/remix-oxygen": "^2.0.3", + "@shopify/remix-oxygen": "^2.0.4", "crypto-js": "^4.2.0", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", @@ -28,7 +28,7 @@ "devDependencies": { "@remix-run/dev": "^2.8.0", "@remix-run/eslint-config": "^2.8.0", - "@shopify/mini-oxygen": "^2.2.5", + "@shopify/mini-oxygen": "^3.0.0", "@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 e133348cf7..198a0635ea 100644 --- a/examples/partytown/package.json +++ b/examples/partytown/package.json @@ -17,9 +17,9 @@ "@builder.io/partytown": "^0.8.1", "@remix-run/react": "^2.8.0", "@shopify/cli": "3.58.0", - "@shopify/cli-hydrogen": "^7.1.2", + "@shopify/cli-hydrogen": "^8.0.0", "@shopify/hydrogen": "2024.4.0", - "@shopify/remix-oxygen": "^2.0.3", + "@shopify/remix-oxygen": "^2.0.4", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.6.6", @@ -29,7 +29,7 @@ "devDependencies": { "@remix-run/dev": "^2.8.0", "@remix-run/eslint-config": "^2.8.0", - "@shopify/mini-oxygen": "^2.2.5", + "@shopify/mini-oxygen": "^3.0.0", "@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 00172dcad7..e16f005222 100644 --- a/examples/subscriptions/package.json +++ b/examples/subscriptions/package.json @@ -14,9 +14,9 @@ "dependencies": { "@remix-run/react": "^2.8.0", "@shopify/cli": "3.58.0", - "@shopify/cli-hydrogen": "^7.1.2", + "@shopify/cli-hydrogen": "^8.0.0", "@shopify/hydrogen": "2024.4.0", - "@shopify/remix-oxygen": "^2.0.3", + "@shopify/remix-oxygen": "^2.0.4", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.6.6", @@ -26,7 +26,7 @@ "devDependencies": { "@remix-run/dev": "^2.8.0", "@remix-run/eslint-config": "^2.8.0", - "@shopify/mini-oxygen": "^2.2.5", + "@shopify/mini-oxygen": "^3.0.0", "@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 b37e8b8913..e35d575c46 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,75 @@ # @shopify/cli-hydrogen +## 8.0.0 + +### Major Changes + +- Hydrogen CLI now requires `@shopify/mini-oxygen` to be installed separately as a dev dependency. It is still used automatically under the hood so there is no need to change your application code aside from installing the dependency. ([#1891](https://github.com/Shopify/hydrogen/pull/1891)) by [@frandiox](https://github.com/frandiox) + + Also, if a port provided via `--port` or `--inspector-port` flags is already in use, the CLI will now exit with an error message instead of finding a new open port. When the flags are not provided, the CLI will still find an open port. + +### Minor Changes + +- Move the Hydrogen CLI's `env push` command to stable. ([#1946](https://github.com/Shopify/hydrogen/pull/1946)) by [@aswamy](https://github.com/aswamy) + +- Deprecate the `--env-branch` flag, in favor of `--env`. ([#1841](https://github.com/Shopify/hydrogen/pull/1841)) by [@aswamy](https://github.com/aswamy) + + - `--env` accepts the environment's handle, instead of the environment's associated branch name + - Run `env list` to display all environments and their handles + - Any CLI commands that accepted the `--env-branch` flag now accept the `--env` flag. + +- Support scaffolding projects from external repositories using the `--template` flag. ([#1867](https://github.com/Shopify/hydrogen/pull/1867)) by [@frandiox](https://github.com/frandiox) + + The following examples are equivalent: + + ```sh + npm create @shopify/hydrogen -- --template shopify/hydrogen-demo-store + npm create @shopify/hydrogen -- --template github.com/shopify/hydrogen-demo-store + npm create @shopify/hydrogen -- --template https://github.com/shopify/hydrogen-demo-store + ``` + +- 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) + +- Remove the `@shopify/cli-hydrogen/experimental-vite` import path in favor of `@shopify/hydrogen/vite` and `@shopify/mini-oxygen/vite`. ([#1935](https://github.com/Shopify/hydrogen/pull/1935)) by [@frandiox](https://github.com/frandiox) + +### Patch Changes + +- Avoid throwing error in `h2 dev --codegen` when the Customer Account schema is not found. ([#1962](https://github.com/Shopify/hydrogen/pull/1962)) by [@frandiox](https://github.com/frandiox) + +- Bump internal workerd dependency to fix a bug when running on Node 21. ([#1866](https://github.com/Shopify/hydrogen/pull/1866)) by [@frandiox](https://github.com/frandiox) + +- Support Node's `NODE_TLS_REJECT_UNAUTHORIZED` and `NODE_EXTRA_CA_CERTS` [environment variables](https://nodejs.org/api/cli.html#environment-variables) in the worker environment. ([#1882](https://github.com/Shopify/hydrogen/pull/1882)) by [@frandiox](https://github.com/frandiox) + + Use this at your own risk to disable certificate validation or provide additional CA certificates when making HTTPS requests from the worker: + + ```sh + # Disable certificate validation + NODE_TLS_REJECT_UNAUTHORIZED=0 npm run dev + + # Provide additional CA certificates + NODE_EXTRA_CA_CERTS=/usr/.../ca-certificates/my-file.crt npm run dev + ``` + +- Add `--quickstart` flag option to init/create command. ([#1822](https://github.com/Shopify/hydrogen/pull/1822)) by [@gfscott](https://github.com/gfscott) + +- Add a newline after the `h2` alias created in ZSH/Bash profiles. ([#1950](https://github.com/Shopify/hydrogen/pull/1950)) by [@madmath](https://github.com/madmath) + +- Fix the `--markets` flag when using `npm create @shopify/hydrogen`. ([#1916](https://github.com/Shopify/hydrogen/pull/1916)) by [@frandiox](https://github.com/frandiox) + +- Handle duplicate storefront names when running `link` command. ([#1860](https://github.com/Shopify/hydrogen/pull/1860)) by [@gfscott](https://github.com/gfscott) + +- List uncommitted files in the `deploy` command's "uncommitted changes" error message. ([#1944](https://github.com/Shopify/hydrogen/pull/1944)) by [@graygilmore](https://github.com/graygilmore) + +- Improve `h2 setup vite` command to cover more migration steps (e.g. vanilla-extract, css-modules, etc.) and keep Remix future flags. ([#1915](https://github.com/Shopify/hydrogen/pull/1915)) by [@frandiox](https://github.com/frandiox) + +- Add `--verbose` flag to `h2 dev` and `h2 preview` commands to enable verbose logging. ([#1928](https://github.com/Shopify/hydrogen/pull/1928)) by [@frandiox](https://github.com/frandiox) + + Only CLI logs become verbose by default. If you also want to see verbose logs from Vite as well, use `DEBUG=* h2 dev` instead. + +- Updated dependencies [[`646b78d4`](https://github.com/Shopify/hydrogen/commit/646b78d4bc26310121b16000ed4d1c5d5e63957d), [`140e4768`](https://github.com/Shopify/hydrogen/commit/140e4768c880aaed4ba95b1d4c707df6963e011c), [`ebaf5529`](https://github.com/Shopify/hydrogen/commit/ebaf5529287b24a70b3146444b18f95b64f9f336)]: + - @shopify/hydrogen-codegen@0.3.0 + - @shopify/mini-oxygen@3.0.0 + ## 7.1.2 ### Patch Changes diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index e2cc5af308..6e5a5a439a 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1805,5 +1805,5 @@ ] } }, - "version": "7.1.2" + "version": "8.0.0" } \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index f1966c48fe..7c2920e843 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "7.1.2", + "version": "8.0.0", "license": "MIT", "type": "module", "scripts": { @@ -59,8 +59,8 @@ "peerDependencies": { "@graphql-codegen/cli": "^5.0.2", "@remix-run/dev": "^2.1.0", - "@shopify/hydrogen-codegen": "^0.2.2", - "@shopify/mini-oxygen": "^2.2.5", + "@shopify/hydrogen-codegen": "^0.3.0", + "@shopify/mini-oxygen": "^3.0.0", "graphql-config": "^5.0.3", "vite": "^5.1.0" }, diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md index 53cf7bb1d6..608f5f0a23 100644 --- a/packages/create-hydrogen/CHANGELOG.md +++ b/packages/create-hydrogen/CHANGELOG.md @@ -1,5 +1,14 @@ # @shopify/create-hydrogen +## 4.3.6 + +### Patch Changes + +- Add `--quickstart` flag option to init/create command. ([#1822](https://github.com/Shopify/hydrogen/pull/1822)) by [@gfscott](https://github.com/gfscott) + +- Updated dependencies [[`4eaec272`](https://github.com/Shopify/hydrogen/commit/4eaec272696f1a718aa7cab1070a54385ebc3686), [`646b78d4`](https://github.com/Shopify/hydrogen/commit/646b78d4bc26310121b16000ed4d1c5d5e63957d), [`5f1295fe`](https://github.com/Shopify/hydrogen/commit/5f1295fe60b86396f364fefef339248a444c988a), [`11879b17`](https://github.com/Shopify/hydrogen/commit/11879b175d78e3326de090a56a044d1e55d0bae8), [`788d86b3`](https://github.com/Shopify/hydrogen/commit/788d86b3a737bff53b4ec3aa9667458b2d45ade7), [`da95bb1c`](https://github.com/Shopify/hydrogen/commit/da95bb1c8c644f450053ce649b40dc380e7375dc), [`5bb43304`](https://github.com/Shopify/hydrogen/commit/5bb43304c08427786cfd4f2529e59bd38f593252), [`140e4768`](https://github.com/Shopify/hydrogen/commit/140e4768c880aaed4ba95b1d4c707df6963e011c), [`b3323e59`](https://github.com/Shopify/hydrogen/commit/b3323e59a4381647f1df797c5dc54793f6e0a29a), [`ab0df5a5`](https://github.com/Shopify/hydrogen/commit/ab0df5a52bc587515880ae26f4edd18ba2be83cd), [`ebaf5529`](https://github.com/Shopify/hydrogen/commit/ebaf5529287b24a70b3146444b18f95b64f9f336), [`a5511cd7`](https://github.com/Shopify/hydrogen/commit/a5511cd7bf9b0f0c4ef0e52cd72418f78c04785b), [`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)]: + - @shopify/cli-hydrogen@8.0.0 + ## 4.3.5 ### Patch Changes diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json index a0eea8052a..d5b9036fb4 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.5", + "version": "4.3.6", "type": "module", "scripts": { "build": "tsup --clean", @@ -13,7 +13,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@shopify/cli-hydrogen": "^7.1.0" + "@shopify/cli-hydrogen": "^8.0.0" }, "bin": "dist/create-app.js", "files": [ diff --git a/packages/hydrogen-codegen/CHANGELOG.md b/packages/hydrogen-codegen/CHANGELOG.md index c6fdd2d73c..38e984f9bd 100644 --- a/packages/hydrogen-codegen/CHANGELOG.md +++ b/packages/hydrogen-codegen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/hydrogen-codegen +## 0.3.0 + +### Minor Changes + +- Remove deprecated `schema` export. Use `getSchema('storefront')` instead. ([#1962](https://github.com/Shopify/hydrogen/pull/1962)) by [@frandiox](https://github.com/frandiox) + ## 0.2.2 ### Patch Changes diff --git a/packages/hydrogen-codegen/package.json b/packages/hydrogen-codegen/package.json index b5bb7d9ee7..9ec6c2d212 100644 --- a/packages/hydrogen-codegen/package.json +++ b/packages/hydrogen-codegen/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "0.2.2", + "version": "0.3.0", "license": "MIT", "type": "module", "main": "dist/cjs/index.cjs", diff --git a/packages/hydrogen-react/CHANGELOG.md b/packages/hydrogen-react/CHANGELOG.md index e7607db3f5..275c2bf527 100644 --- a/packages/hydrogen-react/CHANGELOG.md +++ b/packages/hydrogen-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @shopify/hydrogen-react +## 2024.4.0 + +### Patch Changes + +- Introducing `` that also includes Shopify analytics, Customer Privacy API and Privacy banner ([#1789](https://github.com/Shopify/hydrogen/pull/1789)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Fall back to "mock.shop" when no value is passed in `storeDomain` to `createStorefrontClient` in development. ([#1971](https://github.com/Shopify/hydrogen/pull/1971)) by [@frandiox](https://github.com/frandiox) + +- Expose `cartReady` state from the cart context. ([#1885](https://github.com/Shopify/hydrogen/pull/1885)) by [@celsowhite](https://github.com/celsowhite) + ## 2024.1.1 ### Patch Changes diff --git a/packages/hydrogen/CHANGELOG.md b/packages/hydrogen/CHANGELOG.md index a49b5cdce0..e126a43406 100644 --- a/packages/hydrogen/CHANGELOG.md +++ b/packages/hydrogen/CHANGELOG.md @@ -1,5 +1,173 @@ # @shopify/hydrogen +## 2024.4.0 + +### Minor Changes + +- Change `storefrontRedirect` to ignore query parameters when matching redirects. For example, a redirect in the admin from `/snowboards` to `/collections/snowboards` will now match on the URL `/snowboards?utm_campaign=buffer` and redirect the user to `/collections/snowboards?utm_campaign=buffer`. ([#1900](https://github.com/Shopify/hydrogen/pull/1900)) by [@blittle](https://github.com/blittle) + + This is a breaking change. If you want to retain the legacy functionality that is query parameter sensitive, pass `matchQueryParams` to `storefrontRedirect()`: + + ```ts + storefrontRedirect({ + request, + response, + storefront, + matchQueryParams: true, + }); + ``` + +### Patch Changes + +- Make `StorefrontRedirect` case insensitive when querying redirect URLs from the Storefront API. ([#1941](https://github.com/Shopify/hydrogen/pull/1941)) by [@blittle](https://github.com/blittle) + +- Fix bug where `storefrontRedirect` would return an error on soft page navigations. ([#1880](https://github.com/Shopify/hydrogen/pull/1880)) by [@blittle](https://github.com/blittle) + +- Fix a bug where `cart` could be null, even though a new cart was created by adding a line item. ([#1865](https://github.com/Shopify/hydrogen/pull/1865)) by [@blittle](https://github.com/blittle) + + This allows calling the cart `.get()` method right after creating a new cart with + one of the mutation methods: `create()`, `addLines()`, `updateDiscountCodes()`, `updateBuyerIdentity()`, `updateNote()`, `updateAttributes()`, `setMetafields()`. + + ```ts + import { + createCartHandler, + cartGetIdDefault, + cartSetIdDefault, + } from '@shopify/hydrogen'; + + const cartHandler = createCartHandler({ + storefront, + getCartId: cartGetIdDefault(request.headers), + setCartId: cartSetIdDefault(), + cartQueryFragment: CART_QUERY_FRAGMENT, + cartMutateFragment: CART_MUTATE_FRAGMENT, + }); + + await cartHandler.addLines([{merchandiseId: '...'}]); + // .get() now returns the cart as expected + const cart = await cartHandler.get(); + ``` + +- Add `postLogoutRedirectUri` option to the Customer Account API client's logout method. ([#1871](https://github.com/Shopify/hydrogen/pull/1871)) by [@michenly](https://github.com/michenly) + +- Introducing `` that also includes Shopify analytics, Customer Privacy API and Privacy banner ([#1789](https://github.com/Shopify/hydrogen/pull/1789)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Export new Hydrogen Vite plugin from `@shopify/hydrogen/vite`. ([#1935](https://github.com/Shopify/hydrogen/pull/1935)) by [@frandiox](https://github.com/frandiox) + +- 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) + +- Fix default content security policy directive for `frameAncestors`. ([#1883](https://github.com/Shopify/hydrogen/pull/1883)) by [@blittle](https://github.com/blittle) + +- Fall back to "mock.shop" when no value is passed in `storeDomain` to `createStorefrontClient` in development. ([#1971](https://github.com/Shopify/hydrogen/pull/1971)) by [@frandiox](https://github.com/frandiox) + +- Allow `ui_locale` to be passed to the customer account login page. ([#1842](https://github.com/Shopify/hydrogen/pull/1842)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Deprecate the `` component in favor of directly using Remix [meta route exports](https://remix.run/docs/en/main/route/meta). Add the `getSeoMeta` to make migration easier. ([#1875](https://github.com/Shopify/hydrogen/pull/1875)) by [@blittle](https://github.com/blittle) + + ### Migration steps: + + **1. Remove the `` component from `root.jsx`:** + + ```diff + export default function App() { + const nonce = useNonce(); + const data = useLoaderData(); + + return ( + + + + + - + + + + + + + + + + + + + ); + } + + ``` + + **2. Add a Remix meta export to each route that returns an `seo` property from a `loader` or `handle`:** + + ```diff + +import {getSeoMeta} from '@shopify/hydrogen'; + + export async function loader({context}) { + const {shop} = await context.storefront.query(` + query layout { + shop { + name + description + } + } + `); + + return { + seo: { + title: shop.title, + description: shop.description, + }, + }; + } + + +export const meta = ({data}) => { + + return getSeoMeta(data.seo); + +}; + ``` + + **3. Merge root route meta data** + + If your root route loader also returns an `seo` property, make sure to merge that data: + + ```ts + export const meta = ({data, matches}) => { + return getSeoMeta( + matches[0].data.seo, + // the current route seo data overrides the root route data + data.seo, + ); + }; + ``` + + Or more simply: + + ```ts + export const meta = ({data, matches}) => { + return getSeoMeta(...matches.map((match) => match.data.seo)); + }; + ``` + + **4. Override meta** + + Sometimes `getSeoMeta` might produce a property in a way you'd like to change. Map over the resulting array to change it. For example, Hydrogen removes query parameters from canonical URLs, add them back: + + ```ts + export const meta = ({data, location}) => { + return getSeoMeta(data.seo).map((meta) => { + if (meta.rel === 'canonical') { + return { + ...meta, + href: meta.href + location.search, + }; + } + + return meta; + }); + }; + ``` + +- Updated dependencies [[`f4d6e5b0`](https://github.com/Shopify/hydrogen/commit/f4d6e5b0244392a7c13b9fa51c5046fd103c3e4f), [`a209019f`](https://github.com/Shopify/hydrogen/commit/a209019f722ece4b65f8d5f37c8018c949956b1e), [`e50f4349`](https://github.com/Shopify/hydrogen/commit/e50f4349b665a1ff547a8d6229a6269157d867bd)]: + - @shopify/hydrogen-react@2024.4.0 + ## 2024.1.4 ### Patch Changes diff --git a/packages/hydrogen/src/version.ts b/packages/hydrogen/src/version.ts index 12a1dfcf0b..50c788a9f4 100644 --- a/packages/hydrogen/src/version.ts +++ b/packages/hydrogen/src/version.ts @@ -1 +1 @@ -export const LIB_VERSION = '2024.1.4'; +export const LIB_VERSION = '2024.4.0'; diff --git a/packages/mini-oxygen/CHANGELOG.md b/packages/mini-oxygen/CHANGELOG.md index 2a3291403a..167bad1963 100644 --- a/packages/mini-oxygen/CHANGELOG.md +++ b/packages/mini-oxygen/CHANGELOG.md @@ -1,5 +1,43 @@ # @shopify/mini-oxygen +## 3.0.0 + +### Major Changes + +- The default runtime exported from `@shopify/mini-oxygen` is now based on workerd. ([#1891](https://github.com/Shopify/hydrogen/pull/1891)) by [@frandiox](https://github.com/frandiox) + + The previous Node.js sandbox runtime has been moved to the `@shopify/mini-oxygen/node` export. + + Example usage: + + ```js + import {createMiniOxygen} from '@shopify/mini-oxygen'; + + const miniOxygen = createMiniOxygen({ + workers: [ + { + name: 'main', + modules: true, + script: `export default { + async fetch() { + const response = await fetch("https://hydrogen.shopify.dev"); + return response; + } + }`, + }, + ], + }); + + const response = await miniOxygen.dispatchFetch('http://placeholder'); + console.log(await response.text()); + + await miniOxygen.dispose(); + ``` + +### Minor Changes + +- Export new Vite plugin from `@shopify/mini-oxygen/vite`. It integrates Vite with MiniOxygen by running the application code within a worker. ([#1935](https://github.com/Shopify/hydrogen/pull/1935)) by [@frandiox](https://github.com/frandiox) + ## 2.2.5 ### Patch Changes diff --git a/packages/mini-oxygen/package.json b/packages/mini-oxygen/package.json index 73b2f19e75..79d0987d2b 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": "2.2.5", + "version": "3.0.0", "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 ce5f9a0553..31ce34d1a6 100644 --- a/packages/remix-oxygen/CHANGELOG.md +++ b/packages/remix-oxygen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/remix-oxygen +## 2.0.4 + +### Patch Changes + +- Fix compatibility of `/subrequest-profiler` with Vite. ([#1935](https://github.com/Shopify/hydrogen/pull/1935)) by [@frandiox](https://github.com/frandiox) + ## 2.0.3 ### Patch Changes diff --git a/packages/remix-oxygen/package.json b/packages/remix-oxygen/package.json index b9b21622cb..d7cfc61e38 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.3", + "version": "2.0.4", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", diff --git a/templates/hello-world/package.json b/templates/hello-world/package.json index 2a8762220e..83fae20809 100644 --- a/templates/hello-world/package.json +++ b/templates/hello-world/package.json @@ -15,9 +15,9 @@ "@remix-run/react": "^2.8.0", "@remix-run/server-runtime": "^2.8.0", "@shopify/cli": "3.58.0", - "@shopify/cli-hydrogen": "^7.1.2", + "@shopify/cli-hydrogen": "^8.0.0", "@shopify/hydrogen": "2024.4.0", - "@shopify/remix-oxygen": "^2.0.3", + "@shopify/remix-oxygen": "^2.0.4", "@total-typescript/ts-reset": "^0.4.2", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", @@ -27,7 +27,7 @@ }, "devDependencies": { "@remix-run/dev": "^2.8.0", - "@shopify/mini-oxygen": "^2.2.5", + "@shopify/mini-oxygen": "^3.0.0", "@shopify/oxygen-workers-types": "^4.0.0", "@shopify/prettier-config": "^1.1.2", "@types/eslint": "^8.4.10", diff --git a/templates/skeleton/CHANGELOG.md b/templates/skeleton/CHANGELOG.md index f7b37d69f1..4c5b1f266d 100644 --- a/templates/skeleton/CHANGELOG.md +++ b/templates/skeleton/CHANGELOG.md @@ -1,5 +1,94 @@ # skeleton +## 1.0.7 + +### Patch Changes + +- Update internal libraries for parsing `.env` files. ([#1946](https://github.com/Shopify/hydrogen/pull/1946)) by [@aswamy](https://github.com/aswamy) + + Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies: + + ```diff + "dependencies": { + - "@shopify/cli": "3.56.3", + + "@shopify/cli": "3.58.0", + } + ``` + +- Add Adds magic Catalog route ([#1967](https://github.com/Shopify/hydrogen/pull/1967)) by [@juanpprieto](https://github.com/juanpprieto) + +- 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) + + ```diff + -import {hydrogen, oxygen} from '@shopify/cli-hydrogen/experimental-vite'; + +import {hydrogen} from '@shopify/hydrogen/vite'; + +import {oxygen} from '@shopify/mini-oxygen/vite'; + import {vitePlugin as remix} from '@remix-run/dev'; + + export default defineConfig({ + hydrogen(), + oxygen(), + remix({ + - buildDirectory: 'dist', + + presets: [hydrogen.preset()], + future: { + ``` + +- 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) + + ```diff + "devDependencies": { + "@remix-run/dev": "^2.8.0", + "@remix-run/eslint-config": "^2.8.0", + + "@shopify/mini-oxygen": "^3.0.0", + "@shopify/oxygen-workers-types": "^4.0.0", + ... + }, + ``` + +- 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) + +- Fix types returned by the `session` object. ([#1869](https://github.com/Shopify/hydrogen/pull/1869)) by [@frandiox](https://github.com/frandiox) + + In `remix.env.d.ts` or `env.d.ts`, add the following types: + + ```diff + import type { + // ... + HydrogenCart, + + HydrogenSessionData, + } from '@shopify/hydrogen'; + + // ... + + declare module '@shopify/remix-oxygen' { + // ... + + + interface SessionData extends HydrogenSessionData {} + } + ``` + +- Codegen dependencies must be now listed explicitly in `package.json`: ([#1962](https://github.com/Shopify/hydrogen/pull/1962)) by [@frandiox](https://github.com/frandiox) + + ```diff + { + "devDependencies": { + + "@graphql-codegen/cli": "5.0.2", + "@remix-run/dev": "^2.8.0", + "@remix-run/eslint-config": "^2.8.0", + + "@shopify/hydrogen-codegen": "^0.3.0", + "@shopify/mini-oxygen": "^2.2.5", + "@shopify/oxygen-workers-types": "^4.0.0", + ... + } + } + ``` + +- 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)]: + - @shopify/cli-hydrogen@8.0.0 + - @shopify/hydrogen@2024.4.0 + - @shopify/remix-oxygen@2.0.4 + ## 1.0.6 ### Patch Changes diff --git a/templates/skeleton/package.json b/templates/skeleton/package.json index bf9fc76da6..d819a830ba 100644 --- a/templates/skeleton/package.json +++ b/templates/skeleton/package.json @@ -2,7 +2,7 @@ "name": "skeleton", "private": true, "sideEffects": false, - "version": "1.0.6", + "version": "1.0.7", "type": "module", "scripts": { "build": "shopify hydrogen build --codegen", @@ -17,9 +17,9 @@ "@remix-run/react": "^2.8.0", "@remix-run/server-runtime": "^2.8.0", "@shopify/cli": "3.58.0", - "@shopify/cli-hydrogen": "^7.1.2", + "@shopify/cli-hydrogen": "^8.0.0", "@shopify/hydrogen": "2024.4.0", - "@shopify/remix-oxygen": "^2.0.3", + "@shopify/remix-oxygen": "^2.0.4", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.8.0", @@ -30,8 +30,8 @@ "@graphql-codegen/cli": "5.0.2", "@remix-run/dev": "^2.8.0", "@remix-run/eslint-config": "^2.8.0", - "@shopify/hydrogen-codegen": "^0.2.2", - "@shopify/mini-oxygen": "^2.2.5", + "@shopify/hydrogen-codegen": "^0.3.0", + "@shopify/mini-oxygen": "^3.0.0", "@shopify/oxygen-workers-types": "^4.0.0", "@shopify/prettier-config": "^1.1.2", "@total-typescript/ts-reset": "^0.4.2",