-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'main' into update-oxygen-cli
- Loading branch information
Showing
187 changed files
with
33,482 additions
and
25,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
'skeleton': patch | ||
--- | ||
|
||
In Vite projects, the way that plugins are imported and the options passed to Remix have changed: | ||
|
||
```diff | ||
-import {hydrogen, oxygen} from '@shopify/cli-hydrogen/experimental-vite'; | ||
+import {hydrogen} from '@shopify/hydrogen/vite'; | ||
+import {oxygen} from '@shopify/mini-oxygen/vite'; | ||
import {vitePlugin as remix} from '@remix-run/dev'; | ||
|
||
export default defineConfig({ | ||
hydrogen(), | ||
oxygen(), | ||
remix({ | ||
- buildDirectory: 'dist', | ||
+ presets: [hydrogen.preset()], | ||
future: { | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/hydrogen': patch | ||
--- | ||
|
||
A new Vite plugin is exported from `@shopify/hydrogen/vite`. It provides DX improvements for Vite users, such as adding `/subrequest-profiler` and `/graphiql`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/cli-hydrogen': patch | ||
--- | ||
|
||
Add a newline after the `h2` alias created ZSH/Bash profiles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/remix-oxygen': patch | ||
--- | ||
|
||
Fix compatibility of `/subrequest-profiler` with Vite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/cli-hydrogen': minor | ||
--- | ||
|
||
The `@shopify/cli-hydrogen/experimental-vite` import path has been removed. Instead, use `@shopify/hydrogen/vite` and `@shopify/mini-oxygen/vite` to import the Vite plugins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/mini-oxygen': minor | ||
--- | ||
|
||
A new Vite plugin is exported from `@shopify/mini-oxygen/vite`. It integrates Vite with MiniOxygen by running the application code within a worker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
'@shopify/hydrogen': patch | ||
--- | ||
|
||
Deprecate the `<Seo />` component in favor of directly using Remix meta route exports. Add the `getSeoMeta` to make migration easier: | ||
|
||
Migration steps: | ||
|
||
**1. Remove the `<Seo />` component from `root.jsx`:** | ||
|
||
```diff | ||
export default function App() { | ||
const nonce = useNonce(); | ||
const data = useLoaderData<typeof loader>(); | ||
|
||
return ( | ||
<html lang="en"> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
- <Seo /> | ||
<Meta /> | ||
<Links /> | ||
</head> | ||
<body> | ||
<Layout {...data}> | ||
<Outlet /> | ||
</Layout> | ||
<ScrollRestoration nonce={nonce} /> | ||
<Scripts nonce={nonce} /> | ||
<LiveReload nonce={nonce} /> | ||
</body> | ||
</html> | ||
); | ||
} | ||
|
||
``` | ||
|
||
**2. Add a Remix meta export to each route that returns an `seo` property from a `loader` or `handle`:** | ||
|
||
```diff | ||
+import {getSeoMeta} from '@shopify/hydrogen'; | ||
|
||
export async function loader({context}) { | ||
const {shop} = await context.storefront.query(` | ||
query layout { | ||
shop { | ||
name | ||
description | ||
} | ||
} | ||
`); | ||
|
||
return { | ||
seo: { | ||
title: shop.title, | ||
description: shop.description, | ||
}, | ||
}; | ||
} | ||
|
||
+export const meta = ({data}) => { | ||
+ return getSeoMeta(data.seo); | ||
+}; | ||
``` | ||
|
||
**3. Merge root route meta data** | ||
|
||
If your root route loader also returns an `seo` property, make sure to merge that data: | ||
|
||
```ts | ||
export const meta = ({data, matches}) => { | ||
return getSeoMeta( | ||
matches[0].data.seo, | ||
// the current route seo data overrides the root route data | ||
data.seo, | ||
); | ||
}; | ||
``` | ||
|
||
Or more simply: | ||
|
||
```ts | ||
export const meta = ({data, matches}) => { | ||
return getSeoMeta(...matches.map((match) => match.data.seo)); | ||
}; | ||
``` | ||
|
||
**4. Override meta** | ||
|
||
Sometimes `getSeoMeta` might produce a property in a way you'd like to change. Map over the resulting array to change it. For example, Hydrogen removes query parameters from canonical URLs, add them back: | ||
|
||
```ts | ||
export const meta = ({data, location}) => { | ||
return getSeoMeta(data.seo).map((meta) => { | ||
if (meta.rel === 'canonical') { | ||
return { | ||
...meta, | ||
href: meta.href + location.search, | ||
}; | ||
} | ||
|
||
return meta; | ||
}); | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/cli-hydrogen': patch | ||
--- | ||
|
||
List the uncommitted files that the deploy command errors on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ node_modules | |
.vscode | ||
.turbo | ||
.cache | ||
.shopify | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.