@shopify/create-hydrogen 5.0.21 → 5.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/assets/hydrogen/starter/.cursor/rules/hydrogen-react-router.mdc +50 -0
  2. package/dist/assets/hydrogen/starter/CHANGELOG.md +63 -40
  3. package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +1 -1
  4. package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +1 -1
  5. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +1 -1
  6. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +1 -1
  7. package/dist/assets/hydrogen/starter/app/components/Footer.tsx +1 -1
  8. package/dist/assets/hydrogen/starter/app/components/Header.tsx +1 -1
  9. package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +1 -1
  10. package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +1 -1
  11. package/dist/assets/hydrogen/starter/app/components/ProductItem.tsx +1 -1
  12. package/dist/assets/hydrogen/starter/app/components/SearchForm.tsx +1 -1
  13. package/dist/assets/hydrogen/starter/app/components/SearchFormPredictive.tsx +1 -6
  14. package/dist/assets/hydrogen/starter/app/components/SearchResults.tsx +1 -1
  15. package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +1 -1
  16. package/dist/assets/hydrogen/starter/app/entry.client.tsx +2 -2
  17. package/dist/assets/hydrogen/starter/app/entry.server.tsx +9 -4
  18. package/dist/assets/hydrogen/starter/app/lib/variants.ts +1 -1
  19. package/dist/assets/hydrogen/starter/app/root.tsx +1 -1
  20. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +1 -1
  21. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +1 -1
  22. package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +4 -4
  23. package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +1 -1
  24. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +1 -7
  25. package/dist/assets/hydrogen/starter/app/routes/account.tsx +1 -1
  26. package/dist/assets/hydrogen/starter/app/routes/api.$version.[graphql.json].tsx +14 -0
  27. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +1 -1
  28. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +1 -1
  29. package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +1 -1
  30. package/dist/assets/hydrogen/starter/app/routes/cart.tsx +7 -2
  31. package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +1 -1
  32. package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +1 -1
  33. package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +2 -2
  34. package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +1 -1
  35. package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +1 -1
  36. package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +1 -1
  37. package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +1 -1
  38. package/dist/assets/hydrogen/starter/app/routes/search.tsx +1 -1
  39. package/dist/assets/hydrogen/starter/app/routes.ts +2 -2
  40. package/dist/assets/hydrogen/starter/env.d.ts +12 -2
  41. package/dist/assets/hydrogen/starter/eslint.config.js +2 -0
  42. package/dist/assets/hydrogen/starter/package.json +11 -12
  43. package/dist/assets/hydrogen/starter/react-router.config.ts +7 -0
  44. package/dist/assets/hydrogen/starter/server.ts +2 -5
  45. package/dist/assets/hydrogen/starter/tsconfig.json +18 -6
  46. package/dist/assets/hydrogen/starter/vite.config.ts +2 -23
  47. package/dist/assets/hydrogen/tailwind/package.json +4 -1
  48. package/dist/assets/hydrogen/virtual-routes/components/RequestDetails.jsx +1 -1
  49. package/dist/assets/hydrogen/virtual-routes/layout.jsx +1 -7
  50. package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +1 -1
  51. package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +1 -1
  52. package/dist/assets/hydrogen/virtual-routes/virtual-root-with-layout.jsx +1 -1
  53. package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +1 -1
  54. package/dist/assets/hydrogen/vite/vite.config.js +1 -1
  55. package/dist/{chunk-BC2VIKDB.js → chunk-NIHY2BIB.js} +383 -387
  56. package/dist/create-app.js +264 -263
  57. package/dist/error-handler-O653XSNU.js +2 -0
  58. package/dist/is-wsl-LL6KGQIK.js +2 -0
  59. package/package.json +1 -1
  60. package/dist/assets/hydrogen/starter/.cursor/rules/cookbook-recipe-subscriptions.mdc +0 -921
  61. package/dist/error-handler-T5EOGV44.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {useLoaderData, Link} from '@remix-run/react';
2
+ import { useLoaderData, Link } from 'react-router';
3
3
 
4
4
  export async function loader({context}: LoaderFunctionArgs) {
5
5
  const data = await context.storefront.query(POLICIES_QUERY);
@@ -1,5 +1,5 @@
1
1
  import {redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {useLoaderData, type MetaFunction} from '@remix-run/react';
2
+ import { useLoaderData, type MetaFunction } from 'react-router';
3
3
  import {
4
4
  getSelectedProductOptions,
5
5
  Analytics,
@@ -2,7 +2,7 @@ import {
2
2
  type LoaderFunctionArgs,
3
3
  type ActionFunctionArgs,
4
4
  } from '@shopify/remix-oxygen';
5
- import {useLoaderData, type MetaFunction} from '@remix-run/react';
5
+ import { useLoaderData, type MetaFunction } from 'react-router';
6
6
  import {getPaginationVariables, Analytics} from '@shopify/hydrogen';
7
7
  import {SearchForm} from '~/components/SearchForm';
8
8
  import {SearchResults} from '~/components/SearchResults';
@@ -1,5 +1,5 @@
1
- import {flatRoutes} from '@remix-run/fs-routes';
2
- import {type RouteConfig} from '@remix-run/route-config';
1
+ import {flatRoutes} from '@react-router/fs-routes';
2
+ import {type RouteConfig} from '@react-router/dev/routes';
3
3
  import {hydrogenRoutes} from '@shopify/hydrogen';
4
4
 
5
5
  export default hydrogenRoutes([
@@ -1,5 +1,5 @@
1
1
  /// <reference types="vite/client" />
2
- /// <reference types="@shopify/remix-oxygen" />
2
+ /// <reference types="react-router" />
3
3
  /// <reference types="@shopify/oxygen-workers-types" />
4
4
 
5
5
  // Enhance TypeScript's built-in typings.
@@ -23,12 +23,22 @@ declare global {
23
23
  }
24
24
  }
25
25
 
26
- declare module '@shopify/remix-oxygen' {
26
+ declare module 'react-router' {
27
27
  interface AppLoadContext
28
28
  extends Awaited<ReturnType<typeof createAppLoadContext>> {
29
29
  // to change context type, change the return of createAppLoadContext() instead
30
30
  }
31
31
 
32
+ // TODO: remove this once we've migrated our loaders to `Route.LoaderArgs`
33
+ interface LoaderFunctionArgs {
34
+ context: AppLoadContext;
35
+ }
36
+
37
+ // TODO: remove this once we've migrated our loaders to `Route.ActionArgs`
38
+ interface ActionFunctionArgs {
39
+ context: AppLoadContext;
40
+ }
41
+
32
42
  interface SessionData extends HydrogenSessionData {
33
43
  // declare local additions to the Remix session data here
34
44
  }
@@ -29,6 +29,8 @@ export default [
29
29
  '**/*.graphql.d.ts',
30
30
  '**/*.graphql.ts',
31
31
  '**/*.generated.d.ts',
32
+ '**/.react-router/',
33
+ '**/packages/hydrogen/dist/',
32
34
  ],
33
35
  },
34
36
  ...fixupConfigRules(
@@ -2,7 +2,7 @@
2
2
  "name": "skeleton",
3
3
  "private": true,
4
4
  "sideEffects": false,
5
- "version": "2025.1.7",
5
+ "version": "2025.5.0",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "shopify hydrogen build --codegen",
@@ -14,31 +14,29 @@
14
14
  },
15
15
  "prettier": "@shopify/prettier-config",
16
16
  "dependencies": {
17
- "@remix-run/react": "^2.16.1",
18
- "@remix-run/server-runtime": "^2.16.1",
17
+ "@shopify/hydrogen": "2025.5.0",
18
+ "@shopify/remix-oxygen": "^3.0.0",
19
19
  "graphql": "^16.10.0",
20
- "@shopify/hydrogen": "2025.1.4",
21
- "@shopify/remix-oxygen": "^2.0.12",
22
20
  "graphql-tag": "^2.12.6",
23
21
  "isbot": "^5.1.22",
24
22
  "react": "^18.2.0",
25
- "react-dom": "^18.2.0"
23
+ "react-dom": "^18.2.0",
24
+ "react-router": "7.6.0",
25
+ "react-router-dom": "7.6.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@eslint/compat": "^1.2.5",
29
29
  "@eslint/eslintrc": "^3.2.0",
30
30
  "@eslint/js": "^9.18.0",
31
31
  "@graphql-codegen/cli": "5.0.2",
32
- "@remix-run/dev": "^2.16.1",
33
- "@remix-run/fs-routes": "^2.16.1",
34
- "@remix-run/route-config": "^2.16.1",
35
- "@shopify/cli": "~3.78.1",
32
+ "@react-router/dev": "7.6.0",
33
+ "@react-router/fs-routes": "7.6.0",
34
+ "@shopify/cli": "~3.79.2",
36
35
  "@shopify/hydrogen-codegen": "^0.3.3",
37
36
  "@shopify/mini-oxygen": "^3.2.1",
38
37
  "@shopify/oxygen-workers-types": "^4.1.6",
39
38
  "@shopify/prettier-config": "^1.1.2",
40
39
  "@total-typescript/ts-reset": "^0.6.1",
41
- "prettier": "^3.4.2",
42
40
  "@types/eslint": "^9.6.1",
43
41
  "@types/react": "^18.2.22",
44
42
  "@types/react-dom": "^18.2.7",
@@ -54,6 +52,7 @@
54
52
  "eslint-plugin-react": "^7.37.4",
55
53
  "eslint-plugin-react-hooks": "^5.1.0",
56
54
  "globals": "^15.14.0",
55
+ "prettier": "^3.4.2",
57
56
  "typescript": "^5.2.2",
58
57
  "vite": "^6.2.4",
59
58
  "vite-tsconfig-paths": "^4.3.1"
@@ -61,4 +60,4 @@
61
60
  "engines": {
62
61
  "node": ">=18.0.0"
63
62
  }
64
- }
63
+ }
@@ -0,0 +1,7 @@
1
+ import type {Config} from '@react-router/dev/config';
2
+
3
+ export default {
4
+ appDirectory: 'app',
5
+ buildDirectory: 'dist',
6
+ ssr: true,
7
+ } satisfies Config;
@@ -1,8 +1,4 @@
1
1
  // Virtual entry point for the app
2
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
- // @ts-ignore
4
- // eslint-disable-next-line import/no-unresolved
5
- import * as remixBuild from 'virtual:remix/server-build';
6
2
  import {storefrontRedirect} from '@shopify/hydrogen';
7
3
  import {createRequestHandler} from '@shopify/remix-oxygen';
8
4
  import {createAppLoadContext} from '~/lib/context';
@@ -28,7 +24,8 @@ export default {
28
24
  * Hydrogen's Storefront client to the loader context.
29
25
  */
30
26
  const handleRequest = createRequestHandler({
31
- build: remixBuild,
27
+ // eslint-disable-next-line import/no-unresolved
28
+ build: await import('virtual:react-router/server-build'),
32
29
  mode: process.env.NODE_ENV,
33
30
  getLoadContext: () => appLoadContext,
34
31
  });
@@ -1,7 +1,16 @@
1
1
  {
2
- "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx"],
2
+ "include": [
3
+ "./**/*.d.ts",
4
+ "./**/*.ts",
5
+ "./**/*.tsx",
6
+ ".react-router/types/**/*"
7
+ ],
3
8
  "compilerOptions": {
4
- "lib": ["DOM", "DOM.Iterable", "ES2022"],
9
+ "lib": [
10
+ "DOM",
11
+ "DOM.Iterable",
12
+ "ES2022"
13
+ ],
5
14
  "isolatedModules": true,
6
15
  "esModuleInterop": true,
7
16
  "jsx": "react-jsx",
@@ -16,12 +25,15 @@
16
25
  "baseUrl": ".",
17
26
  "types": [
18
27
  "@shopify/oxygen-workers-types",
19
- "@remix-run/server-runtime",
28
+ "react-router",
20
29
  "vite/client"
21
30
  ],
22
31
  "paths": {
23
- "~/*": ["app/*"]
32
+ "~/*": [
33
+ "app/*"
34
+ ]
24
35
  },
25
- "noEmit": true
36
+ "noEmit": true,
37
+ "rootDirs": [".", "./.react-router/types"]
26
38
  }
27
- }
39
+ }
@@ -1,32 +1,11 @@
1
1
  import {defineConfig} from 'vite';
2
2
  import {hydrogen} from '@shopify/hydrogen/vite';
3
3
  import {oxygen} from '@shopify/mini-oxygen/vite';
4
- import {vitePlugin as remix} from '@remix-run/dev';
4
+ import {reactRouter} from '@react-router/dev/vite';
5
5
  import tsconfigPaths from 'vite-tsconfig-paths';
6
6
 
7
- declare module "@remix-run/server-runtime" {
8
- interface Future {
9
- v3_singleFetch: true;
10
- }
11
- }
12
-
13
7
  export default defineConfig({
14
- plugins: [
15
- hydrogen(),
16
- oxygen(),
17
- remix({
18
- presets: [hydrogen.v3preset()],
19
- future: {
20
- v3_fetcherPersist: true,
21
- v3_relativeSplatPath: true,
22
- v3_throwAbortReason: true,
23
- v3_lazyRouteDiscovery: true,
24
- v3_routeConfig: true,
25
- v3_singleFetch: true,
26
- },
27
- }),
28
- tsconfigPaths(),
29
- ],
8
+ plugins: [hydrogen(), oxygen(), reactRouter(), tsconfigPaths()],
30
9
  build: {
31
10
  // Allow a strict Content-Security-Policy
32
11
  // withtout inlining assets as base64:
@@ -2,7 +2,10 @@
2
2
  "browserslist": [
3
3
  "defaults"
4
4
  ],
5
+ "dependencies": {
6
+ "tailwindcss": "^4.1.6"
7
+ },
5
8
  "devDependencies": {
6
- "@tailwindcss/vite": "4.0.14"
9
+ "@tailwindcss/vite": "^4.1.6"
7
10
  }
8
11
  }
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useRef } from "react";
3
- import { Link } from "@remix-run/react";
3
+ import { Link } from "react-router";
4
4
  import { IconClose } from "./IconClose.jsx";
5
5
  import _useResizeObserver from "use-resize-observer";
6
6
  const useResizeObserver = _useResizeObserver;
@@ -1,12 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useNonce } from "@shopify/hydrogen";
3
- import {
4
- Links,
5
- Meta,
6
- Outlet,
7
- Scripts,
8
- ScrollRestoration
9
- } from "@remix-run/react";
3
+ import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
10
4
  import { Layout as VirtualLayout } from "./components/Layout.jsx";
11
5
  import styles from "./assets/styles.css?url";
12
6
  function Layout() {
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useLoaderData } from "@remix-run/react";
2
+ import { useLoaderData } from "react-router";
3
3
  import { HydrogenLogoBaseBW } from "../components/HydrogenLogoBaseBW.jsx";
4
4
  import { HydrogenLogoBaseColor } from "../components/HydrogenLogoBaseColor.jsx";
5
5
  import { IconGithub } from "../components/IconGithub.jsx";
@@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
3
3
  import { Script } from "@shopify/hydrogen";
4
4
  import { RequestWaterfall } from "../components/RequestWaterfall.jsx";
5
5
  import { RequestTable } from "../components/RequestTable.jsx";
6
- import { Link } from "@remix-run/react";
6
+ import { Link } from "react-router";
7
7
  import favicon from "../assets/favicon.svg";
8
8
  import faviconDark from "../assets/favicon-dark.svg";
9
9
  import { useDebugNetworkServer } from "../lib/useDebugNetworkServer.jsx";
@@ -7,7 +7,7 @@ import {
7
7
  ScrollRestoration,
8
8
  isRouteErrorResponse,
9
9
  useRouteError
10
- } from "@remix-run/react";
10
+ } from "react-router";
11
11
  import favicon from "./assets/favicon.svg";
12
12
  import { Layout as VirtualLayout } from "./components/Layout.jsx";
13
13
  import { useNonce } from "@shopify/hydrogen";
@@ -7,7 +7,7 @@ import {
7
7
  ScrollRestoration,
8
8
  isRouteErrorResponse,
9
9
  useRouteError
10
- } from "@remix-run/react";
10
+ } from "react-router";
11
11
  import favicon from "./assets/favicon.svg";
12
12
  import { Layout as VirtualLayout } from "./components/Layout.jsx";
13
13
  import { useNonce } from "@shopify/hydrogen";
@@ -14,7 +14,7 @@ export default defineConfig({
14
14
  v3_fetcherPersist: true,
15
15
  v3_relativeSplatPath: true,
16
16
  v3_throwAbortReason: true,
17
- v3_routeConfig: true,
17
+ v3_routeConfig: false,
18
18
  },
19
19
  }),
20
20
  tsconfigPaths(),