Skip to content

Commit

Permalink
[ci] release v1.x-2022-07 (#1845)
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] authored Jul 26, 2022
1 parent 0a8fdc1 commit 15da36d
Show file tree
Hide file tree
Showing 19 changed files with 102 additions and 124 deletions.
5 changes: 0 additions & 5 deletions .changeset/empty-humans-wink.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/funny-items-travel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/giant-comics-pump.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/olive-ties-live.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/polite-goats-smile.md

This file was deleted.

44 changes: 0 additions & 44 deletions .changeset/serious-scissors-lie.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/small-vans-switch.md

This file was deleted.

28 changes: 0 additions & 28 deletions .changeset/thin-pigs-mate.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thirty-lies-fail.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wise-masks-shop.md

This file was deleted.

2 changes: 2 additions & 0 deletions packages/create-hydrogen-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## 1.2.0

## 1.1.0

## 1.0.2
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": "1.1.0",
"version": "1.2.0",
"main": "index.js",
"license": "MIT",
"bin": {
Expand Down
94 changes: 93 additions & 1 deletion packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,97 @@
# Changelog

## 1.2.0

### Minor Changes

- Add a new experimental Forms and mutations feature. Read more https://shopify.dev/custom-storefronts/hydrogen/framework/forms ([#1552](https://github.com/Shopify/hydrogen/pull/1552)) by [@blittle](https://github.com/blittle)

* `CartLineQuantityAdjustButton`, `BuyNowButton`, and `AddToCartButton` now have an `as` property. The types for these components have also been improved. ([#1827](https://github.com/Shopify/hydrogen/pull/1827)) by [@blittle](https://github.com/blittle)

- Added a new experimental CSS approach to support importing styles directly in React Server Components. This feature must be enabled manually. ([#1843](https://github.com/Shopify/hydrogen/pull/1843)) by [@frandiox](https://github.com/frandiox)

Until now, we had experimental support for CSS Modules with some minor restrictions and drawbacks:

- Only server components that were the default export had access to the CSS Module automatically (i.e. it required extra work for named exports).
- CSS Module was duplicated when used in multiple components.
- RSC responses had all the CSS inlined, making them much larger.

The new CSS approach adds full support for CSS Modules without the previous restrictions and drawbacks.

Aside from that, it also adds support for pure CSS and enables a way to integrate with tools that provide CSS-in-JS at build time. All the CSS imported in both client and server components will be extracted in a CSS file at build time and downloaded with a `<link rel="stylesheet">` tag. During development, styles will be inlined in the DOM to better support HMR.

To activate this new experimental feature, pass the `experimental.css: 'global'` option to Hydrogen's Vite plugin:

```js
// vite.config.js
export default {
plugins: [hydrogen({experimental: {css: 'global'}})],
};
```

Examples:

```jsx
// App.server.jsx using pure CSS with global classes
import './my-red-style.css';

function App() {
return <div className="red">...</div>;
}
```

```jsx
// App.server.jsx using CSS Modules with scoped classes
import {red} from './my-red.module.css';

function App() {
return <div className={red}>...</div>;
}
```

* `loadScript` and `useLoadScript` can now inject in the <head /> ([#1870](https://github.com/Shopify/hydrogen/pull/1870)) by [@juanpprieto](https://github.com/juanpprieto)

- Add support for custom 500 error pages. If an unexpected error occurs while rendering a route, Hydrogen will respond with a 500 HTTP error and render a default error page. Define a custom error page with the `serverErrorPage` configuration property: ([#1867](https://github.com/Shopify/hydrogen/pull/1867)) by [@blittle](https://github.com/blittle)

```tsx
import {defineConfig} from '@shopify/hydrogen/config';

export default defineConfig({
...
serverErrorPage: '/src/Error.jsx',
});
```

The `serverErrorPage` property defaults to `/src/Error.{jsx,tsx}`. The custom error page is passed an `Error` property:

```tsx
export default function Error({error}) {
return (
<div>
<h1>An unknown error occured!</h1>
<h2>{error.message}</h2>
<h3>{error.stack}</h3>
</div>
);
}
```

### Patch Changes

- Log detailed error message for Storefront API root errors ([#1822](https://github.com/Shopify/hydrogen/pull/1822)) by [@wizardlyhel](https://github.com/wizardlyhel)

* `locale` calculation logic and docs have been updated to support Shopify languages with extended language subtags. ([#1836](https://github.com/Shopify/hydrogen/pull/1836)) by [@lordofthecactus](https://github.com/lordofthecactus)

The following is how we calculate `locale`:
If the Shopify `language` includes a region, then this value is used to calculate the `locale` and `countryCode` is disregarded. For example, if `language` is `PT_BR` (Brazilian Portuguese), then `locale` is calculated as `PT-BR`.
If the Shopify `language` doesn't include a region, then this value is merged with the `countryCode` to calculate the `locale`. For example, if `language` is `EN` (English) and `countryCode` is `US` (United States), then `locale` is calculated as `EN-US`.

- Added optional sellingPlanId prop to AddToCartButton.client.tsx ([#1821](https://github.com/Shopify/hydrogen/pull/1821)) by [@ChrisKG32](https://github.com/ChrisKG32)

* Fix: Hydrogen no longer caches error responses. Any 400 or 500 level response will not have a cache control-header, nor will Hydrogen cache it internally. ([#1873](https://github.com/Shopify/hydrogen/pull/1873)) by [@blittle](https://github.com/blittle)

- Allow `sourceProps` to be passed to `<Video/>`'s underlying `<source>` elements. ([#1847](https://github.com/Shopify/hydrogen/pull/1847)) by [@frehner](https://github.com/frehner)

## 1.1.0

### Migration for Stores based on the "Demo Store" template
Expand All @@ -23,7 +115,7 @@ If your Store is based on the "Demo Store" tempate, and you are using the `test:
} from '@shopify/hydrogen/platforms';

// Platform entry handler
export default function (request) {
export default function(request) {
if (isAsset(new URL(request.url).pathname)) {
return platformAssetHandler(request);
}
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": "1.1.0",
"version": "1.2.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 = '1.1.0';
export const LIB_VERSION = '1.2.0';
2 changes: 1 addition & 1 deletion packages/playground/async-config/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": "^1.1.0",
"@shopify/hydrogen": "^1.2.0",
"miniflare": "^1.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
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": "^1.1.0",
"@shopify/hydrogen": "^1.2.0",
"miniflare": "^1.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion templates/demo-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@headlessui/react": "^1.6.4",
"@heroicons/react": "^1.0.6",
"@shopify/hydrogen": "^1.1.0",
"@shopify/hydrogen": "^1.2.0",
"clsx": "^1.1.1",
"graphql-tag": "^2.12.6",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion templates/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"vite": "^2.9.0"
},
"dependencies": {
"@shopify/hydrogen": "^1.1.0",
"@shopify/hydrogen": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down

0 comments on commit 15da36d

Please sign in to comment.