@shopify/cli-hydrogen 10.1.0 → 11.0.0

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 (73) hide show
  1. package/dist/assets/hydrogen/starter/.cursor/rules/hydrogen-react-router.mdc +50 -0
  2. package/dist/assets/hydrogen/starter/CHANGELOG.md +45 -58
  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 +1 -1
  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 +1 -1
  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 +10 -11
  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/virtual-routes/components/RequestDetails.jsx +1 -1
  48. package/dist/assets/hydrogen/virtual-routes/layout.jsx +1 -7
  49. package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +1 -1
  50. package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +1 -1
  51. package/dist/assets/hydrogen/virtual-routes/virtual-root-with-layout.jsx +1 -1
  52. package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +1 -1
  53. package/dist/assets/hydrogen/vite/vite.config.js +1 -1
  54. package/dist/commands/hydrogen/build.js +7 -3
  55. package/dist/commands/hydrogen/debug/cpu.js +5 -9
  56. package/dist/commands/hydrogen/deploy.js +5 -4
  57. package/dist/commands/hydrogen/dev.js +10 -17
  58. package/dist/commands/hydrogen/preview.js +16 -27
  59. package/dist/commands/hydrogen/upgrade.js +42 -0
  60. package/dist/hooks/init.js +1 -1
  61. package/dist/index.d.ts +0 -3
  62. package/dist/lib/codegen.js +17 -3
  63. package/dist/lib/flags.js +0 -6
  64. package/dist/lib/mini-oxygen/index.js +1 -6
  65. package/dist/lib/onboarding/common.js +1 -0
  66. package/dist/lib/remix-config.js +7 -132
  67. package/dist/lib/vite-config.js +13 -9
  68. package/oclif.manifest.json +1 -22
  69. package/package.json +4 -4
  70. package/dist/lib/classic-compiler/build.js +0 -139
  71. package/dist/lib/classic-compiler/debug-cpu.js +0 -52
  72. package/dist/lib/classic-compiler/dev.js +0 -280
  73. package/dist/lib/virtual-routes.js +0 -49
@@ -0,0 +1,50 @@
1
+ ---
2
+ description: This Hydrogen project is based on react-router, NOT @remix-run/react!
3
+ globs: *
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # React Router Import Rule for Hydrogen
8
+
9
+ ## Overview
10
+
11
+ This Hydrogen project is based on React Router, not Remix. When working with documentation or code examples, you should always use imports from the appropriate React Router packages instead of Remix packages.
12
+
13
+ ## Import Replacements
14
+
15
+ When you see imports from Remix packages, replace them with their equivalent React Router v7 packages. Here are the common replacements:
16
+
17
+ | Remix v2 Package | React Router v7 Package |
18
+ |------------------|-------------------------|
19
+ | `@remix-run/react` | `react-router` |
20
+ | `@remix-run/dev` | `@react-router/dev` |
21
+ | `@remix-run/architect` | `@react-router/architect` |
22
+ | `@remix-run/cloudflare` | `@react-router/cloudflare` |
23
+ | `@remix-run/express` | `@react-router/express` |
24
+ | `@remix-run/fs-routes` | `@react-router/fs-routes` |
25
+ | `@remix-run/node` | `@react-router/node` |
26
+ | `@remix-run/route-config` | `@react-router/dev` |
27
+ | `@remix-run/routes-option-adapter` | `@react-router/remix-routes-option-adapter` |
28
+ | `@remix-run/serve` | `@react-router/serve` |
29
+ | `@remix-run/server-runtime` | `react-router` |
30
+ | `@remix-run/testing` | `react-router` |
31
+
32
+ ## Common Import Examples
33
+
34
+ ```js
35
+ // INCORRECT (Remix style)
36
+ import { useLoaderData, Link, Form, useActionData, useNavigation, useSubmit } from '@remix-run/react';
37
+
38
+ // CORRECT (React Router style)
39
+ import { useLoaderData, Link, Form, useActionData, useNavigation, useSubmit } from 'react-router';
40
+ ```
41
+
42
+ ## Development Guidelines
43
+
44
+ 1. Always check existing code in the project to understand which specific React Router hooks and components are being used
45
+ 2. When generating new code or modifying existing code, ensure all routing-related imports come from the correct React Router packages
46
+ 3. If following documentation or examples based on Remix, adapt the code to use React Router equivalents
47
+
48
+ When working in this codebase, always follow the React Router patterns that are already established in the existing code.
49
+
50
+ For more information, consult the official Remix to React Router upgrade guide: https://reactrouter.com/upgrading/remix
@@ -1,13 +1,14 @@
1
1
  # skeleton
2
2
 
3
- ## 2025.4.1
3
+ ## 2025.5.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Add a new tokenless Storefront API route to the starter template. ([#2948](https://github.com/Shopify/hydrogen/pull/2948)) by [@blittle](https://github.com/blittle)
7
+ - Migrating to React Router 7 ([#2866](https://github.com/Shopify/hydrogen/pull/2866)) by [@balazsbajorics](https://github.com/balazsbajorics)
8
8
 
9
- - Updated dependencies [[`d44fab3d`](https://github.com/Shopify/hydrogen/commit/d44fab3d07c5e255edcd22745d4d7e2db2c3e60f)]:
10
- - @shopify/hydrogen@2025.4.1
9
+ - Updated dependencies [[`e9132d88`](https://github.com/Shopify/hydrogen/commit/e9132d8888ad090d3db41fe4d5d63569a30e9d8e), [`e9132d88`](https://github.com/Shopify/hydrogen/commit/e9132d8888ad090d3db41fe4d5d63569a30e9d8e)]:
10
+ - @shopify/remix-oxygen@3.0.0
11
+ - @shopify/hydrogen@2025.5.0
11
12
 
12
13
  ## 2025.4.0
13
14
 
@@ -15,24 +16,10 @@
15
16
 
16
17
  - Moved the Cursor rules into more generic LLM prompt files. If you were using the Cursor rules, you will find the prompts in the `cookbook/llms` folder and they can be put into your `.cursor/rules` folder manually. LLM prompt files will be maintained moving forward, while previous Cursor rules will not be updated anymore. ([#2936](https://github.com/Shopify/hydrogen/pull/2936)) by [@ruggishop](https://github.com/ruggishop)
17
18
 
18
- - Added bundles recipe ([#2915](https://github.com/Shopify/hydrogen/pull/2915)) by [@ruggishop](https://github.com/ruggishop)
19
-
20
- - Update copy for subscriptions, combined listings, bundles recipes ([#2924](https://github.com/Shopify/hydrogen/pull/2924)) by [@ruggishop](https://github.com/ruggishop)
21
-
22
19
  - Bump skeleton @shopify/cli and @shopify/mini-oxygen ([#2883](https://github.com/Shopify/hydrogen/pull/2883)) by [@juanpprieto](https://github.com/juanpprieto)
23
20
 
24
- - Remove rules from the template. ([#2931](https://github.com/Shopify/hydrogen/pull/2931)) by [@ruggishop](https://github.com/ruggishop)
25
-
26
21
  - Update SFAPI and CAAPI versions to 2025.04 ([#2886](https://github.com/Shopify/hydrogen/pull/2886)) by [@juanpprieto](https://github.com/juanpprieto)
27
22
 
28
- - Updated recipes: subscriptions, bundles, combined-listings. New recipe: markets. ([#2930](https://github.com/Shopify/hydrogen/pull/2930)) by [@ruggishop](https://github.com/ruggishop)
29
-
30
- - Updated the subscriptions recipe to better display the purchase options. ([#2912](https://github.com/Shopify/hydrogen/pull/2912)) by [@ruggishop](https://github.com/ruggishop)
31
-
32
- - Bump recipes with copy adjustments ([#2935](https://github.com/Shopify/hydrogen/pull/2935)) by [@ruggishop](https://github.com/ruggishop)
33
-
34
- - Added a Combined Listings recipe. ([#2876](https://github.com/Shopify/hydrogen/pull/2876)) by [@ruggishop](https://github.com/ruggishop)
35
-
36
23
  - Updated dependencies [[`af23e710`](https://github.com/Shopify/hydrogen/commit/af23e710dac83bb57498d9c2ef1d8bcf9df55d34), [`9d8a6644`](https://github.com/Shopify/hydrogen/commit/9d8a6644a5b67dca890c6687df390aee78fc85c3)]:
37
24
  - @shopify/hydrogen@2025.4.0
38
25
 
@@ -173,13 +160,13 @@
173
160
  1. Add a routes.ts file. This is your new Remix route configuration file.
174
161
 
175
162
  ```ts
176
- import { flatRoutes } from "@remix-run/fs-routes";
177
- import { layout, type RouteConfig } from "@remix-run/route-config";
178
- import { hydrogenRoutes } from "@shopify/hydrogen";
163
+ import {flatRoutes} from '@remix-run/fs-routes';
164
+ import {layout, type RouteConfig} from '@remix-run/route-config';
165
+ import {hydrogenRoutes} from '@shopify/hydrogen';
179
166
 
180
167
  export default hydrogenRoutes([
181
168
  // Your entire app reading from routes folder using Layout from layout.tsx
182
- layout("./layout.tsx", await flatRoutes()),
169
+ layout('./layout.tsx', await flatRoutes()),
183
170
  ]) satisfies RouteConfig;
184
171
  ```
185
172
 
@@ -770,25 +757,25 @@
770
757
  8. Update the `ProductForm` component.
771
758
 
772
759
  ```tsx
773
- import { Link, useNavigate } from "@remix-run/react";
774
- import { type MappedProductOptions } from "@shopify/hydrogen";
760
+ import {Link, useNavigate} from '@remix-run/react';
761
+ import {type MappedProductOptions} from '@shopify/hydrogen';
775
762
  import type {
776
763
  Maybe,
777
764
  ProductOptionValueSwatch,
778
- } from "@shopify/hydrogen/storefront-api-types";
779
- import { AddToCartButton } from "./AddToCartButton";
780
- import { useAside } from "./Aside";
781
- import type { ProductFragment } from "storefrontapi.generated";
765
+ } from '@shopify/hydrogen/storefront-api-types';
766
+ import {AddToCartButton} from './AddToCartButton';
767
+ import {useAside} from './Aside';
768
+ import type {ProductFragment} from 'storefrontapi.generated';
782
769
 
783
770
  export function ProductForm({
784
771
  productOptions,
785
772
  selectedVariant,
786
773
  }: {
787
774
  productOptions: MappedProductOptions[];
788
- selectedVariant: ProductFragment["selectedOrFirstAvailableVariant"];
775
+ selectedVariant: ProductFragment['selectedOrFirstAvailableVariant'];
789
776
  }) {
790
777
  const navigate = useNavigate();
791
- const { open } = useAside();
778
+ const {open} = useAside();
792
779
  return (
793
780
  <div className="product-form">
794
781
  {productOptions.map((option) => (
@@ -822,8 +809,8 @@
822
809
  to={`/products/${handle}?${variantUriQuery}`}
823
810
  style={{
824
811
  border: selected
825
- ? "1px solid black"
826
- : "1px solid transparent",
812
+ ? '1px solid black'
813
+ : '1px solid transparent',
827
814
  opacity: available ? 1 : 0.3,
828
815
  }}
829
816
  >
@@ -840,13 +827,13 @@
840
827
  <button
841
828
  type="button"
842
829
  className={`product-options-item${
843
- exists && !selected ? " link" : ""
830
+ exists && !selected ? ' link' : ''
844
831
  }`}
845
832
  key={option.name + name}
846
833
  style={{
847
834
  border: selected
848
- ? "1px solid black"
849
- : "1px solid transparent",
835
+ ? '1px solid black'
836
+ : '1px solid transparent',
850
837
  opacity: available ? 1 : 0.3,
851
838
  }}
852
839
  disabled={!exists}
@@ -870,7 +857,7 @@
870
857
  <AddToCartButton
871
858
  disabled={!selectedVariant || !selectedVariant.availableForSale}
872
859
  onClick={() => {
873
- open("cart");
860
+ open('cart');
874
861
  }}
875
862
  lines={
876
863
  selectedVariant
@@ -884,7 +871,7 @@
884
871
  : []
885
872
  }
886
873
  >
887
- {selectedVariant?.availableForSale ? "Add to cart" : "Sold out"}
874
+ {selectedVariant?.availableForSale ? 'Add to cart' : 'Sold out'}
888
875
  </AddToCartButton>
889
876
  </div>
890
877
  );
@@ -907,7 +894,7 @@
907
894
  aria-label={name}
908
895
  className="product-option-label-swatch"
909
896
  style={{
910
- backgroundColor: color || "transparent",
897
+ backgroundColor: color || 'transparent',
911
898
  }}
912
899
  >
913
900
  {!!image && <img src={image} alt={name} />}
@@ -1408,21 +1395,21 @@
1408
1395
  New `withCache.fetch` is for caching simple fetch requests. This method caches the responses if they are OK responses, and you can pass `shouldCacheResponse`, `cacheKey`, etc. to modify behavior. `data` is the consumed body of the response (we need to consume to cache it).
1409
1396
 
1410
1397
  ```ts
1411
- const withCache = createWithCache({ cache, waitUntil, request });
1398
+ const withCache = createWithCache({cache, waitUntil, request});
1412
1399
 
1413
- const { data, response } = await withCache.fetch<{ data: T; error: string }>(
1414
- "my-cms.com/api",
1400
+ const {data, response} = await withCache.fetch<{data: T; error: string}>(
1401
+ 'my-cms.com/api',
1415
1402
  {
1416
- method: "POST",
1417
- headers: { "Content-type": "application/json" },
1403
+ method: 'POST',
1404
+ headers: {'Content-type': 'application/json'},
1418
1405
  body,
1419
1406
  },
1420
1407
  {
1421
1408
  cacheStrategy: CacheLong(),
1422
1409
  // Cache if there are no data errors or a specific data that make this result not suited for caching
1423
1410
  shouldCacheResponse: (result) => !result?.error,
1424
- cacheKey: ["my-cms", body],
1425
- displayName: "My CMS query",
1411
+ cacheKey: ['my-cms', body],
1412
+ displayName: 'My CMS query',
1426
1413
  },
1427
1414
  );
1428
1415
  ```
@@ -1998,9 +1985,9 @@
1998
1985
 
1999
1986
  ```tsx
2000
1987
  // app/lib/root-data.ts
2001
- import { useMatches } from "@remix-run/react";
2002
- import type { SerializeFrom } from "@shopify/remix-oxygen";
2003
- import type { loader } from "~/root";
1988
+ import {useMatches} from '@remix-run/react';
1989
+ import type {SerializeFrom} from '@shopify/remix-oxygen';
1990
+ import type {loader} from '~/root';
2004
1991
 
2005
1992
  /**
2006
1993
  * Access the result of the root loader from a React component.
@@ -2162,10 +2149,10 @@
2162
2149
  - This is an important fix to a bug with 404 routes and path-based i18n projects where some unknown routes would not properly render a 404. This fixes all new projects, but to fix existing projects, add a `($locale).tsx` route with the following contents: ([#1732](https://github.com/Shopify/hydrogen/pull/1732)) by [@blittle](https://github.com/blittle)
2163
2150
 
2164
2151
  ```ts
2165
- import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
2152
+ import {type LoaderFunctionArgs} from '@remix-run/server-runtime';
2166
2153
 
2167
- export async function loader({ params, context }: LoaderFunctionArgs) {
2168
- const { language, country } = context.storefront.i18n;
2154
+ export async function loader({params, context}: LoaderFunctionArgs) {
2155
+ const {language, country} = context.storefront.i18n;
2169
2156
 
2170
2157
  if (
2171
2158
  params.locale &&
@@ -2173,7 +2160,7 @@
2173
2160
  ) {
2174
2161
  // If the locale URL param is defined, yet we still are still at the default locale
2175
2162
  // then the the locale param must be invalid, send to the 404 page
2176
- throw new Response(null, { status: 404 });
2163
+ throw new Response(null, {status: 404});
2177
2164
  }
2178
2165
 
2179
2166
  return null;
@@ -2229,11 +2216,11 @@
2229
2216
  ```yaml
2230
2217
  projects:
2231
2218
  default:
2232
- schema: "node_modules/@shopify/hydrogen/storefront.schema.json"
2219
+ schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'
2233
2220
  documents:
2234
- - "!*.d.ts"
2235
- - "*.{ts,tsx,js,jsx}"
2236
- - "app/**/*.{ts,tsx,js,jsx}"
2221
+ - '!*.d.ts'
2222
+ - '*.{ts,tsx,js,jsx}'
2223
+ - 'app/**/*.{ts,tsx,js,jsx}'
2237
2224
  ```
2238
2225
 
2239
2226
  - Improve resiliency of `HydrogenSession` ([#1583](https://github.com/Shopify/hydrogen/pull/1583)) by [@blittle](https://github.com/blittle)
@@ -2448,8 +2435,8 @@
2448
2435
  ```ts
2449
2436
  // root.tsx
2450
2437
 
2451
- import { useMatches } from "@remix-run/react";
2452
- import { type SerializeFrom } from "@shopify/remix-oxygen";
2438
+ import {useMatches} from '@remix-run/react';
2439
+ import {type SerializeFrom} from '@shopify/remix-oxygen';
2453
2440
 
2454
2441
  export const useRootLoaderData = () => {
2455
2442
  const [root] = useMatches();
@@ -1,4 +1,4 @@
1
- import {type FetcherWithComponents} from '@remix-run/react';
1
+ import { type FetcherWithComponents } from 'react-router';
2
2
  import {CartForm, type OptimisticCartLineInput} from '@shopify/hydrogen';
3
3
 
4
4
  export function AddToCartButton({
@@ -2,7 +2,7 @@ import type {CartLineUpdateInput} from '@shopify/hydrogen/storefront-api-types';
2
2
  import type {CartLayout} from '~/components/CartMain';
3
3
  import {CartForm, Image, type OptimisticCartLine} from '@shopify/hydrogen';
4
4
  import {useVariantUrl} from '~/lib/variants';
5
- import {Link} from '@remix-run/react';
5
+ import { Link } from 'react-router';
6
6
  import {ProductPrice} from './ProductPrice';
7
7
  import {useAside} from './Aside';
8
8
  import type {CartApiQueryFragment} from 'storefrontapi.generated';
@@ -1,5 +1,5 @@
1
1
  import {useOptimisticCart} from '@shopify/hydrogen';
2
- import {Link} from '@remix-run/react';
2
+ import { Link } from 'react-router';
3
3
  import type {CartApiQueryFragment} from 'storefrontapi.generated';
4
4
  import {useAside} from '~/components/Aside';
5
5
  import {CartLineItem} from '~/components/CartLineItem';
@@ -2,7 +2,7 @@ import type {CartApiQueryFragment} from 'storefrontapi.generated';
2
2
  import type {CartLayout} from '~/components/CartMain';
3
3
  import {CartForm, Money, type OptimisticCart} from '@shopify/hydrogen';
4
4
  import {useRef} from 'react';
5
- import {FetcherWithComponents} from '@remix-run/react';
5
+ import { FetcherWithComponents } from 'react-router';
6
6
 
7
7
  type CartSummaryProps = {
8
8
  cart: OptimisticCart<CartApiQueryFragment | null>;
@@ -1,5 +1,5 @@
1
1
  import {Suspense} from 'react';
2
- import {Await, NavLink} from '@remix-run/react';
2
+ import {Await, NavLink} from 'react-router';
3
3
  import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated';
4
4
 
5
5
  interface FooterProps {
@@ -1,5 +1,5 @@
1
1
  import {Suspense} from 'react';
2
- import {Await, NavLink, useAsyncValue} from '@remix-run/react';
2
+ import { Await, NavLink, useAsyncValue } from 'react-router';
3
3
  import {
4
4
  type CartViewPayload,
5
5
  useAnalytics,
@@ -1,4 +1,4 @@
1
- import {Await, Link} from '@remix-run/react';
1
+ import { Await, Link } from 'react-router';
2
2
  import {Suspense, useId} from 'react';
3
3
  import type {
4
4
  CartApiQueryFragment,
@@ -1,4 +1,4 @@
1
- import {Link, useNavigate} from '@remix-run/react';
1
+ import { Link, useNavigate } from 'react-router';
2
2
  import {type MappedProductOptions} from '@shopify/hydrogen';
3
3
  import type {
4
4
  Maybe,
@@ -1,4 +1,4 @@
1
- import {Link} from '@remix-run/react';
1
+ import {Link} from 'react-router';
2
2
  import {Image, Money} from '@shopify/hydrogen';
3
3
  import type {
4
4
  ProductItemFragment,
@@ -1,5 +1,5 @@
1
1
  import {useRef, useEffect} from 'react';
2
- import {Form, type FormProps} from '@remix-run/react';
2
+ import { Form, type FormProps } from 'react-router';
3
3
 
4
4
  type SearchFormProps = Omit<FormProps, 'children'> & {
5
5
  children: (args: {
@@ -1,9 +1,4 @@
1
- import {
2
- useFetcher,
3
- useNavigate,
4
- type FormProps,
5
- type Fetcher,
6
- } from '@remix-run/react';
1
+ import { useFetcher, useNavigate, type FormProps, type Fetcher } from 'react-router';
7
2
  import React, {useRef, useEffect} from 'react';
8
3
  import type {PredictiveSearchReturn} from '~/lib/search';
9
4
  import {useAside} from './Aside';
@@ -1,4 +1,4 @@
1
- import {Link} from '@remix-run/react';
1
+ import { Link } from 'react-router';
2
2
  import {Image, Money, Pagination} from '@shopify/hydrogen';
3
3
  import {urlWithTrackingParams, type RegularSearchReturn} from '~/lib/search';
4
4
 
@@ -1,4 +1,4 @@
1
- import {Link, useFetcher, type Fetcher} from '@remix-run/react';
1
+ import { Link, useFetcher, type Fetcher } from 'react-router';
2
2
  import {Image, Money} from '@shopify/hydrogen';
3
3
  import React, {useRef, useEffect} from 'react';
4
4
  import {
@@ -1,4 +1,4 @@
1
- import {RemixBrowser} from '@remix-run/react';
1
+ import { HydratedRouter } from 'react-router/dom';
2
2
  import {startTransition, StrictMode} from 'react';
3
3
  import {hydrateRoot} from 'react-dom/client';
4
4
 
@@ -7,7 +7,7 @@ if (!window.location.origin.includes('webcache.googleusercontent.com')) {
7
7
  hydrateRoot(
8
8
  document,
9
9
  <StrictMode>
10
- <RemixBrowser />
10
+ <HydratedRouter />
11
11
  </StrictMode>,
12
12
  );
13
13
  });
@@ -1,14 +1,15 @@
1
- import type {EntryContext, AppLoadContext} from '@shopify/remix-oxygen';
2
- import {RemixServer} from '@remix-run/react';
1
+ import type {AppLoadContext} from '@shopify/remix-oxygen';
2
+ import {ServerRouter} from 'react-router';
3
3
  import {isbot} from 'isbot';
4
4
  import {renderToReadableStream} from 'react-dom/server';
5
5
  import {createContentSecurityPolicy} from '@shopify/hydrogen';
6
+ import type {EntryContext} from 'react-router';
6
7
 
7
8
  export default async function handleRequest(
8
9
  request: Request,
9
10
  responseStatusCode: number,
10
11
  responseHeaders: Headers,
11
- remixContext: EntryContext,
12
+ reactRouterContext: EntryContext,
12
13
  context: AppLoadContext,
13
14
  ) {
14
15
  const {nonce, header, NonceProvider} = createContentSecurityPolicy({
@@ -20,7 +21,11 @@ export default async function handleRequest(
20
21
 
21
22
  const body = await renderToReadableStream(
22
23
  <NonceProvider>
23
- <RemixServer context={remixContext} url={request.url} nonce={nonce}/>
24
+ <ServerRouter
25
+ context={reactRouterContext}
26
+ url={request.url}
27
+ nonce={nonce}
28
+ />
24
29
  </NonceProvider>,
25
30
  {
26
31
  nonce,
@@ -1,4 +1,4 @@
1
- import {useLocation} from '@remix-run/react';
1
+ import { useLocation } from 'react-router';
2
2
  import type {SelectedOption} from '@shopify/hydrogen/storefront-api-types';
3
3
  import {useMemo} from 'react';
4
4
 
@@ -10,7 +10,7 @@ import {
10
10
  Scripts,
11
11
  ScrollRestoration,
12
12
  useRouteLoaderData,
13
- } from '@remix-run/react';
13
+ } from 'react-router';
14
14
  import favicon from '~/assets/favicon.svg';
15
15
  import {FOOTER_QUERY, HEADER_QUERY} from '~/lib/fragments';
16
16
  import resetStyles from '~/styles/reset.css?url';
@@ -1,5 +1,5 @@
1
1
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {Await, useLoaderData, Link, type MetaFunction} from '@remix-run/react';
2
+ import { Await, useLoaderData, Link, type MetaFunction } from 'react-router';
3
3
  import {Suspense} from 'react';
4
4
  import {Image, Money} from '@shopify/hydrogen';
5
5
  import type {
@@ -15,7 +15,7 @@ import {
15
15
  useOutletContext,
16
16
  type MetaFunction,
17
17
  type Fetcher,
18
- } from '@remix-run/react';
18
+ } from 'react-router';
19
19
  import {
20
20
  UPDATE_ADDRESS_MUTATION,
21
21
  DELETE_ADDRESS_MUTATION,
@@ -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 {Money, Image, flattenConnection} from '@shopify/hydrogen';
4
4
  import type {OrderLineItemFullFragment} from 'customer-accountapi.generated';
5
5
  import {CUSTOMER_ORDER_QUERY} from '~/graphql/customer-account/CustomerOrderQuery';
@@ -60,7 +60,7 @@ export default function OrderRoute() {
60
60
  fulfillmentStatus,
61
61
  } = useLoaderData<typeof loader>();
62
62
  return (
63
- <div className="account-order">
63
+ (<div className="account-order">
64
64
  <h2>Order {order.name}</h2>
65
65
  <p>Placed on {new Date(order.processedAt!).toDateString()}</p>
66
66
  <br />
@@ -77,7 +77,7 @@ export default function OrderRoute() {
77
77
  <tbody>
78
78
  {lineItems.map((lineItem, lineItemIndex) => (
79
79
  // eslint-disable-next-line react/no-array-index-key
80
- <OrderLineRow key={lineItemIndex} lineItem={lineItem} />
80
+ (<OrderLineRow key={lineItemIndex} lineItem={lineItem} />)
81
81
  ))}
82
82
  </tbody>
83
83
  <tfoot>
@@ -165,7 +165,7 @@ export default function OrderRoute() {
165
165
  View Order Status →
166
166
  </a>
167
167
  </p>
168
- </div>
168
+ </div>)
169
169
  );
170
170
  }
171
171
 
@@ -1,4 +1,4 @@
1
- import {Link, useLoaderData, type MetaFunction} from '@remix-run/react';
1
+ import { Link, useLoaderData, type MetaFunction } from 'react-router';
2
2
  import {
3
3
  Money,
4
4
  getPaginationVariables,
@@ -6,13 +6,7 @@ import {
6
6
  type ActionFunctionArgs,
7
7
  type LoaderFunctionArgs,
8
8
  } from '@shopify/remix-oxygen';
9
- import {
10
- Form,
11
- useActionData,
12
- useNavigation,
13
- useOutletContext,
14
- type MetaFunction,
15
- } from '@remix-run/react';
9
+ import { Form, useActionData, useNavigation, useOutletContext, type MetaFunction } from 'react-router';
16
10
 
17
11
  export type ActionResponse = {
18
12
  error: string | null;
@@ -1,5 +1,5 @@
1
1
  import {data as remixData, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {Form, NavLink, Outlet, useLoaderData} from '@remix-run/react';
2
+ import { Form, NavLink, Outlet, useLoaderData } from 'react-router';
3
3
  import {CUSTOMER_DETAILS_QUERY} from '~/graphql/customer-account/CustomerDetailsQuery';
4
4
 
5
5
  export function shouldRevalidate() {
@@ -1,4 +1,4 @@
1
- import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {LoaderFunctionArgs} from 'react-router';
2
2
 
3
3
  export async function action({params, context, request}: LoaderFunctionArgs) {
4
4
  const response = await fetch(
@@ -1,5 +1,5 @@
1
1
  import {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 {Image} from '@shopify/hydrogen';
4
4
  import {redirectIfHandleIsLocalized} from '~/lib/redirect';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {Link, useLoaderData, type MetaFunction} from '@remix-run/react';
2
+ import { Link, useLoaderData, type MetaFunction } from 'react-router';
3
3
  import {Image, getPaginationVariables} from '@shopify/hydrogen';
4
4
  import type {ArticleItemFragment} from 'storefrontapi.generated';
5
5
  import {PaginatedResourceSection} from '~/components/PaginatedResourceSection';
@@ -1,5 +1,5 @@
1
1
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {Link, useLoaderData, type MetaFunction} from '@remix-run/react';
2
+ import { Link, useLoaderData, type MetaFunction } from 'react-router';
3
3
  import {getPaginationVariables} from '@shopify/hydrogen';
4
4
  import {PaginatedResourceSection} from '~/components/PaginatedResourceSection';
5
5
 
@@ -1,4 +1,4 @@
1
- import {type MetaFunction, useLoaderData} from '@remix-run/react';
1
+ import { type MetaFunction, useLoaderData } from 'react-router';
2
2
  import type {CartQueryDataReturn} from '@shopify/hydrogen';
3
3
  import {CartForm} from '@shopify/hydrogen';
4
4
  import {
@@ -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 {getPaginationVariables, Analytics} from '@shopify/hydrogen';
4
4
  import {PaginatedResourceSection} from '~/components/PaginatedResourceSection';
5
5
  import {redirectIfHandleIsLocalized} from '~/lib/redirect';
@@ -1,4 +1,4 @@
1
- import {useLoaderData, Link} from '@remix-run/react';
1
+ import { useLoaderData, Link } from 'react-router';
2
2
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
3
3
  import {getPaginationVariables, Image} from '@shopify/hydrogen';
4
4
  import type {CollectionFragment} from 'storefrontapi.generated';
@@ -1,6 +1,6 @@
1
1
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {useLoaderData, type MetaFunction} from '@remix-run/react';
3
- import {getPaginationVariables} from '@shopify/hydrogen';
2
+ import {useLoaderData, type MetaFunction} from 'react-router';
3
+ import {getPaginationVariables, Image, Money} from '@shopify/hydrogen';
4
4
  import {PaginatedResourceSection} from '~/components/PaginatedResourceSection';
5
5
  import {ProductItem} from '~/components/ProductItem';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import {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 {redirectIfHandleIsLocalized} from '~/lib/redirect';
4
4
 
5
5
  export const meta: MetaFunction<typeof loader> = ({data}) => {
@@ -1,5 +1,5 @@
1
1
  import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
- import {Link, useLoaderData, type MetaFunction} from '@remix-run/react';
2
+ import { Link, useLoaderData, type MetaFunction } from 'react-router';
3
3
  import {type Shop} from '@shopify/hydrogen/storefront-api-types';
4
4
 
5
5
  type SelectedPolicies = keyof Pick<