diff --git a/.changeset/chatty-parrots-care.md b/.changeset/chatty-parrots-care.md deleted file mode 100644 index 796d3df54c..0000000000 --- a/.changeset/chatty-parrots-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Add a client for query the new Customer Account API diff --git a/.changeset/clean-timers-peel.md b/.changeset/clean-timers-peel.md deleted file mode 100644 index cfe02c5820..0000000000 --- a/.changeset/clean-timers-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/remix-oxygen': major ---- - -Remove deprecated function export `getBuyerIp`. diff --git a/.changeset/early-taxis-compete.md b/.changeset/early-taxis-compete.md deleted file mode 100644 index defbd5b69b..0000000000 --- a/.changeset/early-taxis-compete.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'demo-store': major ---- - -Update to Remix v2. Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. -If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. diff --git a/.changeset/fast-poems-wash.md b/.changeset/fast-poems-wash.md deleted file mode 100644 index 5a00821dc2..0000000000 --- a/.changeset/fast-poems-wash.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@shopify/cli-hydrogen': patch -'demo-store': patch ---- - -Updated internal dependencies to improve terminal output. -Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies: - -```diff - "dependencies": { -- "@shopify/cli": "3.49.2", -+ "@shopify/cli": "3.50.0", - } -``` diff --git a/.changeset/forty-houses-taste.md b/.changeset/forty-houses-taste.md deleted file mode 100644 index 180a7500c3..0000000000 --- a/.changeset/forty-houses-taste.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'demo-store': patch -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': patch -'@shopify/create-hydrogen': patch -'@shopify/hydrogen-codegen': patch ---- - -Update Storefront api endpoint to 2023-10 diff --git a/.changeset/four-toes-shout.md b/.changeset/four-toes-shout.md deleted file mode 100644 index 07e4f5d1fb..0000000000 --- a/.changeset/four-toes-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Introduce a new default caching strategy with a `max-age` value of 1 second, and a `stale-while-revalidate` value of 1 day. When updating to this version of Hydrogen, note that if you would like to continue to use `CacheShort` as the default (10 second cache) to decrease risk of stale data (but also increase load times on low traffic pages), it's important to go and manually specify your caching strategy. diff --git a/.changeset/fuzzy-singers-check.md b/.changeset/fuzzy-singers-check.md deleted file mode 100644 index 5ae5fcf058..0000000000 --- a/.changeset/fuzzy-singers-check.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen-codegen': patch ---- - -Remove warning when this package is used without `@shopify/hydrogen`. diff --git a/.changeset/gentle-rabbits-serve.md b/.changeset/gentle-rabbits-serve.md deleted file mode 100644 index 25ef58c27a..0000000000 --- a/.changeset/gentle-rabbits-serve.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'demo-store': patch -'@shopify/hydrogen': patch ---- - -Clean up hash function diff --git a/.changeset/orange-socks-shave.md b/.changeset/orange-socks-shave.md deleted file mode 100644 index 5dae8a3846..0000000000 --- a/.changeset/orange-socks-shave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/cli-hydrogen': minor ---- - -The Codegen feature is now considered stable and related dependencies have been updated. Use `--codegen` flag instead of `--codegen-unstable` to generate code from your GraphQL queries. diff --git a/.changeset/pink-bottles-bow.md b/.changeset/pink-bottles-bow.md deleted file mode 100644 index 332ae77847..0000000000 --- a/.changeset/pink-bottles-bow.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -'@shopify/hydrogen-codegen': minor ---- - -Removed the `patchGqlPluck` named export from the main entrypoint. - -Added `@shopify/hydrogen-codegen/patch` entrypoint that automatically patches the necessary files. This is applied automatically by Hydrogen CLI. -If you're using the `graphql-codegen` CLI directly, you can either run it as a Node loader with `node -r @shopify/hydrogen-codegen/patch node_modules/.bin/graphql-codegen` or import it in your `codegen.ts` file before anything else: - -```js -import '@shopify/hydrogen-codegen/patch'; -import {preset, schema, pluckConfig} from '@shopify/hydrogen-codegen'; - -export default { - overwrite: true, - pluckConfig, - generates: { - 'storefrontapi.generated.d.ts': { - preset, - schema, - documents: ['...'], - }, - }, -}; -``` diff --git a/.changeset/shy-jokes-flow.md b/.changeset/shy-jokes-flow.md deleted file mode 100644 index f45c93fed7..0000000000 --- a/.changeset/shy-jokes-flow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/hydrogen': patch ---- - -Move `createCartHandler`'s `customMethods__unstable` to stable diff --git a/.changeset/short-taxis-call.md b/.changeset/sixty-chairs-rule.md similarity index 59% rename from .changeset/short-taxis-call.md rename to .changeset/sixty-chairs-rule.md index 76b331fb83..b8c9f16c7c 100644 --- a/.changeset/short-taxis-call.md +++ b/.changeset/sixty-chairs-rule.md @@ -1,6 +1,6 @@ --- -'@shopify/cli-hydrogen': patch '@shopify/create-hydrogen': patch +'@shopify/cli-hydrogen': patch --- -Fix codegen commands for generated projects +Fix codegen generation cli command for js projects diff --git a/.changeset/smart-ways-destroy.md b/.changeset/smart-ways-destroy.md deleted file mode 100644 index c54d2fe7d9..0000000000 --- a/.changeset/smart-ways-destroy.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@shopify/hydrogen': patch -'@shopify/cli-hydrogen': major -'@shopify/create-hydrogen': major -'@shopify/remix-oxygen': major ---- - -Update to Remix v2. Remix is now a peer dependency and its version is no longer pinned. This means that you can upgrade to newer Remix 2.x versions without upgrading Hydrogen. - -### Breaking changes - -Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. Common changes include: - -- Renaming types prefixed with `V2_`. For example, `V2_MetaFunction` is now `MetaFunction`. -- Renaming other types like `LoaderArgs` and `ActionArgs`, which are now `LoaderFunctionArgs` and `ActionFunctionArgs` respectively. - -If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. diff --git a/.changeset/sweet-points-walk.md b/.changeset/sweet-points-walk.md deleted file mode 100644 index 2667bc0fa9..0000000000 --- a/.changeset/sweet-points-walk.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -Remove deprecated props: - -- `createStorefrontClient`'s `buyerIp` and `requestGroupId` -- `` component's `loaderOptions` and `widths` diff --git a/.changeset/tender-teachers-allow.md b/.changeset/tender-teachers-allow.md deleted file mode 100644 index 7f6b73f072..0000000000 --- a/.changeset/tender-teachers-allow.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -'@shopify/hydrogen-react': patch -'@shopify/hydrogen': patch ---- - -The Storefront API types included are now generated using `@graphql-codegen/typescript@4` ([changelog](https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/typescript/CHANGELOG.md#400)). This results in a breaking change if you were importing `Scalars` directly from `@shopify/hydrogen-react` or `@shopify/hydrogen`. - -Before: - -```tsx -import type {Scalars} from '@shopify/hydrogen/storefront-api-types'; - -type Props = { - id: Scalars['ID']; // This was a string -}; -``` - -After: - -```tsx -import type {Scalars} from '@shopify/hydrogen/storefront-api-types'; - -type Props = { - id: Scalars['ID']['input']; // Need to access 'input' or 'output' to get the string -}; -``` diff --git a/.changeset/unlucky-stingrays-live.md b/.changeset/unlucky-stingrays-live.md deleted file mode 100644 index f8b093e685..0000000000 --- a/.changeset/unlucky-stingrays-live.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'demo-store': patch ---- - -If you are calling `useMatches()` in different places of your app to access the data returned by the root loader, you may want to update it to the following pattern to enhance types: - -```ts -// root.tsx - -import {useMatches} from '@remix-run/react'; -import {type SerializeFrom} from '@shopify/remix-oxygen'; - -export const useRootLoaderData = () => { - const [root] = useMatches(); - return root?.data as SerializeFrom; -}; - -export function loader(context) { - // ... -} -``` - -This way, you can import `useRootLoaderData()` anywhere in your app and get the correct type for the data returned by the root loader. diff --git a/examples/customer-api/CHANGELOG.md b/examples/customer-api/CHANGELOG.md new file mode 100644 index 0000000000..a955a37082 --- /dev/null +++ b/examples/customer-api/CHANGELOG.md @@ -0,0 +1,10 @@ +# customer-api + +## 0.0.1 + +### Patch Changes + +- Updated dependencies [[`81400439`](https://github.com/Shopify/hydrogen/commit/814004397c1d17ef0a53a425ed28a42cf67765cf), [`a6f397b6`](https://github.com/Shopify/hydrogen/commit/a6f397b64dc6a0d856cb7961731ee1f86bf80292), [`3464ec04`](https://github.com/Shopify/hydrogen/commit/3464ec04a084e1ceb30ee19874dc1b9171ce2b34), [`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`867e0b03`](https://github.com/Shopify/hydrogen/commit/867e0b033fc9eb04b7250baea97d8fd49d26ccca), [`a4279cc5`](https://github.com/Shopify/hydrogen/commit/a4279cc5be353c24aa3f0881195d2c5ff4f5e8d0), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`58dc68de`](https://github.com/Shopify/hydrogen/commit/58dc68de2f71d12f1275961e160faa740387cdb5), [`f24e3424`](https://github.com/Shopify/hydrogen/commit/f24e3424c8e2b363b181b71fcbd3e45f696fdd3f), [`66a48573`](https://github.com/Shopify/hydrogen/commit/66a4857387148b6a104df5783314c74aca8aada0), [`0ae7cbe2`](https://github.com/Shopify/hydrogen/commit/0ae7cbe280d8351126e11dc13f35d7277d9b2d86), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3)]: + - @shopify/hydrogen@2023.10.0 + - @shopify/remix-oxygen@2.0.0 + - @shopify/cli-hydrogen@6.0.0 diff --git a/examples/customer-api/package.json b/examples/customer-api/package.json index f22a40ef50..d8eb99b9aa 100644 --- a/examples/customer-api/package.json +++ b/examples/customer-api/package.json @@ -2,7 +2,7 @@ "name": "customer-api", "private": true, "sideEffects": false, - "version": "0.0.0", + "version": "0.0.1", "scripts": { "build": "shopify hydrogen build", "dev": "shopify hydrogen dev", @@ -15,9 +15,9 @@ "dependencies": { "@remix-run/react": "2.1.0", "@shopify/cli": "3.50.0", - "@shopify/cli-hydrogen": "^5.4.3", - "@shopify/hydrogen": "^2023.7.11", - "@shopify/remix-oxygen": "^1.1.1", + "@shopify/cli-hydrogen": "^6.0.0", + "@shopify/hydrogen": "^2023.10.0", + "@shopify/remix-oxygen": "^2.0.0", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.6.6", diff --git a/examples/express/package.json b/examples/express/package.json index 70896ca9e3..b647df12f4 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -15,7 +15,7 @@ "@remix-run/express": "2.1.0", "@remix-run/node": "2.1.0", "@remix-run/react": "2.1.0", - "@shopify/hydrogen": "^2023.7.11", + "@shopify/hydrogen": "^2023.10.0", "compression": "^1.7.4", "cross-env": "^7.0.3", "express": "^4.18.2", @@ -28,7 +28,7 @@ "@remix-run/dev": "2.1.0", "@remix-run/eslint-config": "2.1.0", "@shopify/cli": "3.50.0", - "@shopify/cli-hydrogen": "^5.4.3", + "@shopify/cli-hydrogen": "^6.0.0", "@types/compression": "^1.7.2", "@types/express": "^4.17.17", "@types/morgan": "^1.9.4", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 93c9b10fe1..b7e94205d4 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,46 @@ # @shopify/cli-hydrogen +## 6.0.0 + +### Major Changes + +- Update to Remix v2. Remix is now a peer dependency and its version is no longer pinned. This means that you can upgrade to newer Remix 2.x versions without upgrading Hydrogen. ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox) + + ### Breaking changes + + Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. Common changes include: + + - Renaming types prefixed with `V2_`. For example, `V2_MetaFunction` is now `MetaFunction`. + - Renaming other types like `LoaderArgs` and `ActionArgs`, which are now `LoaderFunctionArgs` and `ActionFunctionArgs` respectively. + + If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. + +### Minor Changes + +- The Codegen feature is now considered stable and related dependencies have been updated. Use `--codegen` flag instead of `--codegen-unstable` to generate code from your GraphQL queries. ([#1108](https://github.com/Shopify/hydrogen/pull/1108)) by [@frandiox](https://github.com/frandiox) + +### Patch Changes + +- Updated internal dependencies to improve terminal output. ([#1456](https://github.com/Shopify/hydrogen/pull/1456)) by [@vincentezw](https://github.com/vincentezw) + + Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies: + + ```diff + "dependencies": { + - "@shopify/cli": "3.49.2", + + "@shopify/cli": "3.50.0", + } + ``` + +- Update Storefront api endpoint to 2023-10 ([#1431](https://github.com/Shopify/hydrogen/pull/1431)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Fix codegen commands for generated projects ([#1464](https://github.com/Shopify/hydrogen/pull/1464)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Updated dependencies [[`a6f397b6`](https://github.com/Shopify/hydrogen/commit/a6f397b64dc6a0d856cb7961731ee1f86bf80292), [`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`66a48573`](https://github.com/Shopify/hydrogen/commit/66a4857387148b6a104df5783314c74aca8aada0), [`0ae7cbe2`](https://github.com/Shopify/hydrogen/commit/0ae7cbe280d8351126e11dc13f35d7277d9b2d86), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3)]: + - @shopify/remix-oxygen@2.0.0 + - @shopify/hydrogen-react@2023.10.0 + - @shopify/hydrogen-codegen@0.1.0 + ## 5.5.1 ### Patch Changes diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index 6ee4bece4a..ae684e9879 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1,5 +1,5 @@ { - "version": "5.5.1", + "version": "6.0.0", "commands": { "hydrogen:build": { "id": "hydrogen:build", diff --git a/packages/cli/package.json b/packages/cli/package.json index fc7ca3a7e4..d05e71e5a8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "version": "5.5.1", + "version": "6.0.0", "license": "MIT", "type": "module", "scripts": { @@ -36,7 +36,7 @@ "@graphql-codegen/cli": "5.0.0", "@oclif/core": "2.11.7", "@shopify/cli-kit": "3.50.0", - "@shopify/hydrogen-codegen": "^0.0.2", + "@shopify/hydrogen-codegen": "^0.1.0", "@shopify/mini-oxygen": "^2.2.3", "@shopify/oxygen-cli": "^2.3.2", "ansi-escapes": "^6.2.0", @@ -60,8 +60,8 @@ "peerDependencies": { "@remix-run/dev": "^2.1.0", "@remix-run/react": "^2.1.0", - "@shopify/hydrogen-react": "^2023.7.6", - "@shopify/remix-oxygen": "^1.1.8" + "@shopify/hydrogen-react": "^2023.10.0", + "@shopify/remix-oxygen": "^2.0.0" }, "peerDependenciesMeta": { "@remix-run/dev": { diff --git a/packages/cli/src/commands/hydrogen/codegen.ts b/packages/cli/src/commands/hydrogen/codegen.ts index c427dd076d..9a2f17b4c0 100644 --- a/packages/cli/src/commands/hydrogen/codegen.ts +++ b/packages/cli/src/commands/hydrogen/codegen.ts @@ -59,11 +59,15 @@ export async function runCodegen({ console.log(''); // New line + // Use root file to determine if we're using TypeScript or JavaScript + const rootFile = remixConfig?.routes?.root?.file; + const generatedFiles = await codegen({ ...remixConfig, configFilePath: codegenConfigPath, forceSfapiVersion, watch, + isJSProject: /jsx$/.test(rootFile || ''), // Default to false if rootFile is undefined }); if (!watch) { diff --git a/packages/cli/src/lib/codegen.ts b/packages/cli/src/lib/codegen.ts index ff131d2d6a..6cd2dabd02 100644 --- a/packages/cli/src/lib/codegen.ts +++ b/packages/cli/src/lib/codegen.ts @@ -17,6 +17,7 @@ if (isStandaloneProcess) { rootDirectory: process.argv[2]!, appDirectory: process.argv[3]!, configFilePath: process.argv[4], + isJSProject: process.argv[5] === 'js', watch: true, }); } @@ -99,6 +100,7 @@ type CodegenOptions = ProjectDirs & { watch?: boolean; configFilePath?: string; forceSfapiVersion?: string; + isJSProject?: boolean; }; export async function codegen(options: CodegenOptions) { @@ -165,12 +167,13 @@ async function generateTypes({ async function generateDefaultConfig( {rootDirectory, appDirectory}: ProjectDirs, forceSfapiVersion?: string, + isJSProject?: boolean, ): Promise { const {schema, preset, pluckConfig} = await import( '@shopify/hydrogen-codegen' ); - const tsDefaultGlob = '*!(*.d).{ts,tsx}'; // No d.ts files + const defaultGlob = isJSProject ? '*!(*.d).{js,jsx}' : '*!(*.d).{ts,tsx}'; // No d.ts files const appDirRelative = relativePath(rootDirectory, appDirectory); return { @@ -183,8 +186,8 @@ async function generateDefaultConfig( preset, schema, documents: [ - tsDefaultGlob, // E.g. ./server.ts - joinPath(appDirRelative, '**', tsDefaultGlob), // E.g. app/routes/_index.tsx + defaultGlob, // E.g. ./server.(t|j)s + joinPath(appDirRelative, '**', defaultGlob), // E.g. app/routes/_index.(t|j)sx ], ...(!!forceSfapiVersion && { diff --git a/packages/create-hydrogen/CHANGELOG.md b/packages/create-hydrogen/CHANGELOG.md index 920228714a..e2e2727572 100644 --- a/packages/create-hydrogen/CHANGELOG.md +++ b/packages/create-hydrogen/CHANGELOG.md @@ -1,5 +1,29 @@ # @shopify/create-hydrogen +## 5.0.0 + +### Major Changes + +- Update to Remix v2. Remix is now a peer dependency and its version is no longer pinned. This means that you can upgrade to newer Remix 2.x versions without upgrading Hydrogen. ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox) + + ### Breaking changes + + Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. Common changes include: + + - Renaming types prefixed with `V2_`. For example, `V2_MetaFunction` is now `MetaFunction`. + - Renaming other types like `LoaderArgs` and `ActionArgs`, which are now `LoaderFunctionArgs` and `ActionFunctionArgs` respectively. + + If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. + +### Patch Changes + +- Update Storefront api endpoint to 2023-10 ([#1431](https://github.com/Shopify/hydrogen/pull/1431)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Fix codegen commands for generated projects ([#1464](https://github.com/Shopify/hydrogen/pull/1464)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Updated dependencies [[`3464ec04`](https://github.com/Shopify/hydrogen/commit/3464ec04a084e1ceb30ee19874dc1b9171ce2b34), [`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`58dc68de`](https://github.com/Shopify/hydrogen/commit/58dc68de2f71d12f1275961e160faa740387cdb5), [`66a48573`](https://github.com/Shopify/hydrogen/commit/66a4857387148b6a104df5783314c74aca8aada0)]: + - @shopify/cli-hydrogen@6.0.0 + ## 4.3.1 ### Patch Changes diff --git a/packages/create-hydrogen/package.json b/packages/create-hydrogen/package.json index 2e0f4d6543..4eb0b3e777 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.1", + "version": "5.0.0", "type": "module", "scripts": { "build": "tsup --clean", @@ -13,7 +13,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@shopify/cli-hydrogen": "^5.5.1" + "@shopify/cli-hydrogen": "^6.0.0" }, "bin": "dist/create-app.js", "files": [ diff --git a/packages/hydrogen-codegen/CHANGELOG.md b/packages/hydrogen-codegen/CHANGELOG.md index 420b003623..c749a31a7e 100644 --- a/packages/hydrogen-codegen/CHANGELOG.md +++ b/packages/hydrogen-codegen/CHANGELOG.md @@ -1,5 +1,37 @@ # @shopify/hydrogen-codegen +## 0.1.0 + +### Minor Changes + +- Removed the `patchGqlPluck` named export from the main entrypoint. ([#1108](https://github.com/Shopify/hydrogen/pull/1108)) by [@frandiox](https://github.com/frandiox) + + Added `@shopify/hydrogen-codegen/patch` entrypoint that automatically patches the necessary files. This is applied automatically by Hydrogen CLI. + If you're using the `graphql-codegen` CLI directly, you can either run it as a Node loader with `node -r @shopify/hydrogen-codegen/patch node_modules/.bin/graphql-codegen` or import it in your `codegen.ts` file before anything else: + + ```js + import '@shopify/hydrogen-codegen/patch'; + import {preset, schema, pluckConfig} from '@shopify/hydrogen-codegen'; + + export default { + overwrite: true, + pluckConfig, + generates: { + 'storefrontapi.generated.d.ts': { + preset, + schema, + documents: ['...'], + }, + }, + }; + ``` + +### Patch Changes + +- Update Storefront api endpoint to 2023-10 ([#1431](https://github.com/Shopify/hydrogen/pull/1431)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Remove warning when this package is used without `@shopify/hydrogen`. ([#1108](https://github.com/Shopify/hydrogen/pull/1108)) by [@frandiox](https://github.com/frandiox) + ## 0.0.2 ### Patch Changes diff --git a/packages/hydrogen-codegen/package.json b/packages/hydrogen-codegen/package.json index f1beaa8549..95a71f7270 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.0.2", + "version": "0.1.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 566e9dec01..23db2a4ecd 100644 --- a/packages/hydrogen-react/CHANGELOG.md +++ b/packages/hydrogen-react/CHANGELOG.md @@ -1,5 +1,38 @@ # @shopify/hydrogen-react +## 2023.10.0 + +### Patch Changes + +- Update Storefront api endpoint to 2023-10 ([#1431](https://github.com/Shopify/hydrogen/pull/1431)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Remove deprecated props: ([#1435](https://github.com/Shopify/hydrogen/pull/1435)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - `createStorefrontClient`'s `buyerIp` and `requestGroupId` + - `` component's `loaderOptions` and `widths` + +- The Storefront API types included are now generated using `@graphql-codegen/typescript@4` ([changelog](https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/typescript/CHANGELOG.md#400)). This results in a breaking change if you were importing `Scalars` directly from `@shopify/hydrogen-react` or `@shopify/hydrogen`. ([#1108](https://github.com/Shopify/hydrogen/pull/1108)) by [@frandiox](https://github.com/frandiox) + + Before: + + ```tsx + import type {Scalars} from '@shopify/hydrogen/storefront-api-types'; + + type Props = { + id: Scalars['ID']; // This was a string + }; + ``` + + After: + + ```tsx + import type {Scalars} from '@shopify/hydrogen/storefront-api-types'; + + type Props = { + id: Scalars['ID']['input']; // Need to access 'input' or 'output' to get the string + }; + ``` + ## 2023.7.6 ### Patch Changes diff --git a/packages/hydrogen/CHANGELOG.md b/packages/hydrogen/CHANGELOG.md index 30329a897d..4af27355f4 100644 --- a/packages/hydrogen/CHANGELOG.md +++ b/packages/hydrogen/CHANGELOG.md @@ -1,5 +1,60 @@ # @shopify/hydrogen +## 2023.10.0 + +### Patch Changes + +- Add a client for query the new Customer Account API ([#1430](https://github.com/Shopify/hydrogen/pull/1430)) by [@blittle](https://github.com/blittle) + +- Update Storefront api endpoint to 2023-10 ([#1431](https://github.com/Shopify/hydrogen/pull/1431)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Introduce a new default caching strategy with a `max-age` value of 1 second, and a `stale-while-revalidate` value of 1 day. When updating to this version of Hydrogen, note that if you would like to continue to use `CacheShort` as the default (10 second cache) to decrease risk of stale data (but also increase load times on low traffic pages), it's important to go and manually specify your caching strategy. ([#1336](https://github.com/Shopify/hydrogen/pull/1336)) by [@benjaminsehl](https://github.com/benjaminsehl) + +- Clean up hash function ([#1450](https://github.com/Shopify/hydrogen/pull/1450)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Move `createCartHandler`'s `customMethods__unstable` to stable ([#1440](https://github.com/Shopify/hydrogen/pull/1440)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Update to Remix v2. Remix is now a peer dependency and its version is no longer pinned. This means that you can upgrade to newer Remix 2.x versions without upgrading Hydrogen. ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox) + + ### Breaking changes + + Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. Common changes include: + + - Renaming types prefixed with `V2_`. For example, `V2_MetaFunction` is now `MetaFunction`. + - Renaming other types like `LoaderArgs` and `ActionArgs`, which are now `LoaderFunctionArgs` and `ActionFunctionArgs` respectively. + + If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. + +- Remove deprecated props: ([#1435](https://github.com/Shopify/hydrogen/pull/1435)) by [@wizardlyhel](https://github.com/wizardlyhel) + + - `createStorefrontClient`'s `buyerIp` and `requestGroupId` + - `` component's `loaderOptions` and `widths` + +- The Storefront API types included are now generated using `@graphql-codegen/typescript@4` ([changelog](https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/typescript/CHANGELOG.md#400)). This results in a breaking change if you were importing `Scalars` directly from `@shopify/hydrogen-react` or `@shopify/hydrogen`. ([#1108](https://github.com/Shopify/hydrogen/pull/1108)) by [@frandiox](https://github.com/frandiox) + + Before: + + ```tsx + import type {Scalars} from '@shopify/hydrogen/storefront-api-types'; + + type Props = { + id: Scalars['ID']; // This was a string + }; + ``` + + After: + + ```tsx + import type {Scalars} from '@shopify/hydrogen/storefront-api-types'; + + type Props = { + id: Scalars['ID']['input']; // Need to access 'input' or 'output' to get the string + }; + ``` + +- Updated dependencies [[`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`0ae7cbe2`](https://github.com/Shopify/hydrogen/commit/0ae7cbe280d8351126e11dc13f35d7277d9b2d86), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3)]: + - @shopify/hydrogen-react@2023.10.0 + ## 2023.7.13 ### Patch Changes diff --git a/packages/hydrogen/src/version.ts b/packages/hydrogen/src/version.ts index 9ef08f92bc..7fda5058e6 100644 --- a/packages/hydrogen/src/version.ts +++ b/packages/hydrogen/src/version.ts @@ -1 +1 @@ -export const LIB_VERSION = '2023.7.13'; +export const LIB_VERSION = '2023.10.0'; diff --git a/packages/remix-oxygen/CHANGELOG.md b/packages/remix-oxygen/CHANGELOG.md index be67201d4e..7aadd182c8 100644 --- a/packages/remix-oxygen/CHANGELOG.md +++ b/packages/remix-oxygen/CHANGELOG.md @@ -1,5 +1,22 @@ # @shopify/remix-oxygen +## 2.0.0 + +### Major Changes + +- Remove deprecated function export `getBuyerIp`. ([#1455](https://github.com/Shopify/hydrogen/pull/1455)) by [@frandiox](https://github.com/frandiox) + +- Update to Remix v2. Remix is now a peer dependency and its version is no longer pinned. This means that you can upgrade to newer Remix 2.x versions without upgrading Hydrogen. ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox) + + ### Breaking changes + + Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. Common changes include: + + - Renaming types prefixed with `V2_`. For example, `V2_MetaFunction` is now `MetaFunction`. + - Renaming other types like `LoaderArgs` and `ActionArgs`, which are now `LoaderFunctionArgs` and `ActionFunctionArgs` respectively. + + If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. + ## 1.1.8 ### Patch Changes diff --git a/packages/remix-oxygen/package.json b/packages/remix-oxygen/package.json index 273949e73f..3fc6604190 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": "1.1.8", + "version": "2.0.0", "license": "MIT", "main": "dist/index.cjs", "module": "dist/production/index.js", diff --git a/templates/demo-store/CHANGELOG.md b/templates/demo-store/CHANGELOG.md index c9ecb3e360..4cc0a4a333 100644 --- a/templates/demo-store/CHANGELOG.md +++ b/templates/demo-store/CHANGELOG.md @@ -1,5 +1,55 @@ # demo-store +## 3.0.0 + +### Major Changes + +- Update to Remix v2. Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox) + + If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. + +### Patch Changes + +- Updated internal dependencies to improve terminal output. ([#1456](https://github.com/Shopify/hydrogen/pull/1456)) by [@vincentezw](https://github.com/vincentezw) + + Please update the `@shopify/cli` dependency in your app to avoid duplicated subdependencies: + + ```diff + "dependencies": { + - "@shopify/cli": "3.49.2", + + "@shopify/cli": "3.50.0", + } + ``` + +- Update Storefront api endpoint to 2023-10 ([#1431](https://github.com/Shopify/hydrogen/pull/1431)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- Clean up hash function ([#1450](https://github.com/Shopify/hydrogen/pull/1450)) by [@wizardlyhel](https://github.com/wizardlyhel) + +- If you are calling `useMatches()` in different places of your app to access the data returned by the root loader, you may want to update it to the following pattern to enhance types: ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox) + + ```ts + // root.tsx + + import {useMatches} from '@remix-run/react'; + import {type SerializeFrom} from '@shopify/remix-oxygen'; + + export const useRootLoaderData = () => { + const [root] = useMatches(); + return root?.data as SerializeFrom; + }; + + export function loader(context) { + // ... + } + ``` + + This way, you can import `useRootLoaderData()` anywhere in your app and get the correct type for the data returned by the root loader. + +- Updated dependencies [[`81400439`](https://github.com/Shopify/hydrogen/commit/814004397c1d17ef0a53a425ed28a42cf67765cf), [`a6f397b6`](https://github.com/Shopify/hydrogen/commit/a6f397b64dc6a0d856cb7961731ee1f86bf80292), [`3464ec04`](https://github.com/Shopify/hydrogen/commit/3464ec04a084e1ceb30ee19874dc1b9171ce2b34), [`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`867e0b03`](https://github.com/Shopify/hydrogen/commit/867e0b033fc9eb04b7250baea97d8fd49d26ccca), [`a4279cc5`](https://github.com/Shopify/hydrogen/commit/a4279cc5be353c24aa3f0881195d2c5ff4f5e8d0), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`58dc68de`](https://github.com/Shopify/hydrogen/commit/58dc68de2f71d12f1275961e160faa740387cdb5), [`f24e3424`](https://github.com/Shopify/hydrogen/commit/f24e3424c8e2b363b181b71fcbd3e45f696fdd3f), [`66a48573`](https://github.com/Shopify/hydrogen/commit/66a4857387148b6a104df5783314c74aca8aada0), [`0ae7cbe2`](https://github.com/Shopify/hydrogen/commit/0ae7cbe280d8351126e11dc13f35d7277d9b2d86), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3)]: + - @shopify/hydrogen@2023.10.0 + - @shopify/remix-oxygen@2.0.0 + - @shopify/cli-hydrogen@6.0.0 + ## 2.1.6 ### Patch Changes diff --git a/templates/demo-store/package.json b/templates/demo-store/package.json index 660b94b81b..6b52ea8351 100644 --- a/templates/demo-store/package.json +++ b/templates/demo-store/package.json @@ -2,7 +2,7 @@ "name": "demo-store", "private": true, "sideEffects": false, - "version": "2.1.6", + "version": "3.0.0", "scripts": { "dev": "shopify hydrogen dev --codegen", "build": "shopify hydrogen build", @@ -20,9 +20,9 @@ "@headlessui/react": "^1.7.2", "@remix-run/react": "2.1.0", "@shopify/cli": "3.50.0", - "@shopify/cli-hydrogen": "^5.5.1", + "@shopify/cli-hydrogen": "^6.0.0", "@shopify/hydrogen": "^2023.10.0", - "@shopify/remix-oxygen": "^1.1.8", + "@shopify/remix-oxygen": "^2.0.0", "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 ca36289af5..20ea4f388c 100644 --- a/templates/hello-world/package.json +++ b/templates/hello-world/package.json @@ -15,9 +15,9 @@ "dependencies": { "@remix-run/react": "2.1.0", "@shopify/cli": "3.50.0", - "@shopify/cli-hydrogen": "^5.5.1", + "@shopify/cli-hydrogen": "^6.0.0", "@shopify/hydrogen": "^2023.10.0", - "@shopify/remix-oxygen": "^1.1.8", + "@shopify/remix-oxygen": "^2.0.0", "@total-typescript/ts-reset": "^0.4.2", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", diff --git a/templates/skeleton/package.json b/templates/skeleton/package.json index ec6a6f529c..fff89cdc34 100644 --- a/templates/skeleton/package.json +++ b/templates/skeleton/package.json @@ -15,9 +15,9 @@ "dependencies": { "@remix-run/react": "2.1.0", "@shopify/cli": "3.50.0", - "@shopify/cli-hydrogen": "^5.5.1", + "@shopify/cli-hydrogen": "^6.0.0", "@shopify/hydrogen": "^2023.10.0", - "@shopify/remix-oxygen": "^1.1.8", + "@shopify/remix-oxygen": "^2.0.0", "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "isbot": "^3.6.6",