Skip to content
Closed
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
137 changes: 82 additions & 55 deletions packages/hydrogen/docs/generated/generated_docs_data.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"title": "Hydrogen",
"description": "Hydrogen is Shopify’s opinionated stack for headless commerce, built on [Remix](https://remix.run). It provides a set of tools, utilities, and best-in-class examples for building dynamic and performant commerce applications.",
"description": "Hydrogen is Shopify’s opinionated stack for headless commerce, built on [React Router](https://reactrouter.com/home). It provides a set of tools, utilities, and best-in-class examples for building dynamic and performant commerce applications.",
"id": "hydrogen",
"sections": [
{
Expand Down Expand Up @@ -89,7 +89,7 @@
"type": "Generic",
"anchorLink": "hydrogen_react",
"title": "How Hydrogen works with Hydrogen React",
"sectionContent": "Hydrogen is [built on Remix](/docs/custom-storefronts/hydrogen/project-structure). But many of the components, hooks and utilities built into Hydrogen come from [Hydrogen React](/docs/api/hydrogen-react), an underlying package that’s framework-agnostic. For convenience, the Hydrogen package re-exports those resources. This means that if you’re building a Hydrogen app, then you should import modules from the `@shopify/hydrogen` package.",
"sectionContent": "Hydrogen is [built on React Router](/docs/custom-storefronts/hydrogen/project-structure). But many of the components, hooks and utilities built into Hydrogen come from [Hydrogen React](/docs/api/hydrogen-react), an underlying package that’s framework-agnostic. For convenience, the Hydrogen package re-exports those resources. This means that if you’re building a Hydrogen app, then you should import modules from the `@shopify/hydrogen` package.",
"codeblock": {
"title": "Importing Hydrogen components",
"tabs": [
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/docs/staticPages/hydrogen.doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {LandingTemplateSchema} from '@shopify/generate-docs';
const data: LandingTemplateSchema = {
title: 'Hydrogen',
description:
'Hydrogen is Shopify’s opinionated stack for headless commerce, built on [Remix](https://remix.run). It provides a set of tools, utilities, and best-in-class examples for building dynamic and performant commerce applications.',
'Hydrogen is Shopify’s opinionated stack for headless commerce, built on [React Router](https://reactrouter.com/home). It provides a set of tools, utilities, and best-in-class examples for building dynamic and performant commerce applications.',
id: 'hydrogen',
sections: [
{
Expand Down Expand Up @@ -97,7 +97,7 @@ const data: LandingTemplateSchema = {
anchorLink: 'hydrogen_react',
title: 'How Hydrogen works with Hydrogen React',
sectionContent:
'Hydrogen is [built on Remix](/docs/custom-storefronts/hydrogen/project-structure). But many of the components, hooks and utilities built into Hydrogen come from [Hydrogen React](/docs/api/hydrogen-react), an underlying package that’s framework-agnostic. For convenience, the Hydrogen package re-exports those resources. This means that if you’re building a Hydrogen app, then you should import modules from the `@shopify/hydrogen` package.',
'Hydrogen is [built on React Router](/docs/custom-storefronts/hydrogen/project-structure). But many of the components, hooks and utilities built into Hydrogen come from [Hydrogen React](/docs/api/hydrogen-react), an underlying package that’s framework-agnostic. For convenience, the Hydrogen package re-exports those resources. This means that if you’re building a Hydrogen app, then you should import modules from the `@shopify/hydrogen` package.',
codeblock: {
title: 'Importing Hydrogen components',
tabs: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useLoaderData} from '@remix-run/react';
import {useLoaderData} from 'react-router';
import {Analytics} from '@shopify/hydrogen';

export async function loader() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Analytics, getShopAnalytics} from '@shopify/hydrogen';
import {Outlet, useLoaderData} from '@remix-run/react';
import {Outlet, useLoaderData} from 'react-router';

export async function loader({context}) {
const {cart, env} = context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Analytics, getShopAnalytics} from '@shopify/hydrogen';
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {Outlet, useLoaderData} from '@remix-run/react';
import {Outlet, useLoaderData} from 'react-router';

export async function loader({context}: LoaderFunctionArgs) {
const {cart, env} = context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useLoaderData} from '@remix-run/react';
import {useLoaderData} from 'react-router';
import {Analytics} from '@shopify/hydrogen';

export async function loader() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useLoaderData} from '@remix-run/react';
import {useLoaderData} from 'react-router';
import {Analytics} from '@shopify/hydrogen';

export async function loader() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Analytics} from '@shopify/hydrogen';
import {useLoaderData} from '@remix-run/react';
import {useLoaderData} from 'react-router';

export async function loader({request}) {
const url = new URL(request.url);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Analytics} from '@shopify/hydrogen';
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {useLoaderData} from '@remix-run/react';
import {useLoaderData} from 'react-router';

export async function loader({request}: LoaderFunctionArgs) {
const url = new URL(request.url);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Analytics, getShopAnalytics} from '@shopify/hydrogen';
import {Outlet, useLoaderData} from '@remix-run/react';
import {Outlet, useLoaderData} from 'react-router';

export async function loader({context}) {
const {cart, env} = context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Analytics, getShopAnalytics} from '@shopify/hydrogen';
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {Outlet, useLoaderData} from '@remix-run/react';
import {Outlet, useLoaderData} from 'react-router';

export async function loader({context}: LoaderFunctionArgs) {
const {cart, env} = context;
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/src/cache/InMemoryCache.example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const {createRequestHandler} = require('@remix-run/express');
const {createRequestHandler} = require('@remix-router/express');
const path = require('path');
const {installGlobals} = require('@remix-run/node');
const {installGlobals} = require('@remix-router/node');
const express = require('express');
const {createStorefrontClient, InMemoryCache} = require('@shopify/hydrogen');

Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cache/create-with-cache.example.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// In your app's `server.ts` file:
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {createWithCache, CacheLong} from '@shopify/hydrogen';
// Use another `createRequestHandler` if deploying off oxygen
import {createRequestHandler} from '@shopify/remix-oxygen';
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cache/create-with-cache.example.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// In your app's `server.ts` file:
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {createWithCache, CacheLong} from '@shopify/hydrogen';
// Use another `createRequestHandler` if deploying off oxygen
import {createRequestHandler} from '@shopify/remix-oxygen';
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/CartForm.custom.example.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {data} from '@remix-run/server-runtime';
import {data} from 'react-router';
import {CartForm} from '@shopify/hydrogen';
import invariant from 'tiny-invariant';

Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/CartForm.custom.example.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type ActionFunctionArgs, data} from '@remix-run/server-runtime';
import {type ActionFunctionArgs, data} from 'react-router';
import {
type CartQueryDataReturn,
type HydrogenCart,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/CartForm.example.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {data} from '@remix-run/server-runtime';
import {data} from 'react-router';
import {CartForm} from '@shopify/hydrogen';
import invariant from 'tiny-invariant';

Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/CartForm.example.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type ActionFunctionArgs, data} from '@remix-run/server-runtime';
import {type ActionFunctionArgs, data} from 'react-router';
import {
type CartQueryDataReturn,
type HydrogenCart,
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/src/cart/CartForm.fetcher.example.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useFetcher} from '@remix-run/react';
import {data} from '@remix-run/server-runtime';
import {useFetcher} from 'react-router';
import {data} from 'react-router';
import {CartForm} from '@shopify/hydrogen';
import invariant from 'tiny-invariant';

Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/src/cart/CartForm.fetcher.example.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useFetcher} from '@remix-run/react';
import {type ActionFunctionArgs, data} from '@remix-run/server-runtime';
import {useFetcher} from 'react-router';
import {type ActionFunctionArgs, data} from 'react-router';
import {
type CartQueryDataReturn,
type HydrogenCart,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {data} from '@remix-run/server-runtime';
import {data} from 'react-router';
import {CartForm} from '@shopify/hydrogen';
import invariant from 'tiny-invariant';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type ActionFunctionArgs, data} from '@remix-run/server-runtime';
import {type ActionFunctionArgs, data} from 'react-router';
import {
type CartQueryDataReturn,
type HydrogenCart,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/cartSetIdDefault.example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {data} from '@remix-run/server-runtime';
import {data} from 'react-router';
import {cartGetIdDefault, cartSetIdDefault} from '@shopify/hydrogen';

// server.js
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/createCartHandler.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
cartGetIdDefault,
cartSetIdDefault,
} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
getStorefrontHeaders,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/cart/createCartHandler.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
cartGetIdDefault,
cartSetIdDefault,
} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as remixBuild from '@react-router/dev/server-build';
import {
createRequestHandler,
getStorefrontHeaders,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Link} from '@remix-run/react';
import {Link} from 'react-router';
import {CartForm, useOptimisticCart} from '@shopify/hydrogen';

// Root loader returns the cart data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {Link} from '@remix-run/react';
import {Link} from 'react-router';
import {CartForm, useOptimisticCart} from '@shopify/hydrogen';
import type {Cart} from '@shopify/hydrogen/storefront-api-types';

Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/createHydrogenContext.example.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createHydrogenContext} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/createHydrogenContext.example.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createHydrogenContext, type HydrogenSession} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as remixBuild from '@react-router/dev/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/csp/Script.example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Outlet,
Scripts,
ScrollRestoration,
} from '@remix-run/react';
} from 'react-router';
import {useNonce, Script} from '@shopify/hydrogen';
export default function App() {
const nonce = useNonce();
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/csp/Script.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Outlet,
Scripts,
ScrollRestoration,
} from '@remix-run/react';
} from 'react-router';
import {useNonce, Script} from '@shopify/hydrogen';
export default function App() {
const nonce = useNonce();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {RemixServer} from '@remix-run/react';
import {ServerRouter} from 'react-router';
import {isbot} from 'isbot';
import {renderToReadableStream} from 'react-dom/server';
import {createContentSecurityPolicy} from '@shopify/hydrogen';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {EntryContext} from '@shopify/remix-oxygen';
import {RemixServer} from '@remix-run/react';
import {ServerRouter} from 'react-router';
import {isbot} from 'isbot';
import {renderToReadableStream} from 'react-dom/server';
import {createContentSecurityPolicy} from '@shopify/hydrogen';
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/csp/useNonce.example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Outlet,
Scripts,
ScrollRestoration,
} from '@remix-run/react';
} from 'react-router';
import {useNonce} from '@shopify/hydrogen';

export default function App() {
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/csp/useNonce.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Outlet,
Scripts,
ScrollRestoration,
} from '@remix-run/react';
} from 'react-router';
import {useNonce} from '@shopify/hydrogen';

export default function App() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createCustomerAccountClient} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
createCustomerAccountClient,
type HydrogenSession,
} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/customer/customer.example.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createCustomerAccountClient} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/customer/customer.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
createCustomerAccountClient,
type HydrogenSession,
} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createCustomerAccountClient} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
createCustomerAccountClient,
type HydrogenSession,
} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
createCookieSessionStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/pagination/Pagination.example.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Pagination, getPaginationVariables} from '@shopify/hydrogen';
import {useLoaderData, Link} from '@remix-run/react';
import {useLoaderData, Link} from 'react-router';

export async function loader({request, context: {storefront}}) {
const variables = getPaginationVariables(request, {pageBy: 8});
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/pagination/Pagination.example.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {Pagination, getPaginationVariables} from '@shopify/hydrogen';
import {useLoaderData, Link} from '@remix-run/react';
import {useLoaderData, Link} from 'react-router';
import {ProductConnection} from '@shopify/hydrogen/storefront-api-types';

export async function loader({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useLoaderData, Link} from '@remix-run/react';
import {useLoaderData, Link} from 'react-router';
import {getPaginationVariables, Pagination} from '@shopify/hydrogen';

export async function loader({request, context: {storefront}}) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {useLoaderData, Link} from '@remix-run/react';
import {useLoaderData, Link} from 'react-router';
import {getPaginationVariables, Pagination} from '@shopify/hydrogen';
import {type Collection} from '@shopify/hydrogen-react/storefront-api-types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {VariantSelector} from '@shopify/hydrogen';
import {Link} from '@remix-run/react';
import {Link} from 'react-router';

const ProductForm = ({product}) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {VariantSelector} from '@shopify/hydrogen';
import type {Product} from '@shopify/hydrogen/storefront-api-types';
import {Link} from '@remix-run/react';
import {Link} from 'react-router';

const ProductForm = ({product}: {product: Product}) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useLoaderData} from '@remix-run/react';
import {useLoaderData} from 'react-router';
import {useOptimisticVariant} from '@shopify/hydrogen';

export async function loader({context}) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useLoaderData} from '@remix-run/react';
import {LoaderFunctionArgs} from '@remix-run/server-runtime';
import {useLoaderData} from 'react-router';
import {LoaderFunctionArgs} from 'react-router';
import {useOptimisticVariant} from '@shopify/hydrogen';

export async function loader({context}: LoaderFunctionArgs) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {storefrontRedirect, createStorefrontClient} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
getStorefrontHeaders,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {storefrontRedirect, createStorefrontClient} from '@shopify/hydrogen';
import * as remixBuild from '@remix-run/dev/server-build';
import * as reactRouterBuild from 'virtual:react-router/server-build';
import {
createRequestHandler,
getStorefrontHeaders,
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/seo/getSeoMeta.example.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {MetaFunction} from '@remix-run/react';
import {MetaFunction} from 'react-router';
import {LoaderFunctionArgs} from '@remix-run/server-runtime';
import {getSeoMeta} from '@shopify/hydrogen';

Expand Down
Loading
Loading