Skip to content

Commit 9bbdc25

Browse files
authored
Merge pull request #22 from Weaverse/feat/migrate-aspen-hydrogen
feat: migrate Aspen to Hydrogen 2026.10 and Weaverse v6
2 parents b1d415e + 14db276 commit 9bbdc25

398 files changed

Lines changed: 12801 additions & 12758 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ WEAVERSE_PROJECT_ID="<weaverse-project-id>"
1313
# PUBLIC_STOREFRONT_ID="<hydrogen-storefront-id>"
1414
# PUBLIC_CHECKOUT_DOMAIN="<store>.myshopify.com"
1515
# PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID="<customer-account-client-id>"
16-
# PUBLIC_CUSTOMER_ACCOUNT_API_URL="https://shopify.com/<shop-id>/account/customer/api"
1716
# SHOP_ID="<shop-id>"
1817

1918
# Optional Weaverse configuration

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@ jobs:
2727
run: npm ci --engine-strict --no-audit --no-fund
2828
- name: Static checks
2929
run: npm run check
30-
- name: Generate GraphQL types
31-
run: npm run codegen
3230
- name: Check types
3331
run: npm run typecheck
32+
- name: Check combined-listing targets
33+
run: node --test tests/combined-listing-target.unit.test.mjs
34+
- name: Check authenticated cart handoff and Studio schema regressions
35+
run: |
36+
npx --no-install vite-node tests/cart-checkout-handoff.unit.test.ts
37+
npx --no-install vite-node tests/weaverse-csp.unit.test.ts
38+
npx --no-install vite-node tests/layout-fragments.unit.test.ts
39+
npx --no-install vite-node tests/customer-auth-migration.unit.test.ts
40+
npx --no-install vite-node tests/featured-collections-schema.unit.test.ts
3441
- name: Check Themivo wishlist regressions
3542
run: |
3643
npx --no-install vite-node tests/themivo-wishlist.unit.test.ts
3744
npx --no-install vite-node tests/themivo-products.unit.test.ts
3845
npx --no-install vite-node tests/themivo-appearance.unit.test.ts
46+
- name: Check private wishlist analytics
47+
run: |
48+
npx --no-install playwright install --with-deps chromium
49+
node --test tests/private-wishlist-analytics.browser.mjs
3950
- name: Check localization
4051
run: npm run locale:check && npm run i18n:test
4152
- name: Check sanitizer regressions

‎.github/workflows/node22-support.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ jobs:
4040
- name: Install from the committed lockfile
4141
run: npm ci --engine-strict --no-audit --no-fund
4242
- name: Verify the resolved dependency graph
43-
run: npm ls @shopify/mini-oxygen sanitize-html @shopify/cli @graphql-codegen/cli vite-node body-parser undici vite esbuild framer-motion motion-dom motion-utils --all
43+
run: npm ls @shopify/mini-oxygen sanitize-html @shopify/cli vite-node body-parser undici vite esbuild framer-motion motion-dom motion-utils --all
4444
# Repository scripts must resolve the tested local CLI.
4545
- name: Verify onboarding uses the pinned local CLI
4646
run: node -e "const assert = require('node:assert/strict'); const pinned = require('./package.json').devDependencies['@shopify/cli']; const resolved = require('./node_modules/@shopify/cli/package.json').version; console.log({pinned, resolved}); assert.equal(resolved, pinned, 'Onboarding must resolve the local pinned CLI, not a fetched one');"
47-
- name: Generate GraphQL types
48-
run: npm run codegen
4947
- name: Check types
5048
run: npm run typecheck
5149
- name: Check localization

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ pnpm-lock.yaml
2424
/scripts/get_weaverse_page.mjs
2525
/scripts/search_shopify_docs.mjs
2626
/scripts/search_weaverse_docs.mjs
27+
28+
# Hydrogen GraphQL schema environments
29+
storefront-graphql-env.d.ts
30+
customer-account-graphql-env.d.ts

‎CHANGELOG.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# @weaverse/aspen
22

3+
## Unreleased
4+
5+
### Hydrogen 2026.10 and Weaverse v6
6+
7+
- Updated the storefront foundation to Hydrogen 2026.10 and Weaverse v6 while
8+
retaining Aspen's page sections, theme settings, navigation and commerce UI.
9+
- Migrated product selection, cart handlers, customer account queries, analytics
10+
and section data loading to the new APIs. Preserved Aspen's queued cart
11+
updates, inventory checks, discounts, gift cards and order notes.
12+
- Reconciled cart buyer identity after Customer Account authorization, refresh
13+
and logout; signed-out mutations explicitly clear old customer tokens, and
14+
failed logout detachment expires the cart cookie. Account login redirects keep
15+
order keys and other page parameters while stripping React Router metadata.
16+
Temporary account refresh failures retain customer identity and allow cart
17+
mutations to be retried.
18+
- Moved collection browsing to Hydrogen's collection store. Existing filter and
19+
sort links redirect to the new URL format; pagination supports forward and
20+
backward navigation. Default collection ordering, combined category/facet
21+
selections and missing-collection cursor recovery are preserved.
22+
- Preserved locale-aware price formatting, translated merchant content, SEO,
23+
image rendering and Studio component settings.
24+
- Local development uses Vite/MiniOxygen, with HTTPS available through
25+
`npm run dev:https`. Builds use React Router; `npm run typecheck` now checks
26+
GraphQL documents as well as TypeScript. Node requirements remain
27+
`^22.18.0 || ^24.11.0`.
28+
- See [migration and verification notes](docs/hydrogen-2026-10-migration.md)
29+
for deployment verification. A published release remains outstanding.
30+
31+
332
## 2026.11.12
433

534
This release brings together the Aspen updates since `v2026.6.12`, with a

‎CLAUDE.md‎

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Development Commands
66

77
### Core Development
8-
- `npm run dev` - Start development server on port 3456 with codegen
9-
- `npm run dev:ca` - Start dev server with a tunnel and push its domain for the Customer Account API OAuth flow
10-
- `npm run build` - Build for production with codegen
8+
- `npm run dev` - Start Vite/MiniOxygen on port 3456
9+
- `npm run dev:ca` - Alias for local HTTPS development
10+
- `npm run build` - Build the React Router client and Oxygen worker
1111
- `npm run preview` - Preview production build
1212
- `npm run start` - Start production server
1313
- `npm run typecheck` - Generate React Router types and run TypeScript type checking
14-
- `npm run routes-check` - Verify all standard Shopify routes are configured
15-
- `npm run codegen` - Generate GraphQL types and schema
14+
- `npm run dev:https` - Start local HTTPS for Customer Account OAuth
15+
- `npm run deploy` - Deploy the built client and worker to Oxygen
1616

1717
### Code Quality
1818
- `npm run check` - Run Oxfmt and Oxlint through `vp check`
@@ -32,8 +32,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
3232
This is a **Shopify Hydrogen storefront** built with **React Router v7** (not Remix) and integrated with **Weaverse** for visual page building. Key architectural decisions:
3333

3434
### Framework Stack
35-
- **Hydrogen 2026.4** - Shopify's React framework for commerce
36-
- **React Router 7.16** - Programmatic route configuration (NOT Remix - see import rules below)
35+
- **Hydrogen 2026.10** - Shopify's React framework for commerce
36+
- **React Router 7.18** - Programmatic route configuration (NOT Remix - see import rules below)
3737
- **Weaverse** - Visual page builder with component system
3838
- **Vite** - Build tool and dev server
3939
- **Vite+** - Oxlint and Oxfmt, without changing the Vite build
@@ -83,10 +83,10 @@ import { useLoaderData, Link, Form } from '@remix-run/react';
8383

8484
### GraphQL & Data Fetching
8585
- **Storefront API** for product/collection data
86-
- **Generated types** in `storefront-api.generated.d.ts` (DO NOT edit directly)
86+
- **Typed documents** use `gql()`; infer data from documents in `app/graphql/`
8787
- **Fragments** defined in `app/graphql/fragments.ts`
8888
- **Queries** in `app/graphql/queries.ts`
89-
- **Regenerate types** with `npm run codegen` after schema changes
89+
- **Validate documents** with `npm run typecheck` after GraphQL changes
9090

9191
### Testing Setup
9292
- **Playwright** for end-to-end testing
@@ -127,7 +127,7 @@ export let schema = createSchema({
127127
- `app/routes.ts` is the source of truth for the React Router route tree
128128
- Route modules live in `app/routes/` and must be explicitly referenced by `app/routes.ts`
129129
- Route filenames keep the established locale-aware naming convention, such as `($locale).products.$productHandle.tsx`
130-
- Run `npm run routes-check` after changing the route tree
130+
- Run `npm run typecheck` after changing the route tree
131131

132132
### Code Quality Standards
133133
- **TypeScript**: Strict mode disabled, but use types where beneficial
@@ -154,7 +154,7 @@ Required environment variables:
154154

155155
### Updating GraphQL Schema
156156
1. Modify queries in `app/graphql/`
157-
2. Run `npm run codegen`
157+
2. Run `npm run typecheck`
158158
3. Update TypeScript types as needed
159159

160160
### Adding Theme Settings
@@ -171,3 +171,15 @@ Required environment variables:
171171
- **Shopify Oxygen**: Native Hydrogen deployment platform
172172
- **Build command**: `npm run build`
173173
- **Environment**: Ensure all env vars are configured
174+
175+
## Hydrogen 2026.10 migration contracts
176+
177+
- Build request context in `app/.server/context.ts`; `server.ts` composes Shopify
178+
handlers, React Router, session commit and response headers.
179+
- Import Weaverse React Router APIs from `@weaverse/hydrogen/react-router`.
180+
- Run Storefront queries with `storefront.graphql(gql(...), {variables, cache})`;
181+
use `unwrapStorefront` where query errors should reach the route boundary.
182+
- Aspen's queued cart UI and native `/cart` forms use the app-owned cart gateway;
183+
`CartLibrarySync` refreshes Hydrogen's store after these custom mutations.
184+
- Keep saved section types/settings, merchant content, responsive markup and
185+
locale/currency behavior compatible. See `docs/hydrogen-2026-10-migration.md`.

‎README.md‎

Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ _Aspen is a sophisticated Shopify theme crafted specifically for home furniture
2020
![Weaverse + Hydrogen + Shopify](https://cdn.shopify.com/s/files/1/0838/0052/3057/files/weaverse-x-hydrogen-x-shopify.png?v=1755245801)
2121

2222
- React Router v7
23-
- Hydrogen 2026.4
23+
- Hydrogen 2026.10
2424
- Oxygen
2525
- Shopify CLI
2626
- Vite+ checks (Oxlint and Oxfmt)
27-
- GraphQL generator
27+
- Typed GraphQL documents with gql.tada
2828
- TypeScript and JavaScript flavors
2929
- Tailwind CSS v4 (via Vite)
3030
- Radix UI components
@@ -85,14 +85,16 @@ Aspen uses parallel data loading for optimal performance. Every route loads Weav
8585

8686
```ts:routes/($locale)._index.tsx
8787
import { data } from 'react-router';
88+
import { CACHE_DEFAULT } from '~/utils/cache';
89+
import { unwrapStorefront } from '~/utils/storefront';
8890
import { type LoaderFunctionArgs } from 'react-router';
8991

9092
export async function loader({ context }: LoaderFunctionArgs) {
9193
const { storefront, weaverse } = context;
9294

9395
// Parallel data loading for best performance
9496
const [collections, weaverseData] = await Promise.all([
95-
storefront.query(COLLECTIONS_QUERY),
97+
storefront.graphql(COLLECTIONS_QUERY, {cache: CACHE_DEFAULT}).then(unwrapStorefront),
9698
weaverse.loadPage({ type: 'INDEX' }),
9799
]);
98100

@@ -105,43 +107,17 @@ export async function loader({ context }: LoaderFunctionArgs) {
105107

106108
`weaverse` is a `WeaverseClient` instance that has been injected into the app context by Weaverse. It provides a set of methods to interact with the Weaverse API.
107109

108-
```ts:app/lib/context.ts
109-
// app/lib/context.ts
110-
111-
const hydrogenContext = createHydrogenContext(
112-
{
113-
env,
114-
request,
115-
cache,
116-
waitUntil,
117-
session,
118-
i18n: getLocaleFromRequest(request),
119-
cart: {
120-
queryFragment: CART_QUERY_FRAGMENT,
121-
},
122-
},
123-
{},
124-
);
125-
126-
const weaverse = new WeaverseClient({
127-
...hydrogenContext,
128-
request,
129-
cache,
130-
themeSchema,
131-
components,
132-
});
133-
134-
Object.assign(hydrogenContext, { weaverse });
135-
136-
return hydrogenContext;
137-
```
110+
The request-scoped clients are created in `app/.server/context.ts`. `server.ts`
111+
composes Shopify handlers with React Router and applies the session and response
112+
headers. See [migration notes](docs/hydrogen-2026-10-migration.md) for the new
113+
request lifecycle.
138114

139115
### Rendering page content
140116

141117
Weaverse pages is rendered using `<WeaverseContent />` component.
142118

143119
```tsx:app/weaverse/index.tsx
144-
import { WeaverseHydrogenRoot } from '@weaverse/hydrogen';
120+
import { WeaverseHydrogenRoot } from '@weaverse/hydrogen/react-router';
145121
import { GenericError } from '~/components/generic-error';
146122
import { components } from './components';
147123

@@ -182,7 +158,7 @@ export async function loader({request, context}: RouteLoaderArgs) {
182158
And then you can use it in your components with `useThemeSettings` hook.
183159

184160
```tsx:app/weaverse/components/logo.tsx
185-
import { useThemeSettings } from '@weaverse/hydrogen';
161+
import { useThemeSettings } from '@weaverse/hydrogen/react-router';
186162

187163
function Logo() {
188164
let {logo} = useThemeSettings();
@@ -198,7 +174,7 @@ function Logo() {
198174
The `App` component is wrapped with `withWeaverse` HoC in order to SSR the theme settings.
199175

200176
```tsx:root.tsx
201-
import { withWeaverse } from '@weaverse/hydrogen';
177+
import { withWeaverse } from '@weaverse/hydrogen/react-router';
202178

203179
function App() {
204180
return (
@@ -215,16 +191,16 @@ export default withWeaverse(App);
215191

216192
To create a section, you need to create a new file in [`app/sections`](app/sections) directory and register it in [`app/weaverse/components.ts`](app/weaverse/components.ts) file.
217193

218-
**Important:** All Weaverse sections must use `forwardRef` and extend `HydrogenComponentProps`.
194+
**Important:** All Weaverse sections must use `forwardRef` and extend `WeaverseComponentProps`.
219195

220196
```tsx:app/sections/video/index.tsx
221-
import type {
222-
HydrogenComponentProps,
197+
import {
198+
type WeaverseComponentProps,
223199
createSchema,
224-
} from '@weaverse/hydrogen';
200+
} from '@weaverse/hydrogen/react-router';
225201
import { forwardRef } from 'react';
226202

227-
interface VideoProps extends HydrogenComponentProps {
203+
interface VideoProps extends WeaverseComponentProps {
228204
heading: string;
229205
description: string;
230206
videoUrl: string;
@@ -300,16 +276,16 @@ What if your component needs to fetch data from Shopify API or any third-party A
300276
Just export a `loader` function from your component:
301277

302278
```tsx:app/sections/video/index.tsx (loader example)
303-
import type { ComponentLoaderArgs } from '@weaverse/hydrogen';
304-
305-
export const loader = async ({ weaverse, data }: ComponentLoaderArgs) => {
306-
const result = await weaverse.storefront.query<SeoCollectionContentQuery>(
307-
HOMEPAGE_SEO_QUERY,
308-
{
309-
variables: { handle: data.collection.handle || 'frontpage' },
310-
},
311-
);
312-
return result.data;
279+
import type { WeaverseComponentLoaderArgs } from '@weaverse/hydrogen/react-router';
280+
import { CACHE_DEFAULT } from '~/utils/cache';
281+
import { unwrapStorefront } from '~/utils/storefront';
282+
283+
export const loader = async ({ weaverse, data }: WeaverseComponentLoaderArgs) => {
284+
// HOMEPAGE_SEO_QUERY is a gql() document from @shopify/hydrogen.
285+
return weaverse.storefront.graphql(HOMEPAGE_SEO_QUERY, {
286+
variables: {handle: data.collection.handle},
287+
cache: CACHE_DEFAULT,
288+
}).then(unwrapStorefront);
313289
};
314290
```
315291

@@ -320,7 +296,7 @@ Don't forget to register your new section in `app/weaverse/components.ts`:
320296
```typescript
321297
import * as Video from "~/sections/video";
322298

323-
export const components: HydrogenComponent[] = [
299+
export const components: WeaverseComponent[] = [
324300
// ... existing components
325301
Video,
326302
];
@@ -345,7 +321,7 @@ app/
345321
└── weaverse/ # Weaverse configuration
346322
347323
Key configuration files:
348-
- codegen.ts # GraphQL code generation
324+
- app/graphql/ # Typed gql() documents
349325
- react-router.config.ts # React Router configuration
350326
- vite.config.ts # Vite bundler and Vite+ static checks
351327
```
@@ -363,8 +339,7 @@ Before committing, always run:
363339
```bash
364340
npm run check # Check lint and formatting
365341
npm run check:fix # Format and apply safe lint fixes
366-
npm run typecheck # Check TypeScript types
367-
npm run codegen # Update GraphQL types
342+
npm run typecheck # Validate TypeScript and GraphQL documents
368343
```
369344

370345
## References

0 commit comments

Comments
 (0)