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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ WEAVERSE_PROJECT_ID="<weaverse-project-id>"
# PUBLIC_STOREFRONT_ID="<hydrogen-storefront-id>"
# PUBLIC_CHECKOUT_DOMAIN="<store>.myshopify.com"
# PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID="<customer-account-client-id>"
# PUBLIC_CUSTOMER_ACCOUNT_API_URL="https://shopify.com/<shop-id>/account/customer/api"
# SHOP_ID="<shop-id>"

# Optional Weaverse configuration
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,26 @@ jobs:
run: npm ci --engine-strict --no-audit --no-fund
- name: Static checks
run: npm run check
- name: Generate GraphQL types
run: npm run codegen
- name: Check types
run: npm run typecheck
- name: Check combined-listing targets
run: node --test tests/combined-listing-target.unit.test.mjs
- name: Check authenticated cart handoff and Studio schema regressions
run: |
npx --no-install vite-node tests/cart-checkout-handoff.unit.test.ts
npx --no-install vite-node tests/weaverse-csp.unit.test.ts
npx --no-install vite-node tests/layout-fragments.unit.test.ts
npx --no-install vite-node tests/customer-auth-migration.unit.test.ts
npx --no-install vite-node tests/featured-collections-schema.unit.test.ts
- name: Check Themivo wishlist regressions
run: |
npx --no-install vite-node tests/themivo-wishlist.unit.test.ts
npx --no-install vite-node tests/themivo-products.unit.test.ts
npx --no-install vite-node tests/themivo-appearance.unit.test.ts
- name: Check private wishlist analytics
run: |
npx --no-install playwright install --with-deps chromium
node --test tests/private-wishlist-analytics.browser.mjs
- name: Check localization
run: npm run locale:check && npm run i18n:test
- name: Check sanitizer regressions
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/node22-support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ jobs:
- name: Install from the committed lockfile
run: npm ci --engine-strict --no-audit --no-fund
- name: Verify the resolved dependency graph
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
run: npm ls @shopify/mini-oxygen sanitize-html @shopify/cli vite-node body-parser undici vite esbuild framer-motion motion-dom motion-utils --all
# Repository scripts must resolve the tested local CLI.
- name: Verify onboarding uses the pinned local CLI
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');"
- name: Generate GraphQL types
run: npm run codegen
- name: Check types
run: npm run typecheck
- name: Check localization
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ pnpm-lock.yaml
/scripts/get_weaverse_page.mjs
/scripts/search_shopify_docs.mjs
/scripts/search_weaverse_docs.mjs

# Hydrogen GraphQL schema environments
storefront-graphql-env.d.ts
customer-account-graphql-env.d.ts
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# @weaverse/aspen

## Unreleased

### Hydrogen 2026.10 and Weaverse v6

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


## 2026.11.12

This release brings together the Aspen updates since `v2026.6.12`, with a
Expand Down
34 changes: 23 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Development Commands

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

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

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

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

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

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

### Updating GraphQL Schema
1. Modify queries in `app/graphql/`
2. Run `npm run codegen`
2. Run `npm run typecheck`
3. Update TypeScript types as needed

### Adding Theme Settings
Expand All @@ -171,3 +171,15 @@ Required environment variables:
- **Shopify Oxygen**: Native Hydrogen deployment platform
- **Build command**: `npm run build`
- **Environment**: Ensure all env vars are configured

## Hydrogen 2026.10 migration contracts

- Build request context in `app/.server/context.ts`; `server.ts` composes Shopify
handlers, React Router, session commit and response headers.
- Import Weaverse React Router APIs from `@weaverse/hydrogen/react-router`.
- Run Storefront queries with `storefront.graphql(gql(...), {variables, cache})`;
use `unwrapStorefront` where query errors should reach the route boundary.
- Aspen's queued cart UI and native `/cart` forms use the app-owned cart gateway;
`CartLibrarySync` refreshes Hydrogen's store after these custom mutations.
- Keep saved section types/settings, merchant content, responsive markup and
locale/currency behavior compatible. See `docs/hydrogen-2026-10-migration.md`.
85 changes: 30 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ _Aspen is a sophisticated Shopify theme crafted specifically for home furniture
![Weaverse + Hydrogen + Shopify](https://cdn.shopify.com/s/files/1/0838/0052/3057/files/weaverse-x-hydrogen-x-shopify.png?v=1755245801)

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

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

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

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

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

`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.

```ts:app/lib/context.ts
// app/lib/context.ts

const hydrogenContext = createHydrogenContext(
{
env,
request,
cache,
waitUntil,
session,
i18n: getLocaleFromRequest(request),
cart: {
queryFragment: CART_QUERY_FRAGMENT,
},
},
{},
);

const weaverse = new WeaverseClient({
...hydrogenContext,
request,
cache,
themeSchema,
components,
});

Object.assign(hydrogenContext, { weaverse });

return hydrogenContext;
```
The request-scoped clients are created in `app/.server/context.ts`. `server.ts`
composes Shopify handlers with React Router and applies the session and response
headers. See [migration notes](docs/hydrogen-2026-10-migration.md) for the new
request lifecycle.

### Rendering page content

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

```tsx:app/weaverse/index.tsx
import { WeaverseHydrogenRoot } from '@weaverse/hydrogen';
import { WeaverseHydrogenRoot } from '@weaverse/hydrogen/react-router';
import { GenericError } from '~/components/generic-error';
import { components } from './components';

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

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

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

```tsx:root.tsx
import { withWeaverse } from '@weaverse/hydrogen';
import { withWeaverse } from '@weaverse/hydrogen/react-router';

function App() {
return (
Expand All @@ -215,16 +191,16 @@ export default withWeaverse(App);

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.

**Important:** All Weaverse sections must use `forwardRef` and extend `HydrogenComponentProps`.
**Important:** All Weaverse sections must use `forwardRef` and extend `WeaverseComponentProps`.

```tsx:app/sections/video/index.tsx
import type {
HydrogenComponentProps,
import {
type WeaverseComponentProps,
createSchema,
} from '@weaverse/hydrogen';
} from '@weaverse/hydrogen/react-router';
import { forwardRef } from 'react';

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

```tsx:app/sections/video/index.tsx (loader example)
import type { ComponentLoaderArgs } from '@weaverse/hydrogen';

export const loader = async ({ weaverse, data }: ComponentLoaderArgs) => {
const result = await weaverse.storefront.query<SeoCollectionContentQuery>(
HOMEPAGE_SEO_QUERY,
{
variables: { handle: data.collection.handle || 'frontpage' },
},
);
return result.data;
import type { WeaverseComponentLoaderArgs } from '@weaverse/hydrogen/react-router';
import { CACHE_DEFAULT } from '~/utils/cache';
import { unwrapStorefront } from '~/utils/storefront';

export const loader = async ({ weaverse, data }: WeaverseComponentLoaderArgs) => {
// HOMEPAGE_SEO_QUERY is a gql() document from @shopify/hydrogen.
return weaverse.storefront.graphql(HOMEPAGE_SEO_QUERY, {
variables: {handle: data.collection.handle},
cache: CACHE_DEFAULT,
}).then(unwrapStorefront);
};
```

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

export const components: HydrogenComponent[] = [
export const components: WeaverseComponent[] = [
// ... existing components
Video,
];
Expand All @@ -345,7 +321,7 @@ app/
└── weaverse/ # Weaverse configuration

Key configuration files:
- codegen.ts # GraphQL code generation
- app/graphql/ # Typed gql() documents
- react-router.config.ts # React Router configuration
- vite.config.ts # Vite bundler and Vite+ static checks
```
Expand All @@ -363,8 +339,7 @@ Before committing, always run:
```bash
npm run check # Check lint and formatting
npm run check:fix # Format and apply safe lint fixes
npm run typecheck # Check TypeScript types
npm run codegen # Update GraphQL types
npm run typecheck # Validate TypeScript and GraphQL documents
Comment thread
thanh251 marked this conversation as resolved.
Resolved
```

## References
Expand Down
Loading