From 1bd78b45a8b1f18f94e01ea93566052b90e5d1cc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:20:41 +0000 Subject: [PATCH 1/3] Version Packages --- .changeset/brown-flowers-explode.md | 2 -- .changeset/eight-shoes-kneel.md | 5 ----- .changeset/olive-insects-tie.md | 11 ----------- .changeset/sixty-months-fetch.md | 2 -- .changeset/slimy-walls-sing.md | 2 -- .changeset/wicked-forks-rhyme.md | 5 ----- packages/shopify-api/CHANGELOG.md | 21 +++++++++++++++++++-- packages/shopify-api/package.json | 2 +- 8 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 .changeset/brown-flowers-explode.md delete mode 100644 .changeset/eight-shoes-kneel.md delete mode 100644 .changeset/olive-insects-tie.md delete mode 100644 .changeset/sixty-months-fetch.md delete mode 100644 .changeset/slimy-walls-sing.md delete mode 100644 .changeset/wicked-forks-rhyme.md diff --git a/.changeset/brown-flowers-explode.md b/.changeset/brown-flowers-explode.md deleted file mode 100644 index a845151cc..000000000 --- a/.changeset/brown-flowers-explode.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/eight-shoes-kneel.md b/.changeset/eight-shoes-kneel.md deleted file mode 100644 index bad8690f2..000000000 --- a/.changeset/eight-shoes-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopify/shopify-api": minor ---- - -Added support for the `future` configuration option. This will allow apps to opt in to upcoming features without needing to install RC packages. diff --git a/.changeset/olive-insects-tie.md b/.changeset/olive-insects-tie.md deleted file mode 100644 index 20a096d56..000000000 --- a/.changeset/olive-insects-tie.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@shopify/shopify-api": major ---- - -Removed support for Node 14, and removed existing code deprecations. - -<!-- markdown-link-check-disable --> - -For details on what's changed in this version, please see the [V8 migration guide](/packages/shopify-api/docs/migrating-to-v8.md). - -<!-- markdown-link-check-enable --> diff --git a/.changeset/sixty-months-fetch.md b/.changeset/sixty-months-fetch.md deleted file mode 100644 index a845151cc..000000000 --- a/.changeset/sixty-months-fetch.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/slimy-walls-sing.md b/.changeset/slimy-walls-sing.md deleted file mode 100644 index a845151cc..000000000 --- a/.changeset/slimy-walls-sing.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/wicked-forks-rhyme.md b/.changeset/wicked-forks-rhyme.md deleted file mode 100644 index 0a7a08adb..000000000 --- a/.changeset/wicked-forks-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopify/shopify-api": minor ---- - -Added support for the 2023-10 API version. diff --git a/packages/shopify-api/CHANGELOG.md b/packages/shopify-api/CHANGELOG.md index 5fab9b302..4ce8ebf3b 100644 --- a/packages/shopify-api/CHANGELOG.md +++ b/packages/shopify-api/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 8.0.0 + +### Major Changes + +- 737838dd: Removed support for Node 14, and removed existing code deprecations. + + <!-- markdown-link-check-disable --> + + For details on what's changed in this version, please see the [V8 migration guide](/packages/shopify-api/docs/migrating-to-v8.md). + + <!-- markdown-link-check-enable --> + +### Minor Changes + +- df5fb586: Added support for the `future` configuration option. This will allow apps to opt in to upcoming features without needing to install RC packages. +- cf60b3d1: Added support for the 2023-10 API version. + ## 7.7.0 ### Minor Changes @@ -322,7 +339,7 @@ Before: ```js - app.post('/graphql', async (req, res) => { + app.post("/graphql", async (req, res) => { await Shopify.Utils.graphqlProxy(req, res); }); ``` @@ -330,7 +347,7 @@ After: ```js - app.post('/graphql', async (req, res) => { + app.post("/graphql", async (req, res) => { const response = await Shopify.Utils.graphqlProxy(req, res); res.status(200).send(response.body); }); diff --git a/packages/shopify-api/package.json b/packages/shopify-api/package.json index 780349cb4..91a836729 100644 --- a/packages/shopify-api/package.json +++ b/packages/shopify-api/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-api", - "version": "7.7.0", + "version": "8.0.0", "description": "Shopify API Library for Node - accelerate development with support for authentication, graphql proxy, webhooks", "main": "./lib/index.js", "types": "./lib/index.d.ts", From 3f520e3e81f39209308b6ea1ab2ecc951e99077e Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:44:42 -0400 Subject: [PATCH 2/3] Preparing for release v8.0.0 --- packages/shopify-api/CHANGELOG.md | 8 +- packages/shopify-api/docs/migrating-to-v8.md | 85 +++++++++++++++++++- packages/shopify-api/lib/version.ts | 2 +- 3 files changed, 85 insertions(+), 10 deletions(-) diff --git a/packages/shopify-api/CHANGELOG.md b/packages/shopify-api/CHANGELOG.md index 4ce8ebf3b..6b845a161 100644 --- a/packages/shopify-api/CHANGELOG.md +++ b/packages/shopify-api/CHANGELOG.md @@ -6,12 +6,8 @@ - 737838dd: Removed support for Node 14, and removed existing code deprecations. - <!-- markdown-link-check-disable --> - For details on what's changed in this version, please see the [V8 migration guide](/packages/shopify-api/docs/migrating-to-v8.md). - <!-- markdown-link-check-enable --> - ### Minor Changes - df5fb586: Added support for the `future` configuration option. This will allow apps to opt in to upcoming features without needing to install RC packages. @@ -339,7 +335,7 @@ Before: ```js - app.post("/graphql", async (req, res) => { + app.post('/graphql', async (req, res) => { await Shopify.Utils.graphqlProxy(req, res); }); ``` @@ -347,7 +343,7 @@ After: ```js - app.post("/graphql", async (req, res) => { + app.post('/graphql', async (req, res) => { const response = await Shopify.Utils.graphqlProxy(req, res); res.status(200).send(response.body); }); diff --git a/packages/shopify-api/docs/migrating-to-v8.md b/packages/shopify-api/docs/migrating-to-v8.md index cbcc8f5fe..04d9a25ea 100644 --- a/packages/shopify-api/docs/migrating-to-v8.md +++ b/packages/shopify-api/docs/migrating-to-v8.md @@ -16,9 +16,14 @@ To make it easier to navigate this guide, here is an overview of the sections it ## Removing Node 14 support -Since dependencies we use in this package have started to use features and code syntax not available on Node 14, we needed to remove support for it so that we can continue to evolve our features. +We are removing support for Node 14 because: -In general, the majority of developers should be running Node 16 or newer already, which means they won't need to make any changes. +- Node 14 has not been actively supported by Node since October 2021 +- Node 14 has [reached its EOL](https://endoflife.date/nodejs) in February 2023 +- Over 98% of Shopify apps are running on newer versions. + +This means that over 98% of developers won't need to make any changes to their app to upgrade to this new version. +The remaining 2% should simply need to update their version of Node, and we don't anticipate there being an issues. If you're running on Node 14, you'll need to upgrade to at least Node 16 before you can upgrade this package. @@ -31,6 +36,69 @@ This package integrates an app's backend with Shopify, and in that scenario, app Since this package now supports private tokens properly, we're deprecating the `domain` and `storefrontAccessToken` fields when creating a Storefront client, in favour of using the same `session` other clients use. Support for `session` is a recent addition to this package, but we felt it's better to deprecate the old usage soon since it's not scalable and will potentially to lead to issues. +<details> +<summary>See an example</summary> + +Before: + +```ts +app.get('/my-endpoint', async (req, res) => { + const sessionId = await shopify.session.getCurrentId({ + isOnline: true, + rawRequest: req, + rawResponse: res, + }); + + // use sessionId to retrieve session from app's session storage + // getSessionFromStorage() must be provided by application + const session = await getSessionFromStorage(sessionId); + + const adminApiClient = new shopify.clients.Rest({session}); + const storefrontTokenResponse = await adminApiClient.post({ + path: 'storefront_access_tokens', + data: { + storefront_access_token: { + title: 'This is my test access token', + }, + }, + }); + + const storefrontAccessToken = + storefrontTokenResponse.body.storefront_access_token.access_token; + + // For simplicity, this example creates a token every time it's called, but that is not ideal. + // You can fetch existing Storefront access tokens using the Admin API client. + const storefrontClient = new shopify.clients.Storefront({ + domain: session.shop, + storefrontAccessToken, + apiVersion: ApiVersion.January23, + }); +}); +``` + +After: + +```ts +app.get('/my-endpoint', async (req, res) => { + const sessionId = await shopify.session.getCurrentId({ + isOnline: true, + rawRequest: req, + rawResponse: res, + }); + + // use sessionId to retrieve session from app's session storage + // getSessionFromStorage() must be provided by the application + const session = await getSessionFromStorage(sessionId); + + const client = new shopify.clients.Storefront({ + session, + apiVersion: ApiVersion.January23, + }); +}); +``` + +</details> + > **Note**: > Going forward, changes like this will use future flags to allow for a longer grace period. We thank community members for your patience while we improve our tooling! @@ -40,6 +108,17 @@ Support for `session` is a recent addition to this package, but we felt it's bet - As per Shopify's [API release schedule](https://shopify.dev/docs/api/usage/versioning#release-schedule), we support the last 4 versions of the API. To match the API, this library no longer supports versions `2022-04` and `2022-07`. + If you need to upgrade your app's API version, please use the new version when calling the `shopifyApi` function: + + ```ts + import {ApiVersion, shopifyApi} from '@shopify/shopify-api'; + + const shopify = shopifyApi({ + // ... + apiVersion: ApiVersion.October23, + }); + ``` + - Removed support for the `privateMetafieldNamespaces` field in webhooks. See [the documentation](https://shopify.dev/docs/apps/custom-data/metafields/migrate-private-metafields) for more information. -- When calling `shopifyApi`, the `adminApiAccessToken` setting is now mandatory when `isCustomStoreApp` is true. +- When calling `shopifyApi`, the `adminApiAccessToken` setting is now mandatory when `isCustomStoreApp` is true. This planned deprecation has been logging an error since v7.1.0 (released in May 2023). Now it will throw an error. - Removed deprecated v5 types. diff --git a/packages/shopify-api/lib/version.ts b/packages/shopify-api/lib/version.ts index e5077cfa9..114e05e19 100644 --- a/packages/shopify-api/lib/version.ts +++ b/packages/shopify-api/lib/version.ts @@ -1 +1 @@ -export const SHOPIFY_API_LIBRARY_VERSION = '7.7.0'; +export const SHOPIFY_API_LIBRARY_VERSION = '8.0.0'; From 72cb29646451931555eeb256af24609f319538f9 Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:48:02 -0400 Subject: [PATCH 3/3] Appeasing the link checker beast --- packages/shopify-api/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/shopify-api/CHANGELOG.md b/packages/shopify-api/CHANGELOG.md index 6b845a161..2ebb26ce4 100644 --- a/packages/shopify-api/CHANGELOG.md +++ b/packages/shopify-api/CHANGELOG.md @@ -6,8 +6,12 @@ - 737838dd: Removed support for Node 14, and removed existing code deprecations. + <!-- markdown-link-check-disable --> + For details on what's changed in this version, please see the [V8 migration guide](/packages/shopify-api/docs/migrating-to-v8.md). + <!-- markdown-link-check-enable --> + ### Minor Changes - df5fb586: Added support for the `future` configuration option. This will allow apps to opt in to upcoming features without needing to install RC packages.