diff --git a/.changeset/blue-beds-destroy.md b/.changeset/blue-beds-destroy.md deleted file mode 100644 index 79979c6d1f..0000000000 --- a/.changeset/blue-beds-destroy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix redirect bug diff --git a/.changeset/brown-lobsters-marry.md b/.changeset/brown-lobsters-marry.md deleted file mode 100644 index 070c1185a7..0000000000 --- a/.changeset/brown-lobsters-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -When generating Codegen, the CLI now looks first at the project GraphQL config (e.g. `.graphqlrc.yml` file) to find the documents for the Storefront API schema. diff --git a/.changeset/chatty-tomatoes-breathe.md b/.changeset/chatty-tomatoes-breathe.md deleted file mode 100644 index 4d6df26681..0000000000 --- a/.changeset/chatty-tomatoes-breathe.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -* Format code for improved readability contributed by @sanjaiyan-dev -* Fix ``'s `onPause` event listener diff --git a/.changeset/chilled-dogs-smash.md b/.changeset/chilled-dogs-smash.md deleted file mode 100644 index 17c2706643..0000000000 --- a/.changeset/chilled-dogs-smash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix type when passing custom methods to `createCartHandler`. diff --git a/.changeset/chilly-cycles-wink.md b/.changeset/chilly-cycles-wink.md deleted file mode 100644 index bdadbe5f76..0000000000 --- a/.changeset/chilly-cycles-wink.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -♻️ rename `createCustomerClient` to `createCustomerAccountClient` diff --git a/.changeset/chilly-moons-explode.md b/.changeset/chilly-moons-explode.md deleted file mode 100644 index 89a4c4271b..0000000000 --- a/.changeset/chilly-moons-explode.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/hydrogen-codegen': patch -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -♻️ renamed all customer reference to the API to customer-account diff --git a/.changeset/cool-chefs-battle.md b/.changeset/cool-chefs-battle.md deleted file mode 100644 index bab072a64f..0000000000 --- a/.changeset/cool-chefs-battle.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'skeleton': patch ---- - -Use new Storefront API parameters in 2024-01 to fix redirection to the product's default variant when there are unknown query params in the URL. - -```diff -- selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions) { -+ selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions, ignoreUnknownOptions: true, caseInsensitiveMatch: true) { - ...ProductVariant - } -``` diff --git a/.changeset/cool-shoes-shave.md b/.changeset/cool-shoes-shave.md deleted file mode 100644 index 05bb4b6685..0000000000 --- a/.changeset/cool-shoes-shave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -The `customerAccount` client now supports codegen types similar to the `storefront` client. diff --git a/.changeset/early-moose-whisper.md b/.changeset/early-moose-whisper.md deleted file mode 100644 index 8789983467..0000000000 --- a/.changeset/early-moose-whisper.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Minor update to the default organization of files and folders in the starter template. diff --git a/.changeset/early-planes-pump.md b/.changeset/early-planes-pump.md deleted file mode 100644 index 973305fd59..0000000000 --- a/.changeset/early-planes-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-react': patch ---- - -Added React.forwardRef to Video and ExternalVideo components diff --git a/.changeset/fifty-queens-obey.md b/.changeset/fifty-queens-obey.md deleted file mode 100644 index 1c17100743..0000000000 --- a/.changeset/fifty-queens-obey.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Improve warning logs for Customer Account client. diff --git a/.changeset/five-scissors-sniff.md b/.changeset/five-scissors-sniff.md deleted file mode 100644 index f55849515c..0000000000 --- a/.changeset/five-scissors-sniff.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/mini-oxygen': patch -'@shopify/cli-hydrogen': patch ---- - -Fixed step-debugging when running in MiniOxygen's Node.js sandbox diff --git a/.changeset/fluffy-houses-itch.md b/.changeset/fluffy-houses-itch.md deleted file mode 100644 index 2cfc953174..0000000000 --- a/.changeset/fluffy-houses-itch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -✨ add schema generation for customer account api in hydrogen-react and export these types in both hydrogen-react & hydrogen. Note the current CA API version is `2024-01` which is a release candidate and subject to change. diff --git a/.changeset/forty-bugs-think.md b/.changeset/forty-bugs-think.md deleted file mode 100644 index d2471c1d13..0000000000 --- a/.changeset/forty-bugs-think.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Remove hidden attribute from `deploy` command - -You can now deploy your Hydrogen storefront without connecting to GitHub. Run the `deploy` command from your local terminal or configure a CI/CD (e.g. Bitbucket) for continuous deployment. - -Run `h2 deploy --help` to see additional features of the command. diff --git a/.changeset/friendly-pens-marry.md b/.changeset/friendly-pens-marry.md deleted file mode 100644 index 2c74a6bc6b..0000000000 --- a/.changeset/friendly-pens-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-codegen': minor ---- - -Export type utilities to create GraphQL clients that can consume the types generated by this package. diff --git a/.changeset/fuzzy-phones-laugh.md b/.changeset/fuzzy-phones-laugh.md deleted file mode 100644 index aa9f755dbb..0000000000 --- a/.changeset/fuzzy-phones-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': major ---- - -The worker runtime, previously used with `--worker` flag, is now the default runtime in the `dev` and `preview` commands. The legacy Node.js sandbox runtime can still be used with the `--legacy-runtime` but will be removed in a future release. diff --git a/.changeset/gorgeous-bikes-admire.md b/.changeset/gorgeous-bikes-admire.md deleted file mode 100644 index c18519886e..0000000000 --- a/.changeset/gorgeous-bikes-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Fix the sourcemaps to be included on Oxygen deployments from the CLI diff --git a/.changeset/green-mice-hide.md b/.changeset/green-mice-hide.md deleted file mode 100644 index b5f08fcd24..0000000000 --- a/.changeset/green-mice-hide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Rely on server-side check for bundle size >10mb diff --git a/.changeset/grumpy-lemons-drive.md b/.changeset/grumpy-lemons-drive.md deleted file mode 100644 index 078a373351..0000000000 --- a/.changeset/grumpy-lemons-drive.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -'skeleton': patch ---- - -Updated the GraphQL config in `.graphqlrc.yml` to use the more modern `projects` structure: - -```diff --schema: node_modules/@shopify/hydrogen/storefront.schema.json -+projects: -+ default: -+ schema: 'node_modules/@shopify/hydrogen/storefront.schema.json' -``` - -This allows you to add additional projects to the GraphQL config, such as third party CMS schemas. - -Also, you can modify the document paths used for the Storefront API queries. This is useful if you have a large codebase and want to exclude certain files from being used for codegen or other GraphQL utilities: - -```yaml -projects: - default: - schema: 'node_modules/@shopify/hydrogen/storefront.schema.json' - documents: - - '!*.d.ts' - - '*.{ts,tsx,js,jsx}' - - 'app/**/*.{ts,tsx,js,jsx}' -``` diff --git a/.changeset/happy-pigs-collect.md b/.changeset/happy-pigs-collect.md deleted file mode 100644 index d899ca3b39..0000000000 --- a/.changeset/happy-pigs-collect.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': patch ---- - -Better Hydrogen error handling - -* Fix storefront client throwing on partial successful errors -* Fix subrequest profiler to better display network errors with url information for SFAPI requests - -### Breaking change - - Mutation methods of `createCartHandler` used to return an `errors` object that contains `userErrors`. This is now changed back to `userErrors` to be consistent with SFAPI schema. - - The `errors` object will now be used for Graphql execution errors. - - `storefront.isApiError` is deprecated. - - Updated types: - - * `cart.get()` used to return a `Cart` type. Now it returns `CartReturn` type to accommodate the `errors` object - * All other `cart` methods (ie. `cart.addLines`) used to return a `CartQueryData` type. Now it returns `CartQueryDataReturn` type to accommodate the `errors` object. diff --git a/.changeset/heavy-coins-tickle.md b/.changeset/heavy-coins-tickle.md deleted file mode 100644 index 1bdaa77374..0000000000 --- a/.changeset/heavy-coins-tickle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -💥 Change the behaviour of `createContentSecurityPolicy` where the custom rules passed in will extends the default Shopify and development domains instead of overriding them. diff --git a/.changeset/honest-hotels-cheer.md b/.changeset/honest-hotels-cheer.md deleted file mode 100644 index 074708e8c7..0000000000 --- a/.changeset/honest-hotels-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -🐛 fix content security policy for local enviorment for not recognizing localhost asset server as a valid policy diff --git a/.changeset/itchy-plums-return.md b/.changeset/itchy-plums-return.md deleted file mode 100644 index d939d756c4..0000000000 --- a/.changeset/itchy-plums-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Add undo instructions to the upgrade command diff --git a/.changeset/late-avocados-know.md b/.changeset/late-avocados-know.md deleted file mode 100644 index 14e07502dc..0000000000 --- a/.changeset/late-avocados-know.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-codegen': patch ---- - -Add a `name` property symbol to the preset to make it easier to identify in the CLI. diff --git a/.changeset/late-badgers-return.md b/.changeset/late-badgers-return.md deleted file mode 100644 index 622a7b3c89..0000000000 --- a/.changeset/late-badgers-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'skeleton': patch ---- - -Change the default HydrogenSession to be more robust in parsing session cookies diff --git a/.changeset/mean-foxes-hope.md b/.changeset/mean-foxes-hope.md deleted file mode 100644 index 1e89c42da8..0000000000 --- a/.changeset/mean-foxes-hope.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'skeleton': patch ---- - -Update `@shopify/cli` dependency in `package.json`: - -```diff -- "@shopify/cli": "3.51.0", -+ "@shopify/cli": "3.52.0", -``` diff --git a/.changeset/mighty-rivers-dance.md b/.changeset/mighty-rivers-dance.md deleted file mode 100644 index 93fb6098e9..0000000000 --- a/.changeset/mighty-rivers-dance.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@shopify/remix-oxygen': patch -'skeleton': patch -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch ---- - -* Update example and template Remix versions to `^2.5.1` -* Enable future flags: - * `v3_fetcherPersist` - - * `v3_relativeSplatpath` - diff --git a/.changeset/neat-falcons-add.md b/.changeset/neat-falcons-add.md deleted file mode 100644 index 4936d396ff..0000000000 --- a/.changeset/neat-falcons-add.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -'@shopify/remix-oxygen': patch -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch ---- - -Subrequest Profiler (stable) - Provides an overview of network requests happening on the server side - -#### How to use: - -1. Run `h2 dev` -2. Visit http://localhost:3000/subrequest-profiler - -#### Set request display name with `storefront.query`: - -```tsx -context.storefront.query( - HOMEPAGE_FEATURED_PRODUCTS_QUERY, - { - displayName: 'Feature products', - variables: { - country, - language, - }, - }, -) -``` - -#### Set request debug information with `createWithCache`: - -```tsx -const withCache = createWithCache({ - cache, - waitUntil, - request, -}); - -const data3p = async () => { - return await withCache( - ['Some unique cache keys'], - CacheLong(), - ({addDebugData}) => { - return fetch('https://some-3p-endpoint.com').then(async (response) => { - if (process.env.NODE_ENV === 'development') { - addDebugData({ - displayName: '3p endpoint display name', - response, - }); - } - - return await response.json(); - }); - }, - ); -}; -``` - diff --git a/.changeset/nine-zebras-swim.md b/.changeset/nine-zebras-swim.md deleted file mode 100644 index 59f49a5947..0000000000 --- a/.changeset/nine-zebras-swim.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix open-in-editor link from the Subrequest Profiler tool in subrequests to the Customer Account API. diff --git a/.changeset/ninety-lions-develop.md b/.changeset/ninety-lions-develop.md deleted file mode 100644 index 2f4a0abac8..0000000000 --- a/.changeset/ninety-lions-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -✨ Make customer client utility official. diff --git a/.changeset/old-waves-serve.md b/.changeset/old-waves-serve.md deleted file mode 100644 index 7aa2e3cf4d..0000000000 --- a/.changeset/old-waves-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Show link to docs in bundle size warning. diff --git a/.changeset/orange-grapes-raise.md b/.changeset/orange-grapes-raise.md deleted file mode 100644 index 7496444ac7..0000000000 --- a/.changeset/orange-grapes-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Filter out non-actionable warnings and errors during development. diff --git a/.changeset/polite-singers-joke.md b/.changeset/polite-singers-joke.md deleted file mode 100644 index 7be94ba612..0000000000 --- a/.changeset/polite-singers-joke.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix the `` component to render canonical URLs without trailing slashes. For example, both https://hydrogen.shop/collections/freestyle/ and https://hydrogen.shop/collections/freestyle return a canonical link of https://hydrogen.shop/collections/freestyle. - -Thank you @joshuafredrickson for reporting. diff --git a/.changeset/proud-buckets-swim.md b/.changeset/proud-buckets-swim.md deleted file mode 100644 index 36d49ace2d..0000000000 --- a/.changeset/proud-buckets-swim.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Add --preview flag to deploy command - -You can now explicitly deploy to the Preview environment with the `--preview` flag regardless of your current Git branch. For example, you can use this flag to test your changes before deploying to production if you're working off of your `main` branch. diff --git a/.changeset/quick-apes-pump.md b/.changeset/quick-apes-pump.md deleted file mode 100644 index 564c088b60..0000000000 --- a/.changeset/quick-apes-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': major ---- - -Remove deprecated CLI flags. diff --git a/.changeset/selfish-news-mix.md b/.changeset/selfish-news-mix.md deleted file mode 100644 index 6f456b2a7c..0000000000 --- a/.changeset/selfish-news-mix.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'skeleton': patch -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch ---- - -👩‍💻 improved HydrogenSession typing. - -In order to ensure utilies from @shopify/hydrogen will work properly using user implemented HydrogenSession class. We encourage the use of `HydrogenSession` type to ensure all the interface needed had been implemented. - -Update implementation of HydrogenSession using type - -```diff -import { -+ type HydrogenSession, -} from '@shopify/hydrogen'; -- class HydrogenSession { -+ class AppSession implements HydrogenSession { - ... -} -``` diff --git a/.changeset/shiny-cats-turn.md b/.changeset/shiny-cats-turn.md deleted file mode 100644 index f3367e4c7f..0000000000 --- a/.changeset/shiny-cats-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Enhance startup time of CLI when using `--worker` runtime. diff --git a/.changeset/shy-cheetahs-carry.md b/.changeset/shy-cheetahs-carry.md deleted file mode 100644 index 11cf5da569..0000000000 --- a/.changeset/shy-cheetahs-carry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Show link to docs in the terminal when debugging. diff --git a/.changeset/shy-poems-cheat.md b/.changeset/shy-poems-cheat.md deleted file mode 100644 index 2310c6160c..0000000000 --- a/.changeset/shy-poems-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-codegen': minor ---- - -Add default values to support the Customer Account API without configuration. diff --git a/.changeset/silly-vans-bake.md b/.changeset/silly-vans-bake.md deleted file mode 100644 index 221fc93531..0000000000 --- a/.changeset/silly-vans-bake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Add `--diff` flag to dev and build commands to run examples in monorepo. Examples are now a diff applied on top of the starter template. diff --git a/.changeset/strong-cars-run.md b/.changeset/strong-cars-run.md deleted file mode 100644 index 871c22678c..0000000000 --- a/.changeset/strong-cars-run.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'skeleton': patch -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch ---- - -Update to SFAPI 2024-01 diff --git a/.changeset/tasty-plums-pump.md b/.changeset/tasty-plums-pump.md deleted file mode 100644 index 7bbc218628..0000000000 --- a/.changeset/tasty-plums-pump.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'skeleton': patch -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': patch ---- - -✨ Use the new Customer Account API in the account section of the skeleton template - -✨ Add an `authUrl` option to `createCustomerClient` that defines the route in your app that authorizes a user after logging in. The default value is `/account/authorize`. - -✨ Add an optional `redirectPath` parameter to customer client's login method. This param defines the final path the user lands on at the end of the oAuth flow. It defaults to `/` diff --git a/.changeset/ten-singers-rhyme.md b/.changeset/ten-singers-rhyme.md deleted file mode 100644 index 867ce6d0eb..0000000000 --- a/.changeset/ten-singers-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -Support scaffolding projects based on examples in Hydrogen repo using the `--template` flag. Example: `npm create @shopify/hydrogen@latest -- --template multipass`. diff --git a/.changeset/tender-cooks-dance.md b/.changeset/tender-cooks-dance.md deleted file mode 100644 index d41be0b300..0000000000 --- a/.changeset/tender-cooks-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Update cli-kit dependency for bug fixes. diff --git a/.changeset/thirty-ravens-work.md b/.changeset/thirty-ravens-work.md deleted file mode 100644 index 2cc5f07fd8..0000000000 --- a/.changeset/thirty-ravens-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Update to the latest worker runtime version. diff --git a/.changeset/three-taxis-bow.md b/.changeset/three-taxis-bow.md deleted file mode 100644 index d1620728ad..0000000000 --- a/.changeset/three-taxis-bow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -✨ add a utility `getAccessToken` to customerClient diff --git a/.changeset/tidy-starfishes-warn.md b/.changeset/tidy-starfishes-warn.md deleted file mode 100644 index 95e266b0fa..0000000000 --- a/.changeset/tidy-starfishes-warn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Fix error stack traces thrown from Storefront API and Customer Account API clients when promises are not awaited. diff --git a/.changeset/tiny-shrimps-itch.md b/.changeset/tiny-shrimps-itch.md deleted file mode 100644 index 0cfe98c518..0000000000 --- a/.changeset/tiny-shrimps-itch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch ---- - -Run prettier in all the generated codegen files that use the Hydrogen preset, not only for Storefront API. diff --git a/.changeset/wet-mangos-tease.md b/.changeset/wet-mangos-tease.md deleted file mode 100644 index 7b45d686a1..0000000000 --- a/.changeset/wet-mangos-tease.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@shopify/cli-hydrogen': major ---- - -Remove --publicDeployment flag from deploy command - -The ability to mark individual deployments as public has been deprecated. If you need deployments to be accessible by other services for the purposes of end-to-end testing you can make use of the newly added `--auth-bypass-token` flag. diff --git a/examples/express/package.json b/examples/express/package.json index f67aa48851..d9d4a8f180 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -16,7 +16,7 @@ "@remix-run/node": "^2.5.1", "@remix-run/react": "^2.5.1", "@remix-run/server-runtime": "^2.5.1", - "@shopify/hydrogen": "2024.1.0", + "@shopify/hydrogen": "2024.1.1", "compression": "^1.7.4", "cross-env": "^7.0.3", "express": "^4.18.2", @@ -29,7 +29,7 @@ "@remix-run/dev": "^2.5.1", "@remix-run/eslint-config": "^2.5.1", "@shopify/cli": "3.52.0", - "@shopify/cli-hydrogen": "^6.1.0", + "@shopify/cli-hydrogen": "^7.0.0", "@types/compression": "^1.7.2", "@types/express": "^4.17.17", "@types/morgan": "^1.9.4", diff --git a/examples/multipass/package.json b/examples/multipass/package.json index 0985dfd752..98d375b467 100644 --- a/examples/multipass/package.json +++ b/examples/multipass/package.json @@ -14,9 +14,9 @@ "dependencies": { "@remix-run/react": "^2.5.1", "@shopify/cli": "3.50.0", - "@shopify/cli-hydrogen": "^6.1.0", - "@shopify/hydrogen": "^2024.1.0", - "@shopify/remix-oxygen": "^2.0.2", + "@shopify/cli-hydrogen": "^7.0.0", + "@shopify/hydrogen": "^2024.1.1", + "@shopify/remix-oxygen": "^2.0.3", "crypto-js": "^4.2.0", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", diff --git a/examples/subscriptions/package.json b/examples/subscriptions/package.json index 1d3362f9cf..2953ae7898 100644 --- a/examples/subscriptions/package.json +++ b/examples/subscriptions/package.json @@ -14,9 +14,9 @@ "dependencies": { "@remix-run/react": "^2.5.1", "@shopify/cli": "^3.51.0", - "@shopify/cli-hydrogen": "^6.1.0", - "@shopify/hydrogen": "^2024.1.0", - "@shopify/remix-oxygen": "^2.0.2", + "@shopify/cli-hydrogen": "^7.0.0", + "@shopify/hydrogen": "^2024.1.1", + "@shopify/remix-oxygen": "^2.0.3", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.6.6", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index e9beb38e2d..bc3d088850 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,163 @@ # @shopify/cli-hydrogen +## 7.0.0 + +### Major Changes + +- The worker runtime, previously used with `--worker` flag, is now the default runtime in the `dev` and `preview` commands. The legacy Node.js sandbox runtime can still be used with the `--legacy-runtime` but will be removed in a future release. ([#1625](https://github.com/Shopify/hydrogen/pull/1625)) by [@frandiox](https://github.com/frandiox) + +- Remove deprecated CLI flags. ([#1640](https://github.com/Shopify/hydrogen/pull/1640)) by [@frandiox](https://github.com/frandiox) + +- Remove --publicDeployment flag from deploy command ([#1628](https://github.com/Shopify/hydrogen/pull/1628)) by [@graygilmore](https://github.com/graygilmore) + + The ability to mark individual deployments as public has been deprecated. If you need deployments to be accessible by other services for the purposes of end-to-end testing you can make use of the newly added `--auth-bypass-token` flag. + +### Minor Changes + +- When generating Codegen, the CLI now looks first at the project GraphQL config (e.g. `.graphqlrc.yml` file) to find the documents for the Storefront API schema. ([#1577](https://github.com/Shopify/hydrogen/pull/1577)) by [@frandiox](https://github.com/frandiox) + +- Add `--diff` flag to dev and build commands to run examples in monorepo. Examples are now a diff applied on top of the starter template. ([#1549](https://github.com/Shopify/hydrogen/pull/1549)) by [@frandiox](https://github.com/frandiox) + +- Support scaffolding projects based on examples in Hydrogen repo using the `--template` flag. Example: `npm create @shopify/hydrogen@latest -- --template multipass`. ([#1608](https://github.com/Shopify/hydrogen/pull/1608)) by [@frandiox](https://github.com/frandiox) + +### Patch Changes + +- Minor update to the default organization of files and folders in the starter template. ([#1612](https://github.com/Shopify/hydrogen/pull/1612)) by [@frandiox](https://github.com/frandiox) + +- Improve warning logs for Customer Account client. ([#1665](https://github.com/Shopify/hydrogen/pull/1665)) by [@frandiox](https://github.com/frandiox) + +- Fixed step-debugging when running in MiniOxygen's Node.js sandbox ([#1501](https://github.com/Shopify/hydrogen/pull/1501)) by [@frandiox](https://github.com/frandiox) + +- Remove hidden attribute from `deploy` command ([#1628](https://github.com/Shopify/hydrogen/pull/1628)) by [@graygilmore](https://github.com/graygilmore) + + You can now deploy your Hydrogen storefront without connecting to GitHub. Run the `deploy` command from your local terminal or configure a CI/CD (e.g. Bitbucket) for continuous deployment. + + Run `h2 deploy --help` to see additional features of the command. + +- Fix the sourcemaps to be included on Oxygen deployments from the CLI ([#1623](https://github.com/Shopify/hydrogen/pull/1623)) by [@blittle](https://github.com/blittle) + +- Rely on server-side check for bundle size >10mb ([#1614](https://github.com/Shopify/hydrogen/pull/1614)) by [@benwolfram](https://github.com/benwolfram) + +- Better Hydrogen error handling ([#1645](https://github.com/Shopify/hydrogen/pull/1645)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Fix storefront client throwing on partial successful errors + - Fix subrequest profiler to better display network errors with url information for SFAPI requests + + ### Breaking change + + Mutation methods of `createCartHandler` used to return an `errors` object that contains `userErrors`. This is now changed back to `userErrors` to be consistent with SFAPI schema. + + The `errors` object will now be used for Graphql execution errors. + + `storefront.isApiError` is deprecated. + + Updated types: + + - `cart.get()` used to return a `Cart` type. Now it returns `CartReturn` type to accommodate the `errors` object + - All other `cart` methods (ie. `cart.addLines`) used to return a `CartQueryData` type. Now it returns `CartQueryDataReturn` type to accommodate the `errors` object. + +- Add undo instructions to the upgrade command ([#1643](https://github.com/Shopify/hydrogen/pull/1643)) by [@juanpprieto](https://github.com/juanpprieto) + +- - Update example and template Remix versions to `^2.5.1` ([#1639](https://github.com/Shopify/hydrogen/pull/1639)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Enable future flags: + - `v3_fetcherPersist` - + - `v3_relativeSplatpath` - + +- Subrequest Profiler (stable) - Provides an overview of network requests happening on the server side ([#1511](https://github.com/Shopify/hydrogen/pull/1511)) by [@wizardlyhel](https://github.com/wizardlyhel) + + #### How to use: + + 1. Run `h2 dev` + 2. Visit http://localhost:3000/subrequest-profiler + + #### Set request display name with `storefront.query`: + + ```tsx + context.storefront.query(HOMEPAGE_FEATURED_PRODUCTS_QUERY, { + displayName: 'Feature products', + variables: { + country, + language, + }, + }); + ``` + + #### Set request debug information with `createWithCache`: + + ```tsx + const withCache = createWithCache({ + cache, + waitUntil, + request, + }); + + const data3p = async () => { + return await withCache( + ['Some unique cache keys'], + CacheLong(), + ({addDebugData}) => { + return fetch('https://some-3p-endpoint.com').then(async (response) => { + if (process.env.NODE_ENV === 'development') { + addDebugData({ + displayName: '3p endpoint display name', + response, + }); + } + + return await response.json(); + }); + }, + ); + }; + ``` + +- Show link to docs in bundle size warning. ([#1655](https://github.com/Shopify/hydrogen/pull/1655)) by [@frandiox](https://github.com/frandiox) + +- Filter out non-actionable warnings and errors during development. ([#1664](https://github.com/Shopify/hydrogen/pull/1664)) by [@frandiox](https://github.com/frandiox) + +- Add --preview flag to deploy command ([#1628](https://github.com/Shopify/hydrogen/pull/1628)) by [@graygilmore](https://github.com/graygilmore) + + You can now explicitly deploy to the Preview environment with the `--preview` flag regardless of your current Git branch. For example, you can use this flag to test your changes before deploying to production if you're working off of your `main` branch. + +- 👩‍💻 improved HydrogenSession typing. ([#1590](https://github.com/Shopify/hydrogen/pull/1590)) by [@michenly](https://github.com/michenly) + + In order to ensure utilies from @shopify/hydrogen will work properly using user implemented HydrogenSession class. We encourage the use of `HydrogenSession` type to ensure all the interface needed had been implemented. + + Update implementation of HydrogenSession using type + + ```diff + import { + + type HydrogenSession, + } from '@shopify/hydrogen'; + - class HydrogenSession { + + class AppSession implements HydrogenSession { + ... + } + ``` + +- Enhance startup time of CLI when using `--worker` runtime. ([#1560](https://github.com/Shopify/hydrogen/pull/1560)) by [@frandiox](https://github.com/frandiox) + +- Show link to docs in the terminal when debugging. ([#1568](https://github.com/Shopify/hydrogen/pull/1568)) by [@frandiox](https://github.com/frandiox) + +- Update to SFAPI 2024-01 ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- ✨ Use the new Customer Account API in the account section of the skeleton template ([#1576](https://github.com/Shopify/hydrogen/pull/1576)) by [@michenly](https://github.com/michenly) + + ✨ Add an `authUrl` option to `createCustomerClient` that defines the route in your app that authorizes a user after logging in. The default value is `/account/authorize`. + + ✨ Add an optional `redirectPath` parameter to customer client's login method. This param defines the final path the user lands on at the end of the oAuth flow. It defaults to `/` + +- Update cli-kit dependency for bug fixes. ([#1579](https://github.com/Shopify/hydrogen/pull/1579)) by [@frandiox](https://github.com/frandiox) + +- Update to the latest worker runtime version. ([#1673](https://github.com/Shopify/hydrogen/pull/1673)) by [@frandiox](https://github.com/frandiox) + +- Run prettier in all the generated codegen files that use the Hydrogen preset, not only for Storefront API. ([#1578](https://github.com/Shopify/hydrogen/pull/1578)) by [@frandiox](https://github.com/frandiox) + +- Updated dependencies [[`07d1b0b5`](https://github.com/Shopify/hydrogen/commit/07d1b0b5e62ff2d149deac80ce6fbe95d2b0f8ce), [`0241b7d2`](https://github.com/Shopify/hydrogen/commit/0241b7d2dcb887d259ce9033aca356d391bc07df), [`9ad7c5ef`](https://github.com/Shopify/hydrogen/commit/9ad7c5efee8bff63760b36a1a7c194f6bb8e07e5), [`306d302a`](https://github.com/Shopify/hydrogen/commit/306d302ab401f22e5317fd84587c6a37cf931912), [`3f3b8dbe`](https://github.com/Shopify/hydrogen/commit/3f3b8dbe8a72080791125154a71168a419c9ad13)]: + - @shopify/hydrogen-codegen@0.2.0 + - @shopify/mini-oxygen@2.2.5 + ## 6.1.0 ### Minor Changes diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index 695e92d3d3..139b59cfd0 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1,5 +1,5 @@ { - "version": "6.1.0", + "version": "7.0.0", "commands": { "hydrogen:build": { "id": "hydrogen:build", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8bf1e81060..b03aea3a18 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "6.1.0", + "version": "7.0.0", "license": "MIT", "type": "module", "scripts": { @@ -37,8 +37,8 @@ "@graphql-codegen/cli": "5.0.0", "@oclif/core": "2.11.7", "@shopify/cli-kit": "3.52.0", - "@shopify/hydrogen-codegen": "^0.1.0", - "@shopify/mini-oxygen": "^2.2.4", + "@shopify/hydrogen-codegen": "^0.2.0", + "@shopify/mini-oxygen": "^2.2.5", "@shopify/oxygen-cli": "^4.0.0", "ansi-escapes": "^6.2.0", "cli-truncate": "^4.0.0", diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md index 7982408162..7cdc59d937 100644 --- a/packages/create-hydrogen/CHANGELOG.md +++ b/packages/create-hydrogen/CHANGELOG.md @@ -1,5 +1,84 @@ # @shopify/create-hydrogen +## 4.3.5 + +### Patch Changes + +- - Update example and template Remix versions to `^2.5.1` ([#1639](https://github.com/Shopify/hydrogen/pull/1639)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Enable future flags: + - `v3_fetcherPersist` - + - `v3_relativeSplatpath` - + +- Subrequest Profiler (stable) - Provides an overview of network requests happening on the server side ([#1511](https://github.com/Shopify/hydrogen/pull/1511)) by [@wizardlyhel](https://github.com/wizardlyhel) + + #### How to use: + + 1. Run `h2 dev` + 2. Visit http://localhost:3000/subrequest-profiler + + #### Set request display name with `storefront.query`: + + ```tsx + context.storefront.query(HOMEPAGE_FEATURED_PRODUCTS_QUERY, { + displayName: 'Feature products', + variables: { + country, + language, + }, + }); + ``` + + #### Set request debug information with `createWithCache`: + + ```tsx + const withCache = createWithCache({ + cache, + waitUntil, + request, + }); + + const data3p = async () => { + return await withCache( + ['Some unique cache keys'], + CacheLong(), + ({addDebugData}) => { + return fetch('https://some-3p-endpoint.com').then(async (response) => { + if (process.env.NODE_ENV === 'development') { + addDebugData({ + displayName: '3p endpoint display name', + response, + }); + } + + return await response.json(); + }); + }, + ); + }; + ``` + +- 👩‍💻 improved HydrogenSession typing. ([#1590](https://github.com/Shopify/hydrogen/pull/1590)) by [@michenly](https://github.com/michenly) + + In order to ensure utilies from @shopify/hydrogen will work properly using user implemented HydrogenSession class. We encourage the use of `HydrogenSession` type to ensure all the interface needed had been implemented. + + Update implementation of HydrogenSession using type + + ```diff + import { + + type HydrogenSession, + } from '@shopify/hydrogen'; + - class HydrogenSession { + + class AppSession implements HydrogenSession { + ... + } + ``` + +- Update to SFAPI 2024-01 ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Updated dependencies [[`8c477cb5`](https://github.com/Shopify/hydrogen/commit/8c477cb565c3e018bf4e13bad01804c21611fb8a), [`42ac4138`](https://github.com/Shopify/hydrogen/commit/42ac4138553c7e1a438b075c4f9cb781edffebc4), [`7311a3fe`](https://github.com/Shopify/hydrogen/commit/7311a3fe32947274c531a05dc2e75625443744fd), [`0241b7d2`](https://github.com/Shopify/hydrogen/commit/0241b7d2dcb887d259ce9033aca356d391bc07df), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912), [`0ff63bed`](https://github.com/Shopify/hydrogen/commit/0ff63bed840f5b8a5eb9968b67bd9a5a57099253), [`6bc1d61c`](https://github.com/Shopify/hydrogen/commit/6bc1d61c17a9c9be13f52338d2ab940e64e73495), [`eb0f4bcc`](https://github.com/Shopify/hydrogen/commit/eb0f4bccb57966a00ecb2b88d17dd694599da340), [`400bfee6`](https://github.com/Shopify/hydrogen/commit/400bfee6836a51c6ab5e4804e8b1e9ad48856dcb), [`eac4f389`](https://github.com/Shopify/hydrogen/commit/eac4f3897eaadf2cde861f28ee0c1def15f49ed0), [`335375a6`](https://github.com/Shopify/hydrogen/commit/335375a6b1a512f70e169a82bc87a8392dc8c92c), [`335371ce`](https://github.com/Shopify/hydrogen/commit/335371ceb6e1bd5aebb6104f131d3f22798a245f), [`496a084a`](https://github.com/Shopify/hydrogen/commit/496a084ae1754bc8fb564ad527a12fdc0ebd5065), [`1a008e5f`](https://github.com/Shopify/hydrogen/commit/1a008e5fd02f5603473771ba4f84a1116d848bca), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912), [`3e7b6e8a`](https://github.com/Shopify/hydrogen/commit/3e7b6e8a3bf66bad7fc0f9c224f1c163dbe3e288), [`cce65795`](https://github.com/Shopify/hydrogen/commit/cce6579580f849bec9a28cf575f7130ba3627f6b), [`b1a1d7cb`](https://github.com/Shopify/hydrogen/commit/b1a1d7cba9f6eac50cbf459965e92814e4de1be9), [`da9e447b`](https://github.com/Shopify/hydrogen/commit/da9e447b87f6bdf377427ef69209f852d13581d3), [`9e3d88d4`](https://github.com/Shopify/hydrogen/commit/9e3d88d498efaa20fe23de9837e0f444180bc787), [`ca1161b2`](https://github.com/Shopify/hydrogen/commit/ca1161b29ad7b4d0838953782fb114d5fe82193a), [`1820241f`](https://github.com/Shopify/hydrogen/commit/1820241f58e86d11864643c8d1683bf4da60ea02), [`92840e51`](https://github.com/Shopify/hydrogen/commit/92840e51820e5c7822f731affd3f591c0099be10), [`b0d727d1`](https://github.com/Shopify/hydrogen/commit/b0d727d1f2bb643827e2fda438cfc447de7ee2e7), [`a907199b`](https://github.com/Shopify/hydrogen/commit/a907199ba652280239a7ff08d8e65d482c4b9f95), [`306d302a`](https://github.com/Shopify/hydrogen/commit/306d302ab401f22e5317fd84587c6a37cf931912), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912)]: + - @shopify/cli-hydrogen@7.0.0 + ## 4.3.4 ### Patch Changes diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json index 527437c544..97bd8fcc82 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.4", + "version": "4.3.5", "type": "module", "scripts": { "build": "tsup --clean", @@ -13,7 +13,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@shopify/cli-hydrogen": "^6.1.0" + "@shopify/cli-hydrogen": "^7.0.0" }, "bin": "dist/create-app.js", "files": [ diff --git a/packages/hydrogen-codegen/CHANGELOG.md b/packages/hydrogen-codegen/CHANGELOG.md index 66a03e6cc6..4a4d017d02 100644 --- a/packages/hydrogen-codegen/CHANGELOG.md +++ b/packages/hydrogen-codegen/CHANGELOG.md @@ -1,5 +1,19 @@ # @shopify/hydrogen-codegen +## 0.2.0 + +### Minor Changes + +- Export type utilities to create GraphQL clients that can consume the types generated by this package. ([#1584](https://github.com/Shopify/hydrogen/pull/1584)) by [@frandiox](https://github.com/frandiox) + +- Add default values to support the Customer Account API without configuration. ([#1569](https://github.com/Shopify/hydrogen/pull/1569)) by [@frandiox](https://github.com/frandiox) + +### Patch Changes + +- ♻️ renamed all customer reference to the API to customer-account by [@michenly](https://github.com/michenly) + +- Add a `name` property symbol to the preset to make it easier to identify in the CLI. ([#1578](https://github.com/Shopify/hydrogen/pull/1578)) by [@frandiox](https://github.com/frandiox) + ## 0.1.0 ### Minor Changes diff --git a/packages/hydrogen-codegen/package.json b/packages/hydrogen-codegen/package.json index 419d583d38..9b25dd2bce 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.1.0", + "version": "0.2.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 4a95fe8267..3b89a7e028 100644 --- a/packages/hydrogen-react/CHANGELOG.md +++ b/packages/hydrogen-react/CHANGELOG.md @@ -1,5 +1,21 @@ # @shopify/hydrogen-react +## 2024.1.1 + +### Patch Changes + +- - Format code for improved readability contributed by @sanjaiyan-dev ([#1669](https://github.com/Shopify/hydrogen/pull/1669)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Fix ``'s `onPause` event listener + +- ♻️ renamed all customer reference to the API to customer-account by [@michenly](https://github.com/michenly) + +- Added React.forwardRef to Video and ExternalVideo components ([#1415](https://github.com/Shopify/hydrogen/pull/1415)) by [@andershagbard](https://github.com/andershagbard) + +- ✨ add schema generation for customer account api in hydrogen-react and export these types in both hydrogen-react & hydrogen. Note the current CA API version is `2024-01` which is a release candidate and subject to change. ([#1572](https://github.com/Shopify/hydrogen/pull/1572)) by [@michenly](https://github.com/michenly) + +- Update to SFAPI 2024-01 ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel) + ## 2023.10.1 ### Patch Changes diff --git a/packages/hydrogen-react/package.json b/packages/hydrogen-react/package.json index 30660c22a4..0aeefae400 100644 --- a/packages/hydrogen-react/package.json +++ b/packages/hydrogen-react/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/hydrogen-react", - "version": "2024.1.0", + "version": "2024.1.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 e6ce5a490d..584a642349 100644 --- a/packages/hydrogen/CHANGELOG.md +++ b/packages/hydrogen/CHANGELOG.md @@ -1,5 +1,130 @@ # @shopify/hydrogen +## 2024.1.1 + +### Patch Changes + +- Fix redirect bug ([#1629](https://github.com/Shopify/hydrogen/pull/1629)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Fix type when passing custom methods to `createCartHandler`. ([#1588](https://github.com/Shopify/hydrogen/pull/1588)) by [@frandiox](https://github.com/frandiox) + +- ♻️ rename `createCustomerClient` to `createCustomerAccountClient` ([#1674](https://github.com/Shopify/hydrogen/pull/1674)) by [@michenly](https://github.com/michenly) + +- ♻️ renamed all customer reference to the API to customer-account by [@michenly](https://github.com/michenly) + +- The `customerAccount` client now supports codegen types similar to the `storefront` client. ([#1587](https://github.com/Shopify/hydrogen/pull/1587)) by [@frandiox](https://github.com/frandiox) + +- ✨ add schema generation for customer account api in hydrogen-react and export these types in both hydrogen-react & hydrogen. Note the current CA API version is `2024-01` which is a release candidate and subject to change. ([#1572](https://github.com/Shopify/hydrogen/pull/1572)) by [@michenly](https://github.com/michenly) + +- Better Hydrogen error handling ([#1645](https://github.com/Shopify/hydrogen/pull/1645)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Fix storefront client throwing on partial successful errors + - Fix subrequest profiler to better display network errors with url information for SFAPI requests + + ### Breaking change + + Mutation methods of `createCartHandler` used to return an `errors` object that contains `userErrors`. This is now changed back to `userErrors` to be consistent with SFAPI schema. + + The `errors` object will now be used for Graphql execution errors. + + `storefront.isApiError` is deprecated. + + Updated types: + + - `cart.get()` used to return a `Cart` type. Now it returns `CartReturn` type to accommodate the `errors` object + - All other `cart` methods (ie. `cart.addLines`) used to return a `CartQueryData` type. Now it returns `CartQueryDataReturn` type to accommodate the `errors` object. + +- 💥 Change the behaviour of `createContentSecurityPolicy` where the custom rules passed in will extends the default Shopify and development domains instead of overriding them. ([#1593](https://github.com/Shopify/hydrogen/pull/1593)) by [@michenly](https://github.com/michenly) + +- 🐛 fix content security policy for local enviorment for not recognizing localhost asset server as a valid policy ([#1591](https://github.com/Shopify/hydrogen/pull/1591)) by [@michenly](https://github.com/michenly) + +- Subrequest Profiler (stable) - Provides an overview of network requests happening on the server side ([#1511](https://github.com/Shopify/hydrogen/pull/1511)) by [@wizardlyhel](https://github.com/wizardlyhel) + + #### How to use: + + 1. Run `h2 dev` + 2. Visit http://localhost:3000/subrequest-profiler + + #### Set request display name with `storefront.query`: + + ```tsx + context.storefront.query(HOMEPAGE_FEATURED_PRODUCTS_QUERY, { + displayName: 'Feature products', + variables: { + country, + language, + }, + }); + ``` + + #### Set request debug information with `createWithCache`: + + ```tsx + const withCache = createWithCache({ + cache, + waitUntil, + request, + }); + + const data3p = async () => { + return await withCache( + ['Some unique cache keys'], + CacheLong(), + ({addDebugData}) => { + return fetch('https://some-3p-endpoint.com').then(async (response) => { + if (process.env.NODE_ENV === 'development') { + addDebugData({ + displayName: '3p endpoint display name', + response, + }); + } + + return await response.json(); + }); + }, + ); + }; + ``` + +- Fix open-in-editor link from the Subrequest Profiler tool in subrequests to the Customer Account API. ([#1653](https://github.com/Shopify/hydrogen/pull/1653)) by [@frandiox](https://github.com/frandiox) + +- ✨ Make customer client utility official. ([#1606](https://github.com/Shopify/hydrogen/pull/1606)) by [@michenly](https://github.com/michenly) + +- Fix the `` component to render canonical URLs without trailing slashes. For example, both https://hydrogen.shop/collections/freestyle/ and https://hydrogen.shop/collections/freestyle return a canonical link of https://hydrogen.shop/collections/freestyle. ([#1622](https://github.com/Shopify/hydrogen/pull/1622)) by [@blittle](https://github.com/blittle) + + Thank you @joshuafredrickson for reporting. + +- 👩‍💻 improved HydrogenSession typing. ([#1590](https://github.com/Shopify/hydrogen/pull/1590)) by [@michenly](https://github.com/michenly) + + In order to ensure utilies from @shopify/hydrogen will work properly using user implemented HydrogenSession class. We encourage the use of `HydrogenSession` type to ensure all the interface needed had been implemented. + + Update implementation of HydrogenSession using type + + ```diff + import { + + type HydrogenSession, + } from '@shopify/hydrogen'; + - class HydrogenSession { + + class AppSession implements HydrogenSession { + ... + } + ``` + +- Update to SFAPI 2024-01 ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- ✨ Use the new Customer Account API in the account section of the skeleton template ([#1576](https://github.com/Shopify/hydrogen/pull/1576)) by [@michenly](https://github.com/michenly) + + ✨ Add an `authUrl` option to `createCustomerClient` that defines the route in your app that authorizes a user after logging in. The default value is `/account/authorize`. + + ✨ Add an optional `redirectPath` parameter to customer client's login method. This param defines the final path the user lands on at the end of the oAuth flow. It defaults to `/` + +- ✨ add a utility `getAccessToken` to customerClient ([#1607](https://github.com/Shopify/hydrogen/pull/1607)) by [@michenly](https://github.com/michenly) + +- Fix error stack traces thrown from Storefront API and Customer Account API clients when promises are not awaited. ([#1656](https://github.com/Shopify/hydrogen/pull/1656)) by [@frandiox](https://github.com/frandiox) + +- Updated dependencies [[`0629bc77`](https://github.com/Shopify/hydrogen/commit/0629bc779b4dab3482b502cde0cc67d32f41f2f2), [`07d1b0b5`](https://github.com/Shopify/hydrogen/commit/07d1b0b5e62ff2d149deac80ce6fbe95d2b0f8ce), [`dc8f90de`](https://github.com/Shopify/hydrogen/commit/dc8f90de38d1bf7166bbf2e219f6d9e6f55250c6), [`d6d01322`](https://github.com/Shopify/hydrogen/commit/d6d01322b430761c6ac3be71aa8fee798c85de37), [`ca1161b2`](https://github.com/Shopify/hydrogen/commit/ca1161b29ad7b4d0838953782fb114d5fe82193a)]: + - @shopify/hydrogen-react@2024.1.1 + ## 2023.10.3 ### Patch Changes diff --git a/packages/hydrogen/package.json b/packages/hydrogen/package.json index 3eb93dc64f..ee255c1173 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.1.0", + "version": "2024.1.1", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", @@ -59,7 +59,7 @@ "dist" ], "dependencies": { - "@shopify/hydrogen-react": "2024.1.0", + "@shopify/hydrogen-react": "2024.1.1", "content-security-policy-builder": "^2.1.1", "type-fest": "^4.5.0" }, diff --git a/packages/hydrogen/src/version.ts b/packages/hydrogen/src/version.ts index 7285fc95a3..964a8760fb 100644 --- a/packages/hydrogen/src/version.ts +++ b/packages/hydrogen/src/version.ts @@ -1 +1 @@ -export const LIB_VERSION = '2023.10.3'; +export const LIB_VERSION = '2024.1.1'; diff --git a/packages/mini-oxygen/CHANGELOG.md b/packages/mini-oxygen/CHANGELOG.md index 9092a74a92..af2e7adc61 100644 --- a/packages/mini-oxygen/CHANGELOG.md +++ b/packages/mini-oxygen/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/mini-oxygen +## 2.2.5 + +### Patch Changes + +- Fixed step-debugging when running in MiniOxygen's Node.js sandbox ([#1501](https://github.com/Shopify/hydrogen/pull/1501)) by [@frandiox](https://github.com/frandiox) + ## 2.2.4 ### Patch Changes diff --git a/packages/mini-oxygen/package.json b/packages/mini-oxygen/package.json index 3f968cdd8f..9de248e647 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.4", + "version": "2.2.5", "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 e7efcccb8c..be789e3912 100644 --- a/packages/remix-oxygen/CHANGELOG.md +++ b/packages/remix-oxygen/CHANGELOG.md @@ -1,5 +1,63 @@ # @shopify/remix-oxygen +## 2.0.3 + +### Patch Changes + +- - Update example and template Remix versions to `^2.5.1` ([#1639](https://github.com/Shopify/hydrogen/pull/1639)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Enable future flags: + - `v3_fetcherPersist` - + - `v3_relativeSplatpath` - + +- Subrequest Profiler (stable) - Provides an overview of network requests happening on the server side ([#1511](https://github.com/Shopify/hydrogen/pull/1511)) by [@wizardlyhel](https://github.com/wizardlyhel) + + #### How to use: + + 1. Run `h2 dev` + 2. Visit http://localhost:3000/subrequest-profiler + + #### Set request display name with `storefront.query`: + + ```tsx + context.storefront.query(HOMEPAGE_FEATURED_PRODUCTS_QUERY, { + displayName: 'Feature products', + variables: { + country, + language, + }, + }); + ``` + + #### Set request debug information with `createWithCache`: + + ```tsx + const withCache = createWithCache({ + cache, + waitUntil, + request, + }); + + const data3p = async () => { + return await withCache( + ['Some unique cache keys'], + CacheLong(), + ({addDebugData}) => { + return fetch('https://some-3p-endpoint.com').then(async (response) => { + if (process.env.NODE_ENV === 'development') { + addDebugData({ + displayName: '3p endpoint display name', + response, + }); + } + + return await response.json(); + }); + }, + ); + }; + ``` + ## 2.0.2 ### Patch Changes diff --git a/packages/remix-oxygen/package.json b/packages/remix-oxygen/package.json index 535c30db40..bd05e99992 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.2", + "version": "2.0.3", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", diff --git a/templates/demo-store/package.json b/templates/demo-store/package.json index 4637dd66fb..533aa94ac8 100644 --- a/templates/demo-store/package.json +++ b/templates/demo-store/package.json @@ -23,9 +23,9 @@ "@remix-run/react": "^2.5.1", "@remix-run/server-runtime": "^2.5.1", "@shopify/cli": "3.52.0", - "@shopify/cli-hydrogen": "^6.1.0", - "@shopify/hydrogen": "~2024.1.0", - "@shopify/remix-oxygen": "^2.0.2", + "@shopify/cli-hydrogen": "^7.0.0", + "@shopify/hydrogen": "~2024.1.1", + "@shopify/remix-oxygen": "^2.0.3", "clsx": "^1.2.1", "cross-env": "^7.0.3", "graphql": "^16.6.0", diff --git a/templates/hello-world/package.json b/templates/hello-world/package.json index 43dab78475..56cf6b0340 100644 --- a/templates/hello-world/package.json +++ b/templates/hello-world/package.json @@ -16,9 +16,9 @@ "@remix-run/react": "^2.5.1", "@remix-run/server-runtime": "^2.5.1", "@shopify/cli": "3.52.0", - "@shopify/cli-hydrogen": "^6.1.0", - "@shopify/hydrogen": "~2024.1.0", - "@shopify/remix-oxygen": "^2.0.2", + "@shopify/cli-hydrogen": "^7.0.0", + "@shopify/hydrogen": "~2024.1.1", + "@shopify/remix-oxygen": "^2.0.3", "@total-typescript/ts-reset": "^0.4.2", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", diff --git a/templates/skeleton/CHANGELOG.md b/templates/skeleton/CHANGELOG.md index 491e6666ab..aa88b31966 100644 --- a/templates/skeleton/CHANGELOG.md +++ b/templates/skeleton/CHANGELOG.md @@ -1,5 +1,85 @@ # skeleton +## 1.0.2 + +### Patch Changes + +- Use new Storefront API parameters in 2024-01 to fix redirection to the product's default variant when there are unknown query params in the URL. ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel) + + ```diff + - selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions) { + + selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions, ignoreUnknownOptions: true, caseInsensitiveMatch: true) { + ...ProductVariant + } + ``` + +- Updated the GraphQL config in `.graphqlrc.yml` to use the more modern `projects` structure: ([#1577](https://github.com/Shopify/hydrogen/pull/1577)) by [@frandiox](https://github.com/frandiox) + + ```diff + -schema: node_modules/@shopify/hydrogen/storefront.schema.json + +projects: + + default: + + schema: 'node_modules/@shopify/hydrogen/storefront.schema.json' + ``` + + This allows you to add additional projects to the GraphQL config, such as third party CMS schemas. + + Also, you can modify the document paths used for the Storefront API queries. This is useful if you have a large codebase and want to exclude certain files from being used for codegen or other GraphQL utilities: + + ```yaml + projects: + default: + schema: 'node_modules/@shopify/hydrogen/storefront.schema.json' + documents: + - '!*.d.ts' + - '*.{ts,tsx,js,jsx}' + - 'app/**/*.{ts,tsx,js,jsx}' + ``` + +- Change the default HydrogenSession to be more robust in parsing session cookies ([#1583](https://github.com/Shopify/hydrogen/pull/1583)) by [@blittle](https://github.com/blittle) + +- Update `@shopify/cli` dependency in `package.json`: ([#1579](https://github.com/Shopify/hydrogen/pull/1579)) by [@frandiox](https://github.com/frandiox) + + ```diff + - "@shopify/cli": "3.51.0", + + "@shopify/cli": "3.52.0", + ``` + +- - Update example and template Remix versions to `^2.5.1` ([#1639](https://github.com/Shopify/hydrogen/pull/1639)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - Enable future flags: + - `v3_fetcherPersist` - + - `v3_relativeSplatpath` - + +- 👩‍💻 improved HydrogenSession typing. ([#1590](https://github.com/Shopify/hydrogen/pull/1590)) by [@michenly](https://github.com/michenly) + + In order to ensure utilies from @shopify/hydrogen will work properly using user implemented HydrogenSession class. We encourage the use of `HydrogenSession` type to ensure all the interface needed had been implemented. + + Update implementation of HydrogenSession using type + + ```diff + import { + + type HydrogenSession, + } from '@shopify/hydrogen'; + - class HydrogenSession { + + class AppSession implements HydrogenSession { + ... + } + ``` + +- Update to SFAPI 2024-01 ([#1642](https://github.com/Shopify/hydrogen/pull/1642)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- ✨ Use the new Customer Account API in the account section of the skeleton template ([#1576](https://github.com/Shopify/hydrogen/pull/1576)) by [@michenly](https://github.com/michenly) + + ✨ Add an `authUrl` option to `createCustomerClient` that defines the route in your app that authorizes a user after logging in. The default value is `/account/authorize`. + + ✨ Add an optional `redirectPath` parameter to customer client's login method. This param defines the final path the user lands on at the end of the oAuth flow. It defaults to `/` + +- Updated dependencies [[`810f48cf`](https://github.com/Shopify/hydrogen/commit/810f48cf5d55f0cfcac6e01fe481db8c76e77cd2), [`8c477cb5`](https://github.com/Shopify/hydrogen/commit/8c477cb565c3e018bf4e13bad01804c21611fb8a), [`fb38d3b7`](https://github.com/Shopify/hydrogen/commit/fb38d3b7cf108aecca6f7eb6f08c88bc7f46aa4c), [`27c9b9d2`](https://github.com/Shopify/hydrogen/commit/27c9b9d245781a3b7478e28e527597e86f68066b), [`07d1b0b5`](https://github.com/Shopify/hydrogen/commit/07d1b0b5e62ff2d149deac80ce6fbe95d2b0f8ce), [`4d6ba3ff`](https://github.com/Shopify/hydrogen/commit/4d6ba3ffc7ddc72f1b97eff3c7188fe72b8568e7), [`42ac4138`](https://github.com/Shopify/hydrogen/commit/42ac4138553c7e1a438b075c4f9cb781edffebc4), [`7311a3fe`](https://github.com/Shopify/hydrogen/commit/7311a3fe32947274c531a05dc2e75625443744fd), [`0241b7d2`](https://github.com/Shopify/hydrogen/commit/0241b7d2dcb887d259ce9033aca356d391bc07df), [`d6d01322`](https://github.com/Shopify/hydrogen/commit/d6d01322b430761c6ac3be71aa8fee798c85de37), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912), [`0ff63bed`](https://github.com/Shopify/hydrogen/commit/0ff63bed840f5b8a5eb9968b67bd9a5a57099253), [`6bc1d61c`](https://github.com/Shopify/hydrogen/commit/6bc1d61c17a9c9be13f52338d2ab940e64e73495), [`eb0f4bcc`](https://github.com/Shopify/hydrogen/commit/eb0f4bccb57966a00ecb2b88d17dd694599da340), [`400bfee6`](https://github.com/Shopify/hydrogen/commit/400bfee6836a51c6ab5e4804e8b1e9ad48856dcb), [`a69c21ca`](https://github.com/Shopify/hydrogen/commit/a69c21caa15dfedb88afd50f262f17bf86f74836), [`970073e7`](https://github.com/Shopify/hydrogen/commit/970073e78258880505e0de563136b5379d5d24af), [`eac4f389`](https://github.com/Shopify/hydrogen/commit/eac4f3897eaadf2cde861f28ee0c1def15f49ed0), [`335375a6`](https://github.com/Shopify/hydrogen/commit/335375a6b1a512f70e169a82bc87a8392dc8c92c), [`335371ce`](https://github.com/Shopify/hydrogen/commit/335371ceb6e1bd5aebb6104f131d3f22798a245f), [`9b5e6eaa`](https://github.com/Shopify/hydrogen/commit/9b5e6eaaa70d9effcb109b400cffaa0760c826fd), [`94509b75`](https://github.com/Shopify/hydrogen/commit/94509b750afefd686971198ed86277e2c70f3176), [`496a084a`](https://github.com/Shopify/hydrogen/commit/496a084ae1754bc8fb564ad527a12fdc0ebd5065), [`1a008e5f`](https://github.com/Shopify/hydrogen/commit/1a008e5fd02f5603473771ba4f84a1116d848bca), [`36d6fa2c`](https://github.com/Shopify/hydrogen/commit/36d6fa2c4fa54ff79f06ef17aa41f60478977bc0), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912), [`3e7b6e8a`](https://github.com/Shopify/hydrogen/commit/3e7b6e8a3bf66bad7fc0f9c224f1c163dbe3e288), [`cce65795`](https://github.com/Shopify/hydrogen/commit/cce6579580f849bec9a28cf575f7130ba3627f6b), [`b1a1d7cb`](https://github.com/Shopify/hydrogen/commit/b1a1d7cba9f6eac50cbf459965e92814e4de1be9), [`da9e447b`](https://github.com/Shopify/hydrogen/commit/da9e447b87f6bdf377427ef69209f852d13581d3), [`9e3d88d4`](https://github.com/Shopify/hydrogen/commit/9e3d88d498efaa20fe23de9837e0f444180bc787), [`ca1161b2`](https://github.com/Shopify/hydrogen/commit/ca1161b29ad7b4d0838953782fb114d5fe82193a), [`1820241f`](https://github.com/Shopify/hydrogen/commit/1820241f58e86d11864643c8d1683bf4da60ea02), [`92840e51`](https://github.com/Shopify/hydrogen/commit/92840e51820e5c7822f731affd3f591c0099be10), [`b0d727d1`](https://github.com/Shopify/hydrogen/commit/b0d727d1f2bb643827e2fda438cfc447de7ee2e7), [`a907199b`](https://github.com/Shopify/hydrogen/commit/a907199ba652280239a7ff08d8e65d482c4b9f95), [`f6e6d194`](https://github.com/Shopify/hydrogen/commit/f6e6d1943680304b15f0892c64c726d79291fe0a), [`952fedf2`](https://github.com/Shopify/hydrogen/commit/952fedf27b869164550954d1c15f53b32ec02675), [`306d302a`](https://github.com/Shopify/hydrogen/commit/306d302ab401f22e5317fd84587c6a37cf931912), [`6a897586`](https://github.com/Shopify/hydrogen/commit/6a897586bd0908db90736921d11e4b6bdf29c912)]: + - @shopify/hydrogen@2024.1.1 + - @shopify/cli-hydrogen@7.0.0 + - @shopify/remix-oxygen@2.0.3 + ## 1.0.1 ### Patch Changes diff --git a/templates/skeleton/package.json b/templates/skeleton/package.json index d700d806ee..555e0f5544 100644 --- a/templates/skeleton/package.json +++ b/templates/skeleton/package.json @@ -2,7 +2,7 @@ "name": "skeleton", "private": true, "sideEffects": false, - "version": "1.0.1", + "version": "1.0.2", "scripts": { "build": "shopify hydrogen build", "dev": "shopify hydrogen dev --codegen", @@ -16,9 +16,9 @@ "@remix-run/react": "^2.5.1", "@remix-run/server-runtime": "^2.5.1", "@shopify/cli": "3.52.0", - "@shopify/cli-hydrogen": "^6.1.0", - "@shopify/hydrogen": "~2024.1.0", - "@shopify/remix-oxygen": "^2.0.2", + "@shopify/cli-hydrogen": "^7.0.0", + "@shopify/hydrogen": "~2024.1.1", + "@shopify/remix-oxygen": "^2.0.3", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.6.6",