Skip to content

Commit 4838a95

Browse files
[ci] release v1.x-2022-07 (#2221)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 401cf37 commit 4838a95

File tree

12 files changed

+88
-88
lines changed

12 files changed

+88
-88
lines changed

.changeset/brave-badgers-flow.md

-56
This file was deleted.

.changeset/many-kiwis-draw.md

-12
This file was deleted.

.changeset/yellow-cheetahs-care.md

-12
This file was deleted.

packages/create-hydrogen-app/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
## 1.5.0
4+
35
## 1.4.4
46

57
## 1.4.3

packages/create-hydrogen-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"access": "public",
55
"@shopify:registry": "https://registry.npmjs.org"
66
},
7-
"version": "1.4.4",
7+
"version": "1.5.0",
88
"main": "index.js",
99
"license": "MIT",
1010
"bin": {

packages/hydrogen/CHANGELOG.md

+79-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,83 @@
11
# Changelog
22

3+
## 1.5.0
4+
5+
### Minor Changes
6+
7+
- Special thank you to @kcarra for adding new mocked Providers for making testing easier! ([#2224](https://github.com/Shopify/hydrogen/pull/2224)) by [@blittle](https://github.com/blittle)
8+
9+
1. Add `ServerRequestProvider` mock for testing server components:
10+
11+
```ts
12+
import useServerHook from './useServerHook.server'; // Server hook to test
13+
import {test, vi} from 'vitest';
14+
import {renderHook} from '@testing-library/react-hooks';
15+
import {ShopifyProvider} from '@shopify/hydrogen';
16+
import {MockedServerRequestProvider} from '@shopify/hydrogen/testing';
17+
18+
describe('useServerHook', () => {
19+
test('mocked ServerRequest Context', () => {
20+
const wrapper = ({children}: {children: React.ReactElement}) => (
21+
<MockedServerRequestProvider>
22+
<ShopifyProvider shopifyConfig={mockShopifyConfig}>
23+
{children}
24+
</ShopifyProvider>
25+
</MockedServerRequestProvider>
26+
);
27+
const {result} = renderHook(() => useServerHook(), {wrapper});
28+
expect(result.current).toEqual({status: 'active'});
29+
});
30+
});
31+
```
32+
33+
2. Add `ShopifyTestProviders` mock for easier testing client components and using client components in other contexts, like Storybook:
34+
35+
```ts
36+
import {ComponentMeta, ComponentStory} from '@storybook/react';
37+
import React from 'react';
38+
import BoxCardUI from './BoxCard.ui';
39+
import {ShopifyTestProviders} from '@shopify/hydrogen/testing';
40+
41+
export default {
42+
title: 'Components/BoxCard',
43+
component: BoxCardUI,
44+
decorators: [],
45+
} as ComponentMeta<typeof BoxCardUI>;
46+
47+
const Template: ComponentStory<typeof BoxCardUI> = (args) => {
48+
return (
49+
<ShopifyTestProviders>
50+
<BoxCardUI {...args} /> // This component imports import{' '}
51+
{(Image, Link, Money)} from '@shopify/hydrogen'
52+
</ShopifyTestProviders>
53+
);
54+
};
55+
56+
export const BoxCard = Template.bind({});
57+
BoxCard.args = mockShopifyProduct;
58+
```
59+
60+
* Updated the Storefront API version of Hydrogen to the `2022-10` release. ([#2208](https://github.com/Shopify/hydrogen/pull/2208)) by [@frehner](https://github.com/frehner)
61+
62+
**This is a backwards-compatible change**; if you are still on the `2022-07` version, you may stay on that version without any issues. However, it is still recommended that you upgrade to `2022-10` as soon as possible.
63+
64+
For more information about the Storefront API, refer to:
65+
66+
- The [versioning documentation](https://shopify.dev/api/usage/versioning)
67+
- The [`2022-10` release notes](https://shopify.dev/api/release-notes/2022-10#graphql-storefont-api-changes). Take note that Hydrogen never used the `Money` fields internally, so the breaking change listed there does not affect Hydrogen.
68+
69+
### Patch Changes
70+
71+
- Experimental version of a new cart provider is ready for beta testing. ([#2219](https://github.com/Shopify/hydrogen/pull/2219)) by [@lordofthecactus](https://github.com/lordofthecactus)
72+
73+
`CartProviderV2` fixes race conditions with our current cart provider. After beta, `CartProviderV2` will become `CartProvider` requiring no code changes.
74+
75+
To try this new cart provider:
76+
77+
```
78+
import {CartProviderV2} from '@shopify/hydrogen/experimental';
79+
```
80+
381
## 1.4.4
482

583
### Patch Changes
@@ -335,7 +413,7 @@ If your Store is based on the "Demo Store" tempate, and you are using the `test:
335413
} from '@shopify/hydrogen/platforms';
336414

337415
// Platform entry handler
338-
export default function (request) {
416+
export default function(request) {
339417
if (isAsset(new URL(request.url).pathname)) {
340418
return platformAssetHandler(request);
341419
}

packages/hydrogen/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"engines": {
88
"node": ">=14"
99
},
10-
"version": "1.4.4",
10+
"version": "1.5.0",
1111
"description": "Modern custom Shopify storefronts",
1212
"license": "MIT",
1313
"main": "dist/esnext/index.js",

packages/hydrogen/src/version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const LIB_VERSION = '1.4.4';
1+
export const LIB_VERSION = '1.5.0';

packages/playground/async-config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@cloudflare/kv-asset-handler": "*",
20-
"@shopify/hydrogen": "^1.4.4",
20+
"@shopify/hydrogen": "^1.5.0",
2121
"miniflare": "^1.3.3",
2222
"react": "^18.2.0",
2323
"react-dom": "^18.2.0"

packages/playground/server-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@cloudflare/kv-asset-handler": "*",
20-
"@shopify/hydrogen": "^1.4.4",
20+
"@shopify/hydrogen": "^1.5.0",
2121
"miniflare": "^1.3.3",
2222
"react": "^18.2.0",
2323
"react-dom": "^18.2.0"

templates/demo-store/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"prettier": "@shopify/prettier-config",
3939
"dependencies": {
4040
"@headlessui/react": "^1.7.0",
41-
"@shopify/hydrogen": "^1.4.4",
41+
"@shopify/hydrogen": "^1.5.0",
4242
"clsx": "^1.1.1",
4343
"graphql-tag": "^2.12.6",
4444
"react": "^18.2.0",

templates/hello-world/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"vite": "^2.9.13"
2121
},
2222
"dependencies": {
23-
"@shopify/hydrogen": "^1.4.4",
23+
"@shopify/hydrogen": "^1.5.0",
2424
"react": "^18.2.0",
2525
"react-dom": "^18.2.0"
2626
}

0 commit comments

Comments
 (0)