Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1005 from Shopify/changeset-release/main
Browse files Browse the repository at this point in the history
Packages for release
  • Loading branch information
paulomarg authored Oct 12, 2023
2 parents 81a155a + 72cb296 commit 8c83c9f
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 32 deletions.
2 changes: 0 additions & 2 deletions .changeset/brown-flowers-explode.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eight-shoes-kneel.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/olive-insects-tie.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/sixty-months-fetch.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/slimy-walls-sing.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wicked-forks-rhyme.md

This file was deleted.

17 changes: 17 additions & 0 deletions packages/shopify-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
85 changes: 82 additions & 3 deletions packages/shopify-api/docs/migrating-to-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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!
Expand All @@ -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.
2 changes: 1 addition & 1 deletion packages/shopify-api/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SHOPIFY_API_LIBRARY_VERSION = '7.7.0';
export const SHOPIFY_API_LIBRARY_VERSION = '8.0.0';
2 changes: 1 addition & 1 deletion packages/shopify-api/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 8c83c9f

Please sign in to comment.