@shopify/create-hydrogen 5.0.16 → 5.0.18
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.
- package/dist/assets/hydrogen/bundle/analyzer.html +21 -17
- package/dist/assets/hydrogen/starter/CHANGELOG.md +125 -36
- package/dist/assets/hydrogen/starter/app/layout.tsx +46 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +1 -42
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +4 -3
- package/dist/assets/hydrogen/starter/app/routes.ts +7 -0
- package/dist/assets/hydrogen/starter/package.json +17 -15
- package/dist/assets/hydrogen/starter/tsconfig.json +1 -1
- package/dist/assets/hydrogen/starter/vite.config.ts +2 -1
- package/dist/assets/hydrogen/tailwind/package.json +1 -1
- package/dist/assets/hydrogen/vanilla-extract/package.json +2 -2
- package/dist/assets/hydrogen/virtual-routes/assets/debug-network.css +27 -10
- package/dist/assets/hydrogen/virtual-routes/assets/styles.css +13 -2
- package/dist/assets/hydrogen/virtual-routes/layout.jsx +39 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root-with-layout.jsx +63 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +10 -8
- package/dist/assets/hydrogen/vite/package.json +1 -1
- package/dist/assets/hydrogen/vite/vite.config.js +1 -0
- package/dist/{chokidar-JM5J34A5.js → chokidar-FXMI63T6.js} +1 -1
- package/dist/{chunk-ULLCPMX6.js → chunk-3LZ6M5C2.js} +1 -1
- package/dist/chunk-BC2VIKDB.js +1184 -0
- package/dist/{chunk-2RCBZ7OV.js → chunk-D7CI46F7.js} +1 -1
- package/dist/{chunk-M6JXYI3V.js → chunk-MZPD7BFF.js} +2 -2
- package/dist/{chunk-RH6HNOXT.js → chunk-UASQ33JG.js} +1 -1
- package/dist/create-app.js +217 -217
- package/dist/{del-G73TN4QI.js → del-72VO4HYK.js} +1 -1
- package/dist/devtools-DGRGSZU7.js +8 -0
- package/dist/error-handler-T5EOGV44.js +2 -0
- package/dist/{morph-WDWHW3T4.js → morph-3JSBLNUD.js} +9 -9
- package/dist/{multipart-parser-6HGDQWV7.js → multipart-parser-QIHQVIZA.js} +1 -1
- package/dist/{out-E5GFW6SH.js → out-DXB3K325.js} +1 -1
- package/package.json +3 -3
- package/dist/chunk-XXYZHDBL.js +0 -1170
- package/dist/devtools-ZCRGQE64.js +0 -8
- package/dist/error-handler-XEHYQ43T.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<!-- Open this file in your browser for an interactive view of your bundle -->
|
|
3
3
|
|
|
4
4
|
<!-- saved from url=(0034)https://esbuild.github.io/analyze/ -->
|
|
@@ -94,7 +94,9 @@
|
|
|
94
94
|
color: var(--fg-on);
|
|
95
95
|
}
|
|
96
96
|
code {
|
|
97
|
-
font:
|
|
97
|
+
font:
|
|
98
|
+
14px/20px Noto Sans Mono,
|
|
99
|
+
monospace;
|
|
98
100
|
background: rgba(127, 127, 127, 0.2);
|
|
99
101
|
padding: 2px 4px;
|
|
100
102
|
margin-bottom: -2px;
|
|
@@ -102,7 +104,9 @@
|
|
|
102
104
|
}
|
|
103
105
|
pre {
|
|
104
106
|
color: var(--pre);
|
|
105
|
-
font:
|
|
107
|
+
font:
|
|
108
|
+
14px/20px Noto Sans Mono,
|
|
109
|
+
monospace;
|
|
106
110
|
padding: 0;
|
|
107
111
|
margin: 0;
|
|
108
112
|
white-space: pre-wrap;
|
|
@@ -598,12 +602,12 @@
|
|
|
598
602
|
e === 1
|
|
599
603
|
? '1 byte'
|
|
600
604
|
: e < 1024
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
605
|
+
? xe(e) + ' bytes'
|
|
606
|
+
: e < 1024 * 1024
|
|
607
|
+
? Ke(e / 1024) + ' kb'
|
|
608
|
+
: e < 1024 * 1024 * 1024
|
|
609
|
+
? Ke(e / (1024 * 1024)) + ' mb'
|
|
610
|
+
: Ke(e / (1024 * 1024 * 1024)) + ' gb',
|
|
607
611
|
H = (e) =>
|
|
608
612
|
e
|
|
609
613
|
.replace(/&/g, '&')
|
|
@@ -873,10 +877,10 @@
|
|
|
873
877
|
e === Se
|
|
874
878
|
? ''
|
|
875
879
|
: e === we
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
+
? t + 'ESM'
|
|
881
|
+
: e === He
|
|
882
|
+
? t + 'CJS'
|
|
883
|
+
: t + 'ESM & CJS',
|
|
880
884
|
Ft = (e, t) => {
|
|
881
885
|
let r = t.o,
|
|
882
886
|
s = 0,
|
|
@@ -920,8 +924,8 @@
|
|
|
920
924
|
x === 'esm'
|
|
921
925
|
? (l += O.bytes)
|
|
922
926
|
: x === 'cjs'
|
|
923
|
-
|
|
924
|
-
|
|
927
|
+
? (o += O.bytes)
|
|
928
|
+
: (m += O.bytes),
|
|
925
929
|
n++,
|
|
926
930
|
(u += O.bytes);
|
|
927
931
|
}
|
|
@@ -1031,8 +1035,8 @@
|
|
|
1031
1035
|
(s.format === 'esm'
|
|
1032
1036
|
? '<br>Module format: <b>ESM</b>'
|
|
1033
1037
|
: s.format === 'cjs'
|
|
1034
|
-
|
|
1035
|
-
|
|
1038
|
+
? '<br>Module format: <b>CommonJS</b>'
|
|
1039
|
+
: '') +
|
|
1036
1040
|
'</p>'),
|
|
1037
1041
|
el(i, pt, t);
|
|
1038
1042
|
let u = d.createElement('a');
|
|
@@ -1,5 +1,94 @@
|
|
|
1
1
|
# skeleton
|
|
2
2
|
|
|
3
|
+
## 2025.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bump Remix to 2.16.1 and vite to 6.2.0 ([#2784](https://github.com/Shopify/hydrogen/pull/2784)) by [@wizardlyhel](https://github.com/wizardlyhel)
|
|
8
|
+
|
|
9
|
+
- Update skeleton and create-hydrogen cli to 3.75.4 ([#2769](https://github.com/Shopify/hydrogen/pull/2769)) by [@juanpprieto](https://github.com/juanpprieto)
|
|
10
|
+
|
|
11
|
+
- Fixing typescript compile ([#2787](https://github.com/Shopify/hydrogen/pull/2787)) by [@balazsbajorics](https://github.com/balazsbajorics)
|
|
12
|
+
|
|
13
|
+
In tsconfig.json:
|
|
14
|
+
|
|
15
|
+
```diff
|
|
16
|
+
"types": [
|
|
17
|
+
"@shopify/oxygen-workers-types",
|
|
18
|
+
- "@remix-run/node",
|
|
19
|
+
+ "@remix-run/server-runtime",
|
|
20
|
+
"vite/client"
|
|
21
|
+
],
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- Updates `@shopify/cli-kit`, `@shopify/cli` and `@shopify/plugin-cloudflare` to `3.77.0`. ([#2810](https://github.com/Shopify/hydrogen/pull/2810)) by [@seanparsons](https://github.com/seanparsons)
|
|
25
|
+
|
|
26
|
+
- Support for the Remix future flag `v3_routeConfig`. ([#2722](https://github.com/Shopify/hydrogen/pull/2722)) by [@seanparsons](https://github.com/seanparsons)
|
|
27
|
+
|
|
28
|
+
Please refer to the Remix documentation for more details on `v3_routeConfig` future flag: [https://remix.run/docs/en/main/start/future-flags#v3_routeconfig](https://remix.run/docs/en/main/start/future-flags#v3_routeconfig)
|
|
29
|
+
|
|
30
|
+
1. Add the following npm package dev dependencies:
|
|
31
|
+
|
|
32
|
+
```diff
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@remix-run/dev": "^2.16.1",
|
|
35
|
+
+ "@remix-run/fs-routes": "^2.16.1",
|
|
36
|
+
+ "@remix-run/route-config": "^2.16.1",
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
1. If you have `export function Layout` in your `root.tsx`, move this export into its own file. For example:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// /app/layout.tsx
|
|
43
|
+
export default function Layout() {
|
|
44
|
+
const nonce = useNonce();
|
|
45
|
+
const data = useRouteLoaderData<RootLoader>('root');
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<html lang="en">
|
|
49
|
+
...
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
1. Create a `routes.ts` file.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { flatRoutes } from "@remix-run/fs-routes";
|
|
58
|
+
import { layout, type RouteConfig } from "@remix-run/route-config";
|
|
59
|
+
import { hydrogenRoutes } from "@shopify/hydrogen";
|
|
60
|
+
|
|
61
|
+
export default hydrogenRoutes([
|
|
62
|
+
// Your entire app reading from routes folder using Layout from layout.tsx
|
|
63
|
+
layout("./layout.tsx", await flatRoutes()),
|
|
64
|
+
]) satisfies RouteConfig;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
1. Update your `vite.config.ts`.
|
|
68
|
+
|
|
69
|
+
```diff
|
|
70
|
+
export default defineConfig({
|
|
71
|
+
plugins: [
|
|
72
|
+
hydrogen(),
|
|
73
|
+
oxygen(),
|
|
74
|
+
remix({
|
|
75
|
+
- presets: [hydrogen.preset()],
|
|
76
|
+
+ presets: [hydrogen.v3preset()],
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- Updated dependencies [[`0425e50d`](https://github.com/Shopify/hydrogen/commit/0425e50dafe2f42326cba67076e5fcea2905e885), [`74ef1ba7`](https://github.com/Shopify/hydrogen/commit/74ef1ba7d41988350e9d2c81731c90381943d1f0)]:
|
|
80
|
+
- @shopify/remix-oxygen@2.0.12
|
|
81
|
+
- @shopify/hydrogen@2025.1.3
|
|
82
|
+
|
|
83
|
+
## 2025.1.2
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Bump cli version ([#2760](https://github.com/Shopify/hydrogen/pull/2760)) by [@rbshop](https://github.com/rbshop)
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [[`128dfcd6`](https://github.com/Shopify/hydrogen/commit/128dfcd6b254a7465d93be49d3bcbff5251e5ffc)]:
|
|
90
|
+
- @shopify/hydrogen@2025.1.2
|
|
91
|
+
|
|
3
92
|
## 2025.1.1
|
|
4
93
|
|
|
5
94
|
### Patch Changes
|
|
@@ -574,25 +663,25 @@
|
|
|
574
663
|
8. Update the `ProductForm` component.
|
|
575
664
|
|
|
576
665
|
```tsx
|
|
577
|
-
import {Link, useNavigate} from
|
|
578
|
-
import {type MappedProductOptions} from
|
|
666
|
+
import { Link, useNavigate } from "@remix-run/react";
|
|
667
|
+
import { type MappedProductOptions } from "@shopify/hydrogen";
|
|
579
668
|
import type {
|
|
580
669
|
Maybe,
|
|
581
670
|
ProductOptionValueSwatch,
|
|
582
|
-
} from
|
|
583
|
-
import {AddToCartButton} from
|
|
584
|
-
import {useAside} from
|
|
585
|
-
import type {ProductFragment} from
|
|
671
|
+
} from "@shopify/hydrogen/storefront-api-types";
|
|
672
|
+
import { AddToCartButton } from "./AddToCartButton";
|
|
673
|
+
import { useAside } from "./Aside";
|
|
674
|
+
import type { ProductFragment } from "storefrontapi.generated";
|
|
586
675
|
|
|
587
676
|
export function ProductForm({
|
|
588
677
|
productOptions,
|
|
589
678
|
selectedVariant,
|
|
590
679
|
}: {
|
|
591
680
|
productOptions: MappedProductOptions[];
|
|
592
|
-
selectedVariant: ProductFragment[
|
|
681
|
+
selectedVariant: ProductFragment["selectedOrFirstAvailableVariant"];
|
|
593
682
|
}) {
|
|
594
683
|
const navigate = useNavigate();
|
|
595
|
-
const {open} = useAside();
|
|
684
|
+
const { open } = useAside();
|
|
596
685
|
return (
|
|
597
686
|
<div className="product-form">
|
|
598
687
|
{productOptions.map((option) => (
|
|
@@ -626,8 +715,8 @@
|
|
|
626
715
|
to={`/products/${handle}?${variantUriQuery}`}
|
|
627
716
|
style={{
|
|
628
717
|
border: selected
|
|
629
|
-
?
|
|
630
|
-
:
|
|
718
|
+
? "1px solid black"
|
|
719
|
+
: "1px solid transparent",
|
|
631
720
|
opacity: available ? 1 : 0.3,
|
|
632
721
|
}}
|
|
633
722
|
>
|
|
@@ -644,13 +733,13 @@
|
|
|
644
733
|
<button
|
|
645
734
|
type="button"
|
|
646
735
|
className={`product-options-item${
|
|
647
|
-
exists && !selected ?
|
|
736
|
+
exists && !selected ? " link" : ""
|
|
648
737
|
}`}
|
|
649
738
|
key={option.name + name}
|
|
650
739
|
style={{
|
|
651
740
|
border: selected
|
|
652
|
-
?
|
|
653
|
-
:
|
|
741
|
+
? "1px solid black"
|
|
742
|
+
: "1px solid transparent",
|
|
654
743
|
opacity: available ? 1 : 0.3,
|
|
655
744
|
}}
|
|
656
745
|
disabled={!exists}
|
|
@@ -674,7 +763,7 @@
|
|
|
674
763
|
<AddToCartButton
|
|
675
764
|
disabled={!selectedVariant || !selectedVariant.availableForSale}
|
|
676
765
|
onClick={() => {
|
|
677
|
-
open(
|
|
766
|
+
open("cart");
|
|
678
767
|
}}
|
|
679
768
|
lines={
|
|
680
769
|
selectedVariant
|
|
@@ -688,7 +777,7 @@
|
|
|
688
777
|
: []
|
|
689
778
|
}
|
|
690
779
|
>
|
|
691
|
-
{selectedVariant?.availableForSale ?
|
|
780
|
+
{selectedVariant?.availableForSale ? "Add to cart" : "Sold out"}
|
|
692
781
|
</AddToCartButton>
|
|
693
782
|
</div>
|
|
694
783
|
);
|
|
@@ -711,7 +800,7 @@
|
|
|
711
800
|
aria-label={name}
|
|
712
801
|
className="product-option-label-swatch"
|
|
713
802
|
style={{
|
|
714
|
-
backgroundColor: color ||
|
|
803
|
+
backgroundColor: color || "transparent",
|
|
715
804
|
}}
|
|
716
805
|
>
|
|
717
806
|
{!!image && <img src={image} alt={name} />}
|
|
@@ -1212,21 +1301,21 @@
|
|
|
1212
1301
|
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).
|
|
1213
1302
|
|
|
1214
1303
|
```ts
|
|
1215
|
-
const withCache = createWithCache({cache, waitUntil, request});
|
|
1304
|
+
const withCache = createWithCache({ cache, waitUntil, request });
|
|
1216
1305
|
|
|
1217
|
-
const {data, response} = await withCache.fetch<{data: T; error: string}>(
|
|
1218
|
-
|
|
1306
|
+
const { data, response } = await withCache.fetch<{ data: T; error: string }>(
|
|
1307
|
+
"my-cms.com/api",
|
|
1219
1308
|
{
|
|
1220
|
-
method:
|
|
1221
|
-
headers: {
|
|
1309
|
+
method: "POST",
|
|
1310
|
+
headers: { "Content-type": "application/json" },
|
|
1222
1311
|
body,
|
|
1223
1312
|
},
|
|
1224
1313
|
{
|
|
1225
1314
|
cacheStrategy: CacheLong(),
|
|
1226
1315
|
// Cache if there are no data errors or a specific data that make this result not suited for caching
|
|
1227
1316
|
shouldCacheResponse: (result) => !result?.error,
|
|
1228
|
-
cacheKey: [
|
|
1229
|
-
displayName:
|
|
1317
|
+
cacheKey: ["my-cms", body],
|
|
1318
|
+
displayName: "My CMS query",
|
|
1230
1319
|
},
|
|
1231
1320
|
);
|
|
1232
1321
|
```
|
|
@@ -1802,9 +1891,9 @@
|
|
|
1802
1891
|
|
|
1803
1892
|
```tsx
|
|
1804
1893
|
// app/lib/root-data.ts
|
|
1805
|
-
import {useMatches} from
|
|
1806
|
-
import type {SerializeFrom} from
|
|
1807
|
-
import type {loader} from
|
|
1894
|
+
import { useMatches } from "@remix-run/react";
|
|
1895
|
+
import type { SerializeFrom } from "@shopify/remix-oxygen";
|
|
1896
|
+
import type { loader } from "~/root";
|
|
1808
1897
|
|
|
1809
1898
|
/**
|
|
1810
1899
|
* Access the result of the root loader from a React component.
|
|
@@ -1966,10 +2055,10 @@
|
|
|
1966
2055
|
- 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)
|
|
1967
2056
|
|
|
1968
2057
|
```ts
|
|
1969
|
-
import {type LoaderFunctionArgs} from
|
|
2058
|
+
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
|
|
1970
2059
|
|
|
1971
|
-
export async function loader({params, context}: LoaderFunctionArgs) {
|
|
1972
|
-
const {language, country} = context.storefront.i18n;
|
|
2060
|
+
export async function loader({ params, context }: LoaderFunctionArgs) {
|
|
2061
|
+
const { language, country } = context.storefront.i18n;
|
|
1973
2062
|
|
|
1974
2063
|
if (
|
|
1975
2064
|
params.locale &&
|
|
@@ -1977,7 +2066,7 @@
|
|
|
1977
2066
|
) {
|
|
1978
2067
|
// If the locale URL param is defined, yet we still are still at the default locale
|
|
1979
2068
|
// then the the locale param must be invalid, send to the 404 page
|
|
1980
|
-
throw new Response(null, {status: 404});
|
|
2069
|
+
throw new Response(null, { status: 404 });
|
|
1981
2070
|
}
|
|
1982
2071
|
|
|
1983
2072
|
return null;
|
|
@@ -2033,11 +2122,11 @@
|
|
|
2033
2122
|
```yaml
|
|
2034
2123
|
projects:
|
|
2035
2124
|
default:
|
|
2036
|
-
schema:
|
|
2125
|
+
schema: "node_modules/@shopify/hydrogen/storefront.schema.json"
|
|
2037
2126
|
documents:
|
|
2038
|
-
-
|
|
2039
|
-
-
|
|
2040
|
-
-
|
|
2127
|
+
- "!*.d.ts"
|
|
2128
|
+
- "*.{ts,tsx,js,jsx}"
|
|
2129
|
+
- "app/**/*.{ts,tsx,js,jsx}"
|
|
2041
2130
|
```
|
|
2042
2131
|
|
|
2043
2132
|
- Improve resiliency of `HydrogenSession` ([#1583](https://github.com/Shopify/hydrogen/pull/1583)) by [@blittle](https://github.com/blittle)
|
|
@@ -2252,8 +2341,8 @@
|
|
|
2252
2341
|
```ts
|
|
2253
2342
|
// root.tsx
|
|
2254
2343
|
|
|
2255
|
-
import {useMatches} from
|
|
2256
|
-
import {type SerializeFrom} from
|
|
2344
|
+
import { useMatches } from "@remix-run/react";
|
|
2345
|
+
import { type SerializeFrom } from "@shopify/remix-oxygen";
|
|
2257
2346
|
|
|
2258
2347
|
export const useRootLoaderData = () => {
|
|
2259
2348
|
const [root] = useMatches();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {useNonce, Analytics} from '@shopify/hydrogen';
|
|
2
|
+
import {
|
|
3
|
+
Links,
|
|
4
|
+
Meta,
|
|
5
|
+
Scripts,
|
|
6
|
+
useRouteLoaderData,
|
|
7
|
+
ScrollRestoration,
|
|
8
|
+
Outlet,
|
|
9
|
+
} from '@remix-run/react';
|
|
10
|
+
import resetStyles from '~/styles/reset.css?url';
|
|
11
|
+
import appStyles from '~/styles/app.css?url';
|
|
12
|
+
import {PageLayout} from '~/components/PageLayout';
|
|
13
|
+
import { RootLoader } from './root';
|
|
14
|
+
|
|
15
|
+
export default function Layout() {
|
|
16
|
+
const nonce = useNonce();
|
|
17
|
+
const data = useRouteLoaderData<RootLoader>('root');
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<html lang="en">
|
|
21
|
+
<head>
|
|
22
|
+
<meta charSet="utf-8" />
|
|
23
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
24
|
+
<link rel="stylesheet" href={resetStyles}></link>
|
|
25
|
+
<link rel="stylesheet" href={appStyles}></link>
|
|
26
|
+
<Meta />
|
|
27
|
+
<Links />
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
{data ? (
|
|
31
|
+
<Analytics.Provider
|
|
32
|
+
cart={data.cart}
|
|
33
|
+
shop={data.shop}
|
|
34
|
+
consent={data.consent}
|
|
35
|
+
>
|
|
36
|
+
<PageLayout {...data}><Outlet /></PageLayout>
|
|
37
|
+
</Analytics.Provider>
|
|
38
|
+
) : (
|
|
39
|
+
<Outlet />
|
|
40
|
+
)}
|
|
41
|
+
<ScrollRestoration nonce={nonce} />
|
|
42
|
+
<Scripts nonce={nonce} />
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {getShopAnalytics} from '@shopify/hydrogen';
|
|
2
2
|
import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
|
|
3
3
|
import {
|
|
4
|
-
Links,
|
|
5
|
-
Meta,
|
|
6
4
|
Outlet,
|
|
7
|
-
Scripts,
|
|
8
5
|
useRouteError,
|
|
9
|
-
useRouteLoaderData,
|
|
10
|
-
ScrollRestoration,
|
|
11
6
|
isRouteErrorResponse,
|
|
12
7
|
type ShouldRevalidateFunction,
|
|
13
8
|
} from '@remix-run/react';
|
|
14
9
|
import favicon from '~/assets/favicon.svg';
|
|
15
|
-
import resetStyles from '~/styles/reset.css?url';
|
|
16
|
-
import appStyles from '~/styles/app.css?url';
|
|
17
|
-
import {PageLayout} from '~/components/PageLayout';
|
|
18
10
|
import {FOOTER_QUERY, HEADER_QUERY} from '~/lib/fragments';
|
|
19
11
|
|
|
20
12
|
export type RootLoader = typeof loader;
|
|
@@ -141,39 +133,6 @@ function loadDeferredData({context}: LoaderFunctionArgs) {
|
|
|
141
133
|
};
|
|
142
134
|
}
|
|
143
135
|
|
|
144
|
-
export function Layout({children}: {children?: React.ReactNode}) {
|
|
145
|
-
const nonce = useNonce();
|
|
146
|
-
const data = useRouteLoaderData<RootLoader>('root');
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<html lang="en">
|
|
150
|
-
<head>
|
|
151
|
-
<meta charSet="utf-8" />
|
|
152
|
-
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
153
|
-
<link rel="stylesheet" href={resetStyles}></link>
|
|
154
|
-
<link rel="stylesheet" href={appStyles}></link>
|
|
155
|
-
<Meta />
|
|
156
|
-
<Links />
|
|
157
|
-
</head>
|
|
158
|
-
<body>
|
|
159
|
-
{data ? (
|
|
160
|
-
<Analytics.Provider
|
|
161
|
-
cart={data.cart}
|
|
162
|
-
shop={data.shop}
|
|
163
|
-
consent={data.consent}
|
|
164
|
-
>
|
|
165
|
-
<PageLayout {...data}>{children}</PageLayout>
|
|
166
|
-
</Analytics.Provider>
|
|
167
|
-
) : (
|
|
168
|
-
children
|
|
169
|
-
)}
|
|
170
|
-
<ScrollRestoration nonce={nonce} />
|
|
171
|
-
<Scripts nonce={nonce} />
|
|
172
|
-
</body>
|
|
173
|
-
</html>
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
136
|
export default function App() {
|
|
178
137
|
return <Outlet />;
|
|
179
138
|
}
|
|
@@ -19,9 +19,10 @@ export const meta: MetaFunction = () => {
|
|
|
19
19
|
export async function loader({request, context}: LoaderFunctionArgs) {
|
|
20
20
|
const url = new URL(request.url);
|
|
21
21
|
const isPredictive = url.searchParams.has('predictive');
|
|
22
|
-
const searchPromise =
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const searchPromise: Promise<PredictiveSearchReturn | RegularSearchReturn> =
|
|
23
|
+
isPredictive
|
|
24
|
+
? predictiveSearch({request, context})
|
|
25
|
+
: regularSearch({request, context});
|
|
25
26
|
|
|
26
27
|
searchPromise.catch((error: Error) => {
|
|
27
28
|
console.error(error);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {flatRoutes} from '@remix-run/fs-routes';
|
|
2
|
+
import {layout, type RouteConfig} from '@remix-run/route-config';
|
|
3
|
+
import {hydrogenRoutes} from '@shopify/hydrogen';
|
|
4
|
+
|
|
5
|
+
export default hydrogenRoutes([
|
|
6
|
+
layout('./layout.tsx', (await flatRoutes())),
|
|
7
|
+
]) satisfies RouteConfig;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "skeleton",
|
|
3
3
|
"private": true,
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "2025.1.
|
|
5
|
+
"version": "2025.1.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "shopify hydrogen build --codegen",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
},
|
|
15
15
|
"prettier": "@shopify/prettier-config",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@remix-run/react": "^2.
|
|
18
|
-
"@remix-run/server-runtime": "^2.
|
|
19
|
-
"
|
|
20
|
-
"@shopify/
|
|
21
|
-
"
|
|
17
|
+
"@remix-run/react": "^2.16.1",
|
|
18
|
+
"@remix-run/server-runtime": "^2.16.1",
|
|
19
|
+
"graphql": "^16.10.0",
|
|
20
|
+
"@shopify/hydrogen": "2025.1.3",
|
|
21
|
+
"@shopify/remix-oxygen": "^2.0.12",
|
|
22
22
|
"graphql-tag": "^2.12.6",
|
|
23
|
-
"isbot": "^5.1.
|
|
23
|
+
"isbot": "^5.1.22",
|
|
24
24
|
"react": "^18.2.0",
|
|
25
25
|
"react-dom": "^18.2.0"
|
|
26
26
|
},
|
|
@@ -29,13 +29,16 @@
|
|
|
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.
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@shopify/
|
|
36
|
-
"@shopify/
|
|
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.77.0",
|
|
36
|
+
"@shopify/hydrogen-codegen": "^0.3.3",
|
|
37
|
+
"@shopify/mini-oxygen": "^3.1.2",
|
|
38
|
+
"@shopify/oxygen-workers-types": "^4.1.6",
|
|
37
39
|
"@shopify/prettier-config": "^1.1.2",
|
|
38
|
-
"@total-typescript/ts-reset": "^0.
|
|
40
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
41
|
+
"prettier": "^3.4.2",
|
|
39
42
|
"@types/eslint": "^9.6.1",
|
|
40
43
|
"@types/react": "^18.2.22",
|
|
41
44
|
"@types/react-dom": "^18.2.7",
|
|
@@ -51,9 +54,8 @@
|
|
|
51
54
|
"eslint-plugin-react": "^7.37.4",
|
|
52
55
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
53
56
|
"globals": "^15.14.0",
|
|
54
|
-
"prettier": "^2.8.4",
|
|
55
57
|
"typescript": "^5.2.2",
|
|
56
|
-
"vite": "^
|
|
58
|
+
"vite": "^6.2.0",
|
|
57
59
|
"vite-tsconfig-paths": "^4.3.1"
|
|
58
60
|
},
|
|
59
61
|
"engines": {
|
|
@@ -15,12 +15,13 @@ export default defineConfig({
|
|
|
15
15
|
hydrogen(),
|
|
16
16
|
oxygen(),
|
|
17
17
|
remix({
|
|
18
|
-
presets: [hydrogen.
|
|
18
|
+
presets: [hydrogen.v3preset()],
|
|
19
19
|
future: {
|
|
20
20
|
v3_fetcherPersist: true,
|
|
21
21
|
v3_relativeSplatPath: true,
|
|
22
22
|
v3_throwAbortReason: true,
|
|
23
23
|
v3_lazyRouteDiscovery: true,
|
|
24
|
+
v3_routeConfig: true,
|
|
24
25
|
v3_singleFetch: true,
|
|
25
26
|
},
|
|
26
27
|
}),
|
|
@@ -390,11 +390,8 @@ button:active.primary {
|
|
|
390
390
|
--gradient-color-end: transparent;
|
|
391
391
|
--background-color: transparent;
|
|
392
392
|
|
|
393
|
-
background-image:
|
|
394
|
-
|
|
395
|
-
var(--background-color),
|
|
396
|
-
var(--background-color)
|
|
397
|
-
),
|
|
393
|
+
background-image:
|
|
394
|
+
linear-gradient(to right, var(--background-color), var(--background-color)),
|
|
398
395
|
linear-gradient(to right, var(--background-color), var(--background-color)),
|
|
399
396
|
linear-gradient(
|
|
400
397
|
to right,
|
|
@@ -406,23 +403,43 @@ button:active.primary {
|
|
|
406
403
|
var(--gradient-color-start),
|
|
407
404
|
var(--gradient-color-end)
|
|
408
405
|
);
|
|
409
|
-
background-position:
|
|
406
|
+
background-position:
|
|
407
|
+
left center,
|
|
408
|
+
right center,
|
|
409
|
+
left center,
|
|
410
|
+
right center;
|
|
410
411
|
background-repeat: no-repeat;
|
|
411
412
|
background-color: var(--background-color);
|
|
412
|
-
background-size:
|
|
413
|
+
background-size:
|
|
414
|
+
20px 100%,
|
|
415
|
+
20px 100%,
|
|
416
|
+
0px 100%,
|
|
417
|
+
0px 100%;
|
|
413
418
|
background-attachment: local, local, scroll, scroll;
|
|
414
419
|
}
|
|
415
420
|
|
|
416
421
|
#tab-buttons-wrapper .fadCover.fadeLeft {
|
|
417
|
-
background-size:
|
|
422
|
+
background-size:
|
|
423
|
+
20px 100%,
|
|
424
|
+
20px 100%,
|
|
425
|
+
40px 100%,
|
|
426
|
+
0px 100%;
|
|
418
427
|
}
|
|
419
428
|
|
|
420
429
|
#tab-buttons-wrapper .fadCover.fadeRight {
|
|
421
|
-
background-size:
|
|
430
|
+
background-size:
|
|
431
|
+
20px 100%,
|
|
432
|
+
20px 100%,
|
|
433
|
+
0px 100%,
|
|
434
|
+
40px 100%;
|
|
422
435
|
}
|
|
423
436
|
|
|
424
437
|
#tab-buttons-wrapper .fadCover.fadeLeftRight {
|
|
425
|
-
background-size:
|
|
438
|
+
background-size:
|
|
439
|
+
20px 100%,
|
|
440
|
+
20px 100%,
|
|
441
|
+
40px 100%,
|
|
442
|
+
40px 100%;
|
|
426
443
|
}
|
|
427
444
|
|
|
428
445
|
.tabPanels .tabPanel {
|