Skip to content

Commit

Permalink
[ci] release v1.x-2022-07 (#1106)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] committed Apr 26, 2022
1 parent 7138bb1 commit 964f0ca
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 118 deletions.
54 changes: 0 additions & 54 deletions .changeset/big-crews-impress.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-buses-speak.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-oranges-dance.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/serious-mayflies-sleep.md

This file was deleted.

24 changes: 0 additions & 24 deletions .changeset/smart-bulldogs-bathe.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tasty-experts-flash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tough-lies-change.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/two-socks-pretend.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/unlucky-crabs-fry.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/template-hydrogen-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"dependencies": {
"@headlessui/react": "^1.5.0",
"@shopify/hydrogen": "^0.16.1",
"@shopify/hydrogen": "^0.17.0",
"body-parser": "^1.19.1",
"compression": "^1.7.4",
"graphql-tag": "^2.12.4",
Expand Down
82 changes: 82 additions & 0 deletions packages/create-hydrogen-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,87 @@
# Changelog

## 0.17.0

### Minor Changes

- [#1044](https://github.com/Shopify/hydrogen/pull/1044) [`c8f5934d`](https://github.com/Shopify/hydrogen/commit/c8f5934d85db63162a13256cfcf21098b390887b) Thanks [@blittle](https://github.com/blittle)! - Hydrogen now has a built in session and cookie implementation. Read more about [how sessions work in Hydrogen](https://shopify.dev/custom-storefronts/hydrogen/framework/sessions). The starter template also includes a cookie session storage implementation. To use the new session implementation within an existing Hydrogen app:

```diff
import renderHydrogen from '@shopify/hydrogen/entry-server';
import {
Router,
Route,
FileRoutes,
ShopifyProvider,
+ CookieSessionStorage,
} from '@shopify/hydrogen';
import {Suspense} from 'react';
import shopifyConfig from '../shopify.config';
import DefaultSeo from './components/DefaultSeo.server';
import NotFound from './components/NotFound.server';
import LoadingFallback from './components/LoadingFallback';
import CartProvider from './components/CartProvider.client';

function App({routes}) {
return (
<Suspense fallback={<LoadingFallback />}>
<ShopifyProvider shopifyConfig={shopifyConfig}>
<CartProvider>
<DefaultSeo />
<Router>
<FileRoutes routes={routes} />
<Route path="*" page={<NotFound />} />
</Router>
</CartProvider>
</ShopifyProvider>
</Suspense>
);
}

const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');

export default renderHydrogen(App, {
routes,
shopifyConfig,
+ session: CookieSessionStorage('__session', {
+ path: '/',
+ httpOnly: true,
+ secure: process.env.NODE_ENV === 'production',
+ sameSite: 'strict',
+ maxAge: 60 * 60 * 24 * 30,
+ }),
});

```

* [#1134](https://github.com/Shopify/hydrogen/pull/1134) [`7138bb1d`](https://github.com/Shopify/hydrogen/commit/7138bb1dae884c9e057d1da2ba1f51cd05fff45a) Thanks [@michenly](https://github.com/michenly)! - Upgrade @shopify/cli-hydrogen to v2.0.0

- [#881](https://github.com/Shopify/hydrogen/pull/881) [`a31babfb`](https://github.com/Shopify/hydrogen/commit/a31babfb9bf73b732a18487582cec129acbb8b5e) Thanks [@jplhomer](https://github.com/jplhomer)! - ## Change from serverState to serverProps

**Breaking changes:**

1. `useServerState()` is gone. Use `useServerProps()` instead
2. `useServerProps()` is reset on each page navigation. Previously `useServerState()` was not.
3. `useServerProps()` does not contain `pathname` and `search`. Use the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook to programmatically navigate instead.

**Explanation:**

The current behavior of server state is to **persist indefinitely** (until a hard page reload). This works great for things like the CountrySelector, where the updated state is meant to persist across navigations. This breaks down for many other use cases. Consider a collection paginator: if you paginate through to the second page of a collection using server state, visit a product page, and then go to a different collection page, the new collection page will use that same pagination variable in server state. This will result in a wonky or errored experience.

Additionally, we have found that the term for `serverState` is confusing. The hook is used within client components, yet the state is passed as a prop to server components.

As a result, `serverState` is now gone. Instead communicating between client and server components is through `serverProps`. If a client component wants to re-render server content, it just calls `setServerProps('some', 'data')`. Those props will be serialized to the server, and the server component will re-render. Additionally, the server props are reset on page navigation. So that they will not bleed between pages (fixes #331).

If you previously relied on `serverState` for global state in your app, you shouldn't use `serverProps` anymore. Instead we'll introduce a new session based mechanism for global state (in the meantime you could manually manage a cookie).

Lastly, `serverProps` no longer include the `pathname` and `search` parameters. Programmatically navigate in hydrogen instead with the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook.

### Patch Changes

- [#1124](https://github.com/Shopify/hydrogen/pull/1124) [`737237d2`](https://github.com/Shopify/hydrogen/commit/737237d2229a711b87092c65cbcec8305c1a7460) Thanks [@cartogram](https://github.com/cartogram)! - Changing the casing on the fetchpriority attribute to all lowercase on Gallery images to prevent a React warning.

* [#1125](https://github.com/Shopify/hydrogen/pull/1125) [`552d627b`](https://github.com/Shopify/hydrogen/commit/552d627b5a621c65853d3b6d3825bfe47f7ccff0) Thanks [@cartogram](https://github.com/cartogram)! - Fixed a bug where the price on the product details was not updating when the variant changed.

## 0.16.1

## 0.16.0
Expand Down
2 changes: 1 addition & 1 deletion packages/create-hydrogen-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"access": "public",
"@shopify:registry": "https://registry.npmjs.org"
},
"version": "0.16.1",
"version": "0.17.0",
"main": "index.js",
"license": "MIT",
"bin": {
Expand Down
84 changes: 84 additions & 0 deletions packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,89 @@
# Changelog

## 0.17.0

### Minor Changes

- [#1044](https://github.com/Shopify/hydrogen/pull/1044) [`c8f5934d`](https://github.com/Shopify/hydrogen/commit/c8f5934d85db63162a13256cfcf21098b390887b) Thanks [@blittle](https://github.com/blittle)! - Hydrogen now has a built in session and cookie implementation. Read more about [how sessions work in Hydrogen](https://shopify.dev/custom-storefronts/hydrogen/framework/sessions). The starter template also includes a cookie session storage implementation. To use the new session implementation within an existing Hydrogen app:

```diff
import renderHydrogen from '@shopify/hydrogen/entry-server';
import {
Router,
Route,
FileRoutes,
ShopifyProvider,
+ CookieSessionStorage,
} from '@shopify/hydrogen';
import {Suspense} from 'react';
import shopifyConfig from '../shopify.config';
import DefaultSeo from './components/DefaultSeo.server';
import NotFound from './components/NotFound.server';
import LoadingFallback from './components/LoadingFallback';
import CartProvider from './components/CartProvider.client';

function App({routes}) {
return (
<Suspense fallback={<LoadingFallback />}>
<ShopifyProvider shopifyConfig={shopifyConfig}>
<CartProvider>
<DefaultSeo />
<Router>
<FileRoutes routes={routes} />
<Route path="*" page={<NotFound />} />
</Router>
</CartProvider>
</ShopifyProvider>
</Suspense>
);
}

const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');

export default renderHydrogen(App, {
routes,
shopifyConfig,
+ session: CookieSessionStorage('__session', {
+ path: '/',
+ httpOnly: true,
+ secure: process.env.NODE_ENV === 'production',
+ sameSite: 'strict',
+ maxAge: 60 * 60 * 24 * 30,
+ }),
});

```

* [#881](https://github.com/Shopify/hydrogen/pull/881) [`a31babfb`](https://github.com/Shopify/hydrogen/commit/a31babfb9bf73b732a18487582cec129acbb8b5e) Thanks [@jplhomer](https://github.com/jplhomer)! - ## Change from serverState to serverProps

**Breaking changes:**

1. `useServerState()` is gone. Use `useServerProps()` instead
2. `useServerProps()` is reset on each page navigation. Previously `useServerState()` was not.
3. `useServerProps()` does not contain `pathname` and `search`. Use the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook to programmatically navigate instead.

**Explanation:**

The current behavior of server state is to **persist indefinitely** (until a hard page reload). This works great for things like the CountrySelector, where the updated state is meant to persist across navigations. This breaks down for many other use cases. Consider a collection paginator: if you paginate through to the second page of a collection using server state, visit a product page, and then go to a different collection page, the new collection page will use that same pagination variable in server state. This will result in a wonky or errored experience.

Additionally, we have found that the term for `serverState` is confusing. The hook is used within client components, yet the state is passed as a prop to server components.

As a result, `serverState` is now gone. Instead communicating between client and server components is through `serverProps`. If a client component wants to re-render server content, it just calls `setServerProps('some', 'data')`. Those props will be serialized to the server, and the server component will re-render. Additionally, the server props are reset on page navigation. So that they will not bleed between pages (fixes #331).

If you previously relied on `serverState` for global state in your app, you shouldn't use `serverProps` anymore. Instead we'll introduce a new session based mechanism for global state (in the meantime you could manually manage a cookie).

Lastly, `serverProps` no longer include the `pathname` and `search` parameters. Programmatically navigate in hydrogen instead with the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook.

- [#1098](https://github.com/Shopify/hydrogen/pull/1098) [`f3dafec4`](https://github.com/Shopify/hydrogen/commit/f3dafec4b3113c85e33a15ee70b3f91c741e74f9) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Obfuscate chunk filename on production build

### Patch Changes

- [#1131](https://github.com/Shopify/hydrogen/pull/1131) [`8199023b`](https://github.com/Shopify/hydrogen/commit/8199023b88924db156e2a687dd6dfce2665ab638) Thanks [@blittle](https://github.com/blittle)! - Fix hydration issue where strings with $ would get converted to a single $

* [#1105](https://github.com/Shopify/hydrogen/pull/1105) [`57ececf8`](https://github.com/Shopify/hydrogen/commit/57ececf82ee0c264abc256df8b02555772cc2419) Thanks [@frehner](https://github.com/frehner)! - Regenerate the graphql.schema.json which should fix the sudden end-of-line termination, and makes the schema valid again.

- [#1099](https://github.com/Shopify/hydrogen/pull/1099) [`6b50d371`](https://github.com/Shopify/hydrogen/commit/6b50d37158aab1a4a82626e09865d27e14adfbfb) Thanks [@blittle](https://github.com/blittle)! - Fix Hydrogen to not hard fail when client analytics doesn't load. Analytics might fail to load due to client-side adblockers.

## 0.16.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"engines": {
"node": ">=14"
},
"version": "0.16.1",
"version": "0.17.0",
"description": "Modern custom Shopify storefronts",
"license": "MIT",
"main": "dist/esnext/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const LIB_VERSION = '0.16.1';
export const LIB_VERSION = '0.17.0';
2 changes: 1 addition & 1 deletion packages/playground/server-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@cloudflare/kv-asset-handler": "*",
"@shopify/hydrogen": "^0.16.1",
"@shopify/hydrogen": "^0.17.0",
"miniflare": "^1.3.3",
"react": "0.0.0-experimental-2bf7c02f0-20220314",
"react-dom": "0.0.0-experimental-2bf7c02f0-20220314"
Expand Down

0 comments on commit 964f0ca

Please sign in to comment.