Skip to content

Commit

Permalink
SFAPI 2024-10 update (#2570)
Browse files Browse the repository at this point in the history
Co-authored-by: rbshop <[email protected]>
  • Loading branch information
wizardlyhel and rbshop authored Oct 21, 2024
1 parent 54a8824 commit 84a66b1
Show file tree
Hide file tree
Showing 23 changed files with 1,084 additions and 1,395 deletions.
9 changes: 9 additions & 0 deletions .changeset/quick-hotels-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@shopify/hydrogen-react': patch
'skeleton': patch
'@shopify/hydrogen': patch
'@shopify/cli-hydrogen': patch
'@shopify/create-hydrogen': patch
---

Update to 2024-10 SFAPI
2 changes: 1 addition & 1 deletion examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@remix-run/node": "^2.10.1",
"@remix-run/react": "^2.10.1",
"@remix-run/server-runtime": "^2.10.1",
"@shopify/hydrogen": "2024.7.9",
"@shopify/hydrogen": "2024.10.0",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"express": "^4.19.2",
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hydrogen-react/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
customerAccountApiCustomScalars,
} from './src/codegen.helpers';

const SF_API_VERSION = '2024-07';
const CA_API_VERSION = '2024-07';
const SF_API_VERSION = '2024-10';
const CA_API_VERSION = '2024-10';

const storefrontAPISchema: CodegenConfig['schema'] = {
[`https://hydrogen-preview.myshopify.com/api/${SF_API_VERSION}/graphql.json`]:
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/customer-account.schema.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/hydrogen-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/hydrogen-react",
"version": "2024.7.6",
"version": "2024.10.0",
"description": "React components, hooks, and utilities for creating custom Shopify storefronts",
"homepage": "https://github.com/Shopify/hydrogen/tree/main/packages/hydrogen-react",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/CartProvider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function CartComponent() {
const config: ShopifyProviderProps = {
storeDomain: 'hydrogen-preview.myshopify.com',
storefrontToken: '3b580e70970c4528da70c98e097c2fa0',
storefrontApiVersion: '2024-07',
storefrontApiVersion: '2024-10',
countryIsoCode: 'CA',
languageIsoCode: 'EN',
};
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/ShopPayButton2.example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function App() {
<ShopifyProvider
storeDomain="my-store"
storefrontToken="abc123"
storefrontApiVersion="2024-07"
storefrontApiVersion="2024-10"
countryIsoCode="CA"
languageIsoCode="EN"
>
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/ShopPayButton2.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function App() {
<ShopifyProvider
storeDomain="my-store"
storefrontToken="abc123"
storefrontApiVersion="2024-07"
storefrontApiVersion="2024-10"
countryIsoCode="CA"
languageIsoCode="EN"
>
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/ShopifyProvider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ export const Default = Template.bind({});
Default.args = {
storeDomain: 'notashop.myshopify.com',
storefrontToken: 'abc123',
version: '2024-07',
version: '2024-10',
};
16 changes: 8 additions & 8 deletions packages/hydrogen-react/src/ShopifyProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {PartialDeep} from 'type-fest';
const SHOPIFY_CONFIG: ShopifyProviderProps = {
storeDomain: 'https://notashop.myshopify.com',
storefrontToken: 'abc123',
storefrontApiVersion: '2024-07',
storefrontApiVersion: '2024-10',
countryIsoCode: 'CA',
languageIsoCode: 'EN',
};
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('<ShopifyProvider/>', () => {
});

expect(result.current.getStorefrontApiUrl()).toBe(
'https://notashop.myshopify.com/api/2024-07/graphql.json',
'https://notashop.myshopify.com/api/2024-10/graphql.json',
);
});

Expand Down Expand Up @@ -84,7 +84,7 @@ describe('<ShopifyProvider/>', () => {
).toEqual({
'X-SDK-Variant': 'hydrogen-react',
'X-SDK-Variant-Source': 'react',
'X-SDK-Version': '2024-07',
'X-SDK-Version': '2024-10',
'X-Shopify-Storefront-Access-Token': 'abc123',
'content-type': 'application/json',
});
Expand All @@ -110,7 +110,7 @@ describe('<ShopifyProvider/>', () => {
).toEqual({
'X-SDK-Variant': 'hydrogen-react',
'X-SDK-Variant-Source': 'react',
'X-SDK-Version': '2024-07',
'X-SDK-Version': '2024-10',
'X-Shopify-Storefront-Access-Token': 'newtoken',
'content-type': 'application/graphql',
});
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('<ShopifyProvider/>', () => {
});

expect(result.current.getStorefrontApiUrl()).toBe(
'https://notashop.myshopify.com/api/2024-07/graphql.json',
'https://notashop.myshopify.com/api/2024-10/graphql.json',
);
});

Expand All @@ -203,7 +203,7 @@ describe('<ShopifyProvider/>', () => {
result.current.getStorefrontApiUrl({
storeDomain: 'https://test.myshopify.com',
}),
).toBe('https://test.myshopify.com/api/2024-07/graphql.json');
).toBe('https://test.myshopify.com/api/2024-10/graphql.json');
});

it(`handles when a '/' is at the end of the url and doesn't add an extra one`, () => {
Expand All @@ -219,7 +219,7 @@ describe('<ShopifyProvider/>', () => {
});

expect(result.current.getStorefrontApiUrl()).toBe(
'https://notashop.myshopify.com/api/2024-07/graphql.json',
'https://notashop.myshopify.com/api/2024-10/graphql.json',
);
});
});
Expand All @@ -233,6 +233,6 @@ export function getShopifyConfig(
languageIsoCode: config.languageIsoCode ?? 'EN',
storeDomain: config.storeDomain ?? 'https://notashop.myshopify.io',
storefrontToken: config.storefrontToken ?? 'abc123',
storefrontApiVersion: config.storefrontApiVersion ?? '2024-07',
storefrontApiVersion: config.storefrontApiVersion ?? '2024-10',
};
}
Loading

0 comments on commit 84a66b1

Please sign in to comment.