Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/chilled-baboons-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@shopify/hydrogen': minor
---

**Breaking change**

The utility `isClient` has been renamed to `isBrowser`. This is because the utility really checks if the running context is a browser, _not_ if the context is a client component.

All client components by default also run on the server when they are server rendered. If you don't want that to happen, use the `isBrowser()` hook. Remember that anything not server rendered will be unavailable for SEO bots.
5 changes: 5 additions & 0 deletions .changeset/clean-lies-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Rename internal Hydrogen global variables that could conflict with third party libraries that use the same names.
25 changes: 25 additions & 0 deletions .changeset/cool-spies-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
'@shopify/hydrogen': minor
---

Add `scroll` prop to `Link` and `navigate` to allow the scroll restoration behavior to be disabled.

By default, when a `<Link>` component is clicked, Hydrogen emulates default browser behavior and attempts to restore the scroll position previously used in the visitor's session. For new pages, this defaults to scrolling to the top of the page.

However, if you are building a user interface that should fetch a new server components request and update the URL but not modify scroll position, then you can disable scroll restoration using the `scroll` prop:

```jsx
import {Link} from '@shopify/hydrogen';
export default function Index({request}) {
const url = new URL(request.normalizedUrl);

return (
<>
<p>Current param is: {url.searchParams.get('param')}</p>
<Link to="/?param=foo" scroll={false}>
Update param to foo
</Link>
</>
);
}
```
9 changes: 9 additions & 0 deletions .changeset/fair-rats-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@shopify/hydrogen': minor
---

With the introduction of authenticated pages, we also now provide the ability to prevent pages from being indexed by bots. You can do so by passing `noindex` to the `Seo` component:

```jsx
<Seo type="noindex" data={{title: 'Login'}} />
```
5 changes: 5 additions & 0 deletions .changeset/famous-lobsters-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Improve component bundling to reduce the total amount of JS files downloaded in the browser.
5 changes: 5 additions & 0 deletions .changeset/five-cougars-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Reduce CPU consumption when rendering React Server Components.
5 changes: 5 additions & 0 deletions .changeset/fresh-cooks-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Confusing warnings that are not actionable have been removed.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-forks-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-hydrogen-app': patch
---

Small styling fix to country selector in demo store template
5 changes: 5 additions & 0 deletions .changeset/polite-years-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Propagate a better error message when the response from the storefront API is not JSON parseable
5 changes: 5 additions & 0 deletions .changeset/rich-seals-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Enable streaming by default for all platforms
44 changes: 44 additions & 0 deletions .changeset/rotten-nails-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
'@shopify/hydrogen': minor
---

**Breaking change**: The `setLogger` and `setLoggerOptions` utilities have been removed. The same information can now be passed under the `logger` property in Hydrogen config:

```diff
// App.server.jsx

-import {setLogger, setLoggerOptions} from '@shopify/hydrogen';

-setLogger({
- trace() {},
- error() {},
- // ...
-});

-setLoggerOptions({
- showQueryTiming: true,
- showCacheControlHeader: true,
- // ...
-});

function App() {
// ...
}

export default renderHydrogen(App);
```

```diff
// hydrogen.config.js

export default defineConfig({
// ...
+ logger: {
+ trace() {},
+ error() {},
+ showQueryTiming: true,
+ showCacheControlHeader: true,
+ // ...
+ },
});
```
16 changes: 16 additions & 0 deletions .changeset/rude-yaks-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@shopify/hydrogen': minor
---

The `response.writeHead` method has been removed, while `response.status` and `response.statusText` are now writable.

```diff
function App({response}) {
- response.writeHead({
- headers: {'custom-header': 'value'},
- status: 404,
- });
+ response.headers.set('custom-header', 'value');
+ response.status = 404;
}
```
5 changes: 5 additions & 0 deletions .changeset/sharp-rice-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Properly support Node v18
5 changes: 5 additions & 0 deletions .changeset/soft-tools-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Custom loggers can return promises from their methods. Hydrogen will await for them after the current request is over but before the runtime instance ends.
30 changes: 30 additions & 0 deletions .changeset/spicy-pans-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
'@shopify/hydrogen': minor
---

**Breaking change**: The client configuration, including the `strictMode` option, has been moved from custom client entry handlers to the Hydrogen configuration file. If you had a custom client entry file just to pass client options, you can remove it and do the same in `hydrogen.config.js`:

```diff
// Custom client entry handler

-renderHydrogen(ClientWrapper, {strictMode: false});
+renderHydrogen(ClientWrapper);
```

```diff
// hydrogen.config.jsx

export default defineConfig({
+ strictMode: false,
});
```

To remove a custom client entry handler in case it's not needed anymore, delete the custom file and change `index.html`:

```diff
<body>
<div id="root"></div>
- <script type="module" src="/src/custom-client-entry"></script>
+ <script type="module" src="/@shopify/hydrogen/entry-client"></script>
</body>
```
5 changes: 5 additions & 0 deletions .changeset/ten-knives-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Workers context (e.g. `waitUntil`) is now scoped to the current request instead of globally available.
33 changes: 33 additions & 0 deletions .changeset/violet-peaches-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
'@shopify/hydrogen': minor
---

**Breaking change**: The `enableStreaming` config option has been deprecated. The same feature can be done directly in the app:

```diff
// hydrogen.config.js

export default defineConfig({
shopify: {
// ...
},
- enableStreaming: (req) => {
- return req.headers.get('user-agent') !== 'custom bot';
- },
});
```

```diff
// App.server.jsx

-function App() {
+function App({request, response}) {
+ if (request.headers.get('user-agent') === 'custom bot') {
+ response.doNotStream();
+ }

return <Suspense fallback={'Loading...'}>{/*...*/}</Suspense>;
}

export default renderHydrogen(App);
```
5 changes: 5 additions & 0 deletions .changeset/wild-rabbits-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

[#1245] - Generate a default srcset for an image returned by the Shopify CDN on the Image component and allow using a custom set of `widths.`
6 changes: 0 additions & 6 deletions packages/create-hydrogen-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Changelog

## 0.23.0

### Patch Changes

- [#1415](https://github.com/Shopify/hydrogen/pull/1415) [`43f96465`](https://github.com/Shopify/hydrogen/commit/43f964653ea3b08c11c2482ae71da1726694be2a) Thanks [@BradMurchison](https://github.com/BradMurchison)! - Small styling fix to country selector in demo store template

## 0.22.1

## 0.22.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.23.0",
"version": "0.22.1",
"main": "index.js",
"license": "MIT",
"bin": {
Expand Down
Loading