@shopify/hydrogen 0.11.1 → 0.12.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 (183) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +3 -4
  3. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +9 -22
  4. package/dist/esnext/components/AddToCartButton/index.d.ts +1 -1
  5. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +4 -5
  6. package/dist/esnext/components/BuyNowButton/index.d.ts +1 -1
  7. package/dist/esnext/components/BuyNowButton/index.js +1 -1
  8. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +2 -3
  9. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +3 -3
  10. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +5 -3
  11. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +5 -5
  12. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +1 -1
  13. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +1 -3
  14. package/dist/esnext/components/CartLineProvider/context.d.ts +0 -6
  15. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +1 -3
  16. package/dist/esnext/components/CartProvider/CartProvider.client.js +6 -1
  17. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +71 -4
  18. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +71 -4
  19. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +71 -4
  20. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +72 -5
  21. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +12 -10
  22. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +71 -4
  23. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +71 -4
  24. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +71 -4
  25. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +72 -5
  26. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +71 -4
  27. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +3 -2
  28. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +5 -11
  29. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +2 -5
  30. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +5 -1
  31. package/dist/esnext/components/ExternalVideo/index.d.ts +1 -1
  32. package/dist/esnext/components/ExternalVideo/index.js +1 -1
  33. package/dist/esnext/components/Image/Image.d.ts +5 -9
  34. package/dist/esnext/components/Image/Image.js +0 -3
  35. package/dist/esnext/components/Image/ImageFragment.d.ts +4 -0
  36. package/dist/esnext/components/Image/index.d.ts +1 -1
  37. package/dist/esnext/components/Image/index.js +1 -1
  38. package/dist/esnext/components/Link/Link.client.js +1 -1
  39. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +2 -3
  40. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +4 -0
  41. package/dist/esnext/components/MediaFile/MediaFile.d.ts +8 -20
  42. package/dist/esnext/components/MediaFile/MediaFile.js +7 -5
  43. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +22 -8
  44. package/dist/esnext/components/MediaFile/index.d.ts +1 -1
  45. package/dist/esnext/components/MediaFile/index.js +1 -1
  46. package/dist/esnext/components/Metafield/Metafield.client.d.ts +0 -4
  47. package/dist/esnext/components/Metafield/Metafield.client.js +0 -3
  48. package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +5 -2
  49. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +1 -3
  50. package/dist/esnext/components/Metafield/index.d.ts +1 -2
  51. package/dist/esnext/components/Metafield/index.js +1 -1
  52. package/dist/esnext/components/ModelViewer/Model3DFragment.d.ts +4 -0
  53. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +3 -12
  54. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +0 -3
  55. package/dist/esnext/components/ModelViewer/index.d.ts +1 -1
  56. package/dist/esnext/components/Money/Money.client.d.ts +5 -10
  57. package/dist/esnext/components/Money/Money.client.js +0 -3
  58. package/dist/esnext/components/Money/MoneyFragment.d.ts +4 -0
  59. package/dist/esnext/components/Money/index.d.ts +1 -1
  60. package/dist/esnext/components/Money/index.js +1 -1
  61. package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +3 -3
  62. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -5
  63. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +5 -6
  64. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +1 -4
  65. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +183 -16
  66. package/dist/esnext/components/ProductProvider/index.d.ts +1 -1
  67. package/dist/esnext/components/ProductProvider/index.js +1 -1
  68. package/dist/esnext/components/RawHtml/RawHtml.d.ts +1 -3
  69. package/dist/esnext/components/RawHtml/index.d.ts +1 -1
  70. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +2 -2
  71. package/dist/esnext/components/Seo/CollectionSeo.client.js +1 -1
  72. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +2 -2
  73. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +3 -3
  74. package/dist/esnext/components/Seo/DescriptionSeo.client.js +1 -1
  75. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +2 -2
  76. package/dist/esnext/components/Seo/ImageSeo.client.js +1 -1
  77. package/dist/esnext/components/Seo/PageSeo.client.d.ts +2 -2
  78. package/dist/esnext/components/Seo/PageSeo.client.js +2 -2
  79. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +5 -2
  80. package/dist/esnext/components/Seo/Seo.client.d.ts +8 -7
  81. package/dist/esnext/components/Seo/Seo.client.js +8 -14
  82. package/dist/esnext/components/Seo/SeoFragment.d.ts +66 -0
  83. package/dist/esnext/components/Seo/SeoFragment.js +1 -0
  84. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +2 -2
  85. package/dist/esnext/components/Seo/types.d.ts +8 -60
  86. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +2 -1
  87. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +1 -9
  88. package/dist/esnext/components/ShopPayButton/index.d.ts +1 -1
  89. package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +4 -10
  90. package/dist/esnext/components/UnitPrice/UnitPrice.client.js +8 -3
  91. package/dist/esnext/components/UnitPrice/UnitPriceFragment.d.ts +5 -2
  92. package/dist/esnext/components/UnitPrice/index.d.ts +1 -1
  93. package/dist/esnext/components/UnitPrice/index.js +1 -1
  94. package/dist/esnext/components/Video/Video.d.ts +5 -14
  95. package/dist/esnext/components/Video/Video.js +1 -4
  96. package/dist/esnext/components/Video/VideoFragment.d.ts +4 -0
  97. package/dist/esnext/components/Video/index.d.ts +1 -2
  98. package/dist/esnext/components/Video/index.js +1 -1
  99. package/dist/esnext/components/index.d.ts +3 -13
  100. package/dist/esnext/components/index.js +2 -2
  101. package/dist/esnext/entry-client.js +19 -5
  102. package/dist/esnext/entry-server.d.ts +1 -1
  103. package/dist/esnext/entry-server.js +27 -73
  104. package/dist/esnext/foundation/Boomerang/Boomerang.client.d.ts +3 -1
  105. package/dist/esnext/foundation/Boomerang/Boomerang.client.js +17 -3
  106. package/dist/esnext/foundation/Router/FileRoutes.d.ts +18 -0
  107. package/dist/esnext/foundation/Router/{DefaultRoutes.js → FileRoutes.js} +9 -18
  108. package/dist/esnext/foundation/Router/Route.server.d.ts +9 -0
  109. package/dist/esnext/foundation/Router/Route.server.js +6 -0
  110. package/dist/esnext/foundation/Router/{Router.client.d.ts → Router.d.ts} +0 -0
  111. package/dist/esnext/foundation/Router/{Router.client.js → Router.js} +4 -2
  112. package/dist/esnext/foundation/Router/Router.server.d.ts +8 -0
  113. package/dist/esnext/foundation/Router/Router.server.js +23 -0
  114. package/dist/esnext/foundation/Router/useParams.d.ts +1 -0
  115. package/dist/esnext/foundation/Router/useParams.js +5 -0
  116. package/dist/esnext/foundation/ServerStateProvider/{ServerStateProvider.client.d.ts → ServerStateProvider.d.ts} +0 -0
  117. package/dist/esnext/foundation/ServerStateProvider/{ServerStateProvider.client.js → ServerStateProvider.js} +0 -0
  118. package/dist/esnext/foundation/ServerStateProvider/index.d.ts +2 -2
  119. package/dist/esnext/foundation/ServerStateProvider/index.js +1 -1
  120. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +3 -0
  121. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +3 -0
  122. package/dist/esnext/foundation/index.d.ts +0 -1
  123. package/dist/esnext/foundation/index.js +0 -1
  124. package/dist/esnext/fragments.d.ts +20 -0
  125. package/dist/esnext/fragments.js +10 -0
  126. package/dist/esnext/framework/Hydration/Html.d.ts +2 -0
  127. package/dist/esnext/framework/Hydration/Html.js +71 -2
  128. package/dist/esnext/framework/Hydration/rsc.js +1 -1
  129. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +15 -17
  130. package/dist/esnext/graphql/graphql-constants.d.ts +11 -6
  131. package/dist/esnext/graphql/graphql-constants.js +89 -6
  132. package/dist/esnext/graphql/types/types.d.ts +1645 -1579
  133. package/dist/esnext/graphql/types/types.js +699 -702
  134. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +0 -8
  135. package/dist/esnext/hooks/useNavigate/useNavigate.js +1 -1
  136. package/dist/esnext/hooks/useProduct/useProduct.d.ts +7 -47
  137. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.d.ts +6 -3
  138. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.d.ts +28 -2
  139. package/dist/esnext/hooks/useProductOptions/VariantFragment.d.ts +57 -15
  140. package/dist/esnext/hooks/useShopQuery/hooks.js +16 -7
  141. package/dist/esnext/index.d.ts +4 -0
  142. package/dist/esnext/index.js +4 -0
  143. package/dist/esnext/streaming.server.d.ts +0 -1
  144. package/dist/esnext/streaming.server.js +0 -9
  145. package/dist/esnext/types.d.ts +2 -2
  146. package/dist/esnext/utilities/apiRoutes.d.ts +15 -3
  147. package/dist/esnext/utilities/apiRoutes.js +25 -4
  148. package/dist/esnext/utilities/fetch.js +0 -8
  149. package/dist/esnext/utilities/video_parameters.js +0 -4
  150. package/dist/esnext/version.d.ts +1 -1
  151. package/dist/esnext/version.js +1 -1
  152. package/dist/node/entry-server.d.ts +1 -1
  153. package/dist/node/entry-server.js +24 -70
  154. package/dist/node/foundation/ServerStateProvider/{ServerStateProvider.client.d.ts → ServerStateProvider.d.ts} +0 -0
  155. package/dist/node/foundation/ServerStateProvider/{ServerStateProvider.client.js → ServerStateProvider.js} +0 -0
  156. package/dist/node/foundation/ServerStateProvider/index.d.ts +2 -2
  157. package/dist/node/foundation/ServerStateProvider/index.js +3 -3
  158. package/dist/node/framework/Hydration/Html.d.ts +2 -0
  159. package/dist/node/framework/Hydration/Html.js +73 -3
  160. package/dist/node/framework/Hydration/rsc.js +1 -1
  161. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +15 -17
  162. package/dist/node/graphql/types/types.d.ts +1645 -1579
  163. package/dist/node/graphql/types/types.js +700 -703
  164. package/dist/node/streaming.server.d.ts +0 -1
  165. package/dist/node/streaming.server.js +1 -11
  166. package/dist/node/types.d.ts +2 -2
  167. package/dist/node/utilities/apiRoutes.d.ts +15 -3
  168. package/dist/node/utilities/apiRoutes.js +27 -6
  169. package/dist/node/utilities/fetch.d.ts +4 -0
  170. package/dist/node/utilities/fetch.js +40 -0
  171. package/dist/node/version.d.ts +1 -0
  172. package/dist/node/version.js +4 -0
  173. package/fragments.d.ts +1 -0
  174. package/fragments.js +1 -0
  175. package/package.json +15 -12
  176. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -3
  177. package/dist/esnext/components/Router/index.d.ts +0 -1
  178. package/dist/esnext/components/Router/index.js +0 -1
  179. package/dist/esnext/foundation/Boomerang/BoomerangPageTemplate.client.d.ts +0 -3
  180. package/dist/esnext/foundation/Boomerang/BoomerangPageTemplate.client.js +0 -14
  181. package/dist/esnext/foundation/Router/DefaultRoutes.d.ts +0 -22
  182. package/dist/esnext/foundation/Router/index.d.ts +0 -1
  183. package/dist/esnext/foundation/Router/index.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,204 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Export Seo components Fragement and use them in the starter template.
8
+
9
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Move any static `Fragment` properties on components to the entry point `@shopify/hydrogen/fragments`.
10
+ The migration diff are as follows:
11
+
12
+ ```diff
13
+ - import {ExternalVideoFragment} from '@shopify/hydrogen';
14
+ + import {ExternalVideoFragment} from '@shopify/hydrogen/fragments';
15
+ - import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen';
16
+ + import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen/fragments';
17
+ ```
18
+
19
+ ```diff
20
+ - import {ImageFragment} from '@shopify/hydrogen';
21
+ + import {ImageFragment} from '@shopify/hydrogen/fragments';
22
+ - import type {ImageFragmentFragment} from '@shopify/hydrogen';
23
+ + import type {ImageFragmentFragment} from '@shopify/hydrogen/fragments';
24
+ ```
25
+
26
+ ```diff
27
+ - import {MediaFileFragment} from '@shopify/hydrogen';
28
+ + import {MediaFileFragment} from '@shopify/hydrogen/fragments';
29
+ - import type {MediaFileFragmentFragment} from '@shopify/hydrogen';
30
+ + import type {MediaFileFragmentFragment} from '@shopify/hydrogen/fragments';
31
+ ```
32
+
33
+ ```diff
34
+ - import {MetafieldFragment} from '@shopify/hydrogen';
35
+ + import {MetafieldFragment} from '@shopify/hydrogen/fragments';
36
+ - import type {MetafieldFragmentFragment} from '@shopify/hydrogen';
37
+ + import type {MetafieldFragmentFragment} from '@shopify/hydrogen/fragments';
38
+ ```
39
+
40
+ ```diff
41
+ - import {Model3DFragment} from '@shopify/hydrogen';
42
+ + import {Model3DFragment} from '@shopify/hydrogen/fragments';
43
+ - import type {Model3DFragmentFragment} from '@shopify/hydrogen';
44
+ + import type {Model3DFragmentFragment} from '@shopify/hydrogen/fragments';
45
+ ```
46
+
47
+ ```diff
48
+ - import {MoneyFragment} from '@shopify/hydrogen';
49
+ + import {MoneyFragment} from '@shopify/hydrogen/fragments';
50
+ - import type {MoneyFragmentFragment} from '@shopify/hydrogen';
51
+ + import type {MoneyFragmentFragment} from '@shopify/hydrogen/fragments';
52
+ ```
53
+
54
+ ```diff
55
+ - import {ProductProviderFragment} from '@shopify/hydrogen';
56
+ + import {ProductProviderFragment} from '@shopify/hydrogen/fragments';
57
+ - import type {ProductProviderFragmentFragment} from '@shopify/hydrogen';
58
+ + import type {ProductProviderFragmentFragment} from '@shopify/hydrogen/fragments';
59
+ ```
60
+
61
+ ```diff
62
+ - import {UnitPriceFragment} from '@shopify/hydrogen';
63
+ + import {UnitPriceFragment} from '@shopify/hydrogen/fragments';
64
+ - import type {UnitPriceFragmentFragment} from '@shopify/hydrogen';
65
+ + import type {UnitPriceFragmentFragment} from '@shopify/hydrogen/fragments';
66
+ ```
67
+
68
+ ```diff
69
+ - import {VideoFragment} from '@shopify/hydrogen';
70
+ + import {VideoFragment} from '@shopify/hydrogen/fragments';
71
+ - import type {VideoFragmentFragment} from '@shopify/hydrogen';
72
+ + import type {VideoFragmentFragment} from '@shopify/hydrogen/fragments';
73
+ ```
74
+
75
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Updated the ExternalVideo component to use the new `embedUrl` Storefront API ([introduced in 2022-04](https://shopify.dev/api/release-notes/2022-04#non-encoded-object-ids-in-the-graphql-storefront-api)) on ExternalVideo.
76
+
77
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Upgrade default Storefront API to version '2022-04'. Some components have been updated to use the 2022-04 features and types as well.
78
+
79
+ One important change is that the `2022-04` Storefront API no longer encodes object IDs: see more [details here](https://shopify.dev/api/release-notes/2022-04#non-encoded-object-ids-in-the-graphql-storefront-api). Because of this, Hydrogen will no longer decode IDs, either, which will cause issues if you are using a previous version of the Storefront API with Hydrogen components.
80
+
81
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Adds `queryShop` helper to API routes. This makes it easy to query the Storefront API, similar to how `useShopQuery` is available in server components:
82
+
83
+ ```jsx
84
+ // my-api.server.js
85
+
86
+ export default function api(request, {queryShop}) {
87
+ return await queryShop({
88
+ query: `query ShopName { shop { name } }`,
89
+ });
90
+ }
91
+ ```
92
+
93
+ `queryShop` accepts a single argument object with the following properties:
94
+
95
+ | Property | Type | Required |
96
+ | ----------- | -------------------------------------- | -------- |
97
+ | `query` | `string \| ASTNode` | Yes |
98
+ | `variables` | `Record<string, any>` | No |
99
+ | `locale` | `string` (defaults to `defaultLocale`) | No |
100
+
101
+ **Important**: In order to use `queryShop`, you should pass `shopifyConfig` to `renderHydrogen` inside `App.server.jsx`:
102
+
103
+ ```diff
104
+ -export default renderHydrogen(App, {routes});
105
+ +export default renderHydrogen(App, {shopifyConfig, routes});
106
+ ```
107
+
108
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Routing in Hydrogen has been updated according to [Custom Routes proposal](https://github.com/Shopify/hydrogen/discussions/569). Specifically, a new `Router` component has been added, and `DefaultRoutes` has been renamed to `FileRoutes`, along with other minor changes. Custom route components are not implemented yet.
109
+
110
+ Follow these steps to upgrade your `App.server.jsx` file:
111
+
112
+ 1. Rename the parameter `pages` to `routes` when calling `renderHydrogen`.
113
+ 2. Rename the `DefaultRoutes` component to `FileRoutes`.
114
+ 3. Add the new `Router` component as a parent of `FileRoutes` and pass `fallback` and `serverProps` props (previously in `DefaultRoutes`).
115
+ 4. Rename `src/pages` directory to `src/routes` and update the glob import in `App.server.jsx` to `import.meta.globEager('./routes/**/*.server.[jt](s|sx)')`.
116
+
117
+ #### Full example of `App.server.jsx`
118
+
119
+ ```jsx
120
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
121
+ import {Router, FileRoutes, ShopifyProvider} from '@shopify/hydrogen';
122
+ import {Suspense} from 'react';
123
+ import shopifyConfig from '../shopify.config';
124
+ import DefaultSeo from './components/DefaultSeo.server';
125
+ import NotFound from './components/NotFound.server';
126
+ import LoadingFallback from './components/LoadingFallback';
127
+ import CartProvider from './components/CartProvider.client';
128
+
129
+ function App({routes, ...serverProps}) {
130
+ return (
131
+ <Suspense fallback={<LoadingFallback />}>
132
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
133
+ <CartProvider>
134
+ <DefaultSeo />
135
+ <Router fallback={<NotFound />} serverProps={serverProps}>
136
+ <FileRoutes routes={routes} />
137
+ </Router>
138
+ </CartProvider>
139
+ </ShopifyProvider>
140
+ </Suspense>
141
+ );
142
+ }
143
+
144
+ const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
145
+ export default renderHydrogen(App, {shopifyConfig, routes});
146
+ ```
147
+
148
+ ### Patch Changes
149
+
150
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Update `linesAdd` to create cart if cart does not exist.
151
+
152
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Hydrogen docs: Static assets and component props
153
+
154
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Do not scroll to top if the URL pathname has not changed.
155
+
156
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Add null check for ShopifyProvider
157
+
158
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Ignore when boomerang doesn't load. This often happens when a adblocker is present on the client.
159
+ There is no longer an uncaught promise exception in the console.
160
+
161
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Avoid accessing undefined global \_\_flight as a side effect of another unknown error.
162
+
163
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Disable worker streaming until it is properly supported.
164
+
165
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Minify server build output
166
+
167
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Improve logging for useShopQuery errors
168
+
169
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - `@shopify/hydrogen` will no longer export the following types
170
+
171
+ - MediaFileProps
172
+ - VideoProps
173
+ - ImageProps
174
+ - ExternalVideoProps
175
+ - RawHtmlProps
176
+ - AddToCartButtonProps
177
+ - ModelViewerProps
178
+ - MoneyProps
179
+ - BuyNowButtonProps
180
+ - BuyNowButtonPropsWeControl
181
+ - ShopPayButtonProps
182
+
183
+ Any Component props type should be typed instead with `React.ComponentProps<typeof MyComponent>`.
184
+
185
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Attributes from `<html>` and `<body>` elements in `index.html` are now included in the SSR response.
186
+
187
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Support non-PascalCase filenames for client components.
188
+
189
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Updated graphql-codegen, which updates the Typescript types available for each Storefront API object
190
+
191
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Fix server the server to only log once for the full time it takes to stream render a page
192
+
193
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Respond with 404 if the route has no matches.
194
+
195
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Update MediaFile's options prop type to included Image options.
196
+
197
+ - [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Hydrogen docs: Strict mode
198
+
199
+ * [#858](https://github.com/Shopify/hydrogen/pull/858) [`eae3490`](https://github.com/Shopify/hydrogen/commit/eae3490bf630c92243e9e6820100d673e22ec421) Thanks [@michenly](https://github.com/michenly)! - Remove Router client-only logic from server bundle and avoid extra waterfall requests during Hydration.
200
+ Extract part of the client bundle into separate modules that can be loaded in parallel.
201
+
3
202
  ## 0.11.1
4
203
 
5
204
  ### Patch Changes
@@ -1,6 +1,5 @@
1
- import React, { ReactNode } from 'react';
2
- import { Props } from '../types';
3
- export interface AddToCartButtonProps {
1
+ import { ReactNode } from 'react';
2
+ interface AddToCartButtonProps {
4
3
  /** An array of cart line attributes that belong to the item being added to the cart. */
5
4
  attributes?: {
6
5
  key: string;
@@ -20,5 +19,5 @@ declare type PropsWeControl = 'onClick';
20
19
  * The `AddToCartButton` component renders a button that adds an item to the cart when pressed.
21
20
  * It must be a descendent of the `CartProvider` component.
22
21
  */
23
- export declare function AddToCartButton<TTag extends React.ElementType = 'button'>(props: Props<TTag, PropsWeControl> & AddToCartButtonProps): JSX.Element;
22
+ export declare function AddToCartButton(props: Omit<JSX.IntrinsicElements['button'], PropsWeControl> & AddToCartButtonProps): JSX.Element;
24
23
  export {};
@@ -8,8 +8,8 @@ import { useProduct } from '../ProductProvider';
8
8
  export function AddToCartButton(props) {
9
9
  var _a, _b;
10
10
  const [addingItem, setAddingItem] = useState(false);
11
- const { variantId: explicitVariantId, quantity = 1, attributes, children, onAdd, accessibleAddingToCartLabel, ...passthroughProps } = props;
12
- const { status, id, cartCreate, linesAdd } = useCart();
11
+ const { variantId: explicitVariantId, quantity = 1, attributes, children, accessibleAddingToCartLabel, ...passthroughProps } = props;
12
+ const { status, linesAdd } = useCart();
13
13
  const product = useProduct();
14
14
  const variantId = (_b = explicitVariantId !== null && explicitVariantId !== void 0 ? explicitVariantId : (_a = product === null || product === void 0 ? void 0 : product.selectedVariant) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
15
15
  const disabled = explicitVariantId === null ||
@@ -25,26 +25,13 @@ export function AddToCartButton(props) {
25
25
  return (React.createElement(React.Fragment, null,
26
26
  React.createElement("button", { ...passthroughProps, disabled: disabled, onClick: () => {
27
27
  setAddingItem(true);
28
- if (!id) {
29
- cartCreate({
30
- lines: [
31
- {
32
- quantity: quantity,
33
- merchandiseId: variantId,
34
- attributes: attributes,
35
- },
36
- ],
37
- });
38
- }
39
- else {
40
- linesAdd([
41
- {
42
- quantity: quantity,
43
- merchandiseId: variantId,
44
- attributes: attributes,
45
- },
46
- ]);
47
- }
28
+ linesAdd([
29
+ {
30
+ quantity: quantity,
31
+ merchandiseId: variantId,
32
+ attributes: attributes,
33
+ },
34
+ ]);
48
35
  } }, children),
49
36
  accessibleAddingToCartLabel ? (React.createElement("p", { style: {
50
37
  position: 'absolute',
@@ -1 +1 @@
1
- export { AddToCartButton, AddToCartButtonProps } from './AddToCartButton.client';
1
+ export { AddToCartButton } from './AddToCartButton.client';
@@ -1,7 +1,5 @@
1
- import { ElementType } from 'react';
2
1
  import type { ReactNode } from 'react';
3
- import { Props } from '../types';
4
- export interface BuyNowButtonProps {
2
+ interface BuyNowButtonProps {
5
3
  /** The item quantity. Defaults to 1. */
6
4
  quantity?: number;
7
5
  /** The ID of the variant. */
@@ -14,6 +12,7 @@ export interface BuyNowButtonProps {
14
12
  /** Any `ReactNode` elements. */
15
13
  children: ReactNode;
16
14
  }
17
- export declare type BuyNowButtonPropsWeControl = 'onClick';
15
+ declare type PropsWeControl = 'onClick';
18
16
  /** The `BuyNowButton` component renders a button that adds an item to the cart and redirects the customer to checkout. */
19
- export declare function BuyNowButton<TTag extends ElementType = 'button'>(props: Props<TTag, BuyNowButtonPropsWeControl> & BuyNowButtonProps): JSX.Element;
17
+ export declare function BuyNowButton(props: Omit<JSX.IntrinsicElements['button'], PropsWeControl> & BuyNowButtonProps): JSX.Element;
18
+ export {};
@@ -1 +1 @@
1
- export { BuyNowButton, BuyNowButtonProps, BuyNowButtonPropsWeControl, } from './BuyNowButton.client';
1
+ export { BuyNowButton } from './BuyNowButton.client';
@@ -1 +1 @@
1
- export { BuyNowButton, } from './BuyNowButton.client';
1
+ export { BuyNowButton } from './BuyNowButton.client';
@@ -1,11 +1,10 @@
1
- import React, { ReactNode } from 'react';
2
- import { Props } from '../types';
1
+ import { ReactNode } from 'react';
3
2
  declare type PropsWeControl = 'onClick';
4
3
  /**
5
4
  * The `CartCheckoutButton` component renders a button that redirects to the checkout URL for the cart.
6
5
  * It must be a descendent of a `CartProvider` component.
7
6
  */
8
- export declare function CartCheckoutButton<TTag extends React.ElementType = 'a'>(props: Props<TTag, PropsWeControl> & {
7
+ export declare function CartCheckoutButton(props: Omit<JSX.IntrinsicElements['button'], PropsWeControl> & {
9
8
  /** A `ReactNode` element. */
10
9
  children: ReactNode;
11
10
  }): JSX.Element;
@@ -1,5 +1,5 @@
1
- import React, { ElementType } from 'react';
2
- import { Props } from '../types';
1
+ import React from 'react';
2
+ import { Money } from '../Money';
3
3
  export interface CartEstimatedCostProps {
4
4
  /** A string type that defines the type of cost needed. Valid values: `total`, `subtotal`, `tax`, or `duty`. */
5
5
  amountType?: 'total' | 'subtotal' | 'tax' | 'duty';
@@ -11,4 +11,4 @@ export interface CartEstimatedCostProps {
11
11
  * cost associated with the `amountType` prop. If no `amountType` prop is specified, then it defaults to `totalAmount`.
12
12
  * If `children` is a function, then it will pass down the render props provided by the parent component.
13
13
  */
14
- export declare function CartEstimatedCost<TTag extends ElementType>(props: Props<TTag> & CartEstimatedCostProps): JSX.Element | null;
14
+ export declare function CartEstimatedCost<TTag extends keyof JSX.IntrinsicElements>(props: Omit<React.ComponentProps<typeof Money>, 'data'> & CartEstimatedCostProps): JSX.Element | null;
@@ -1,10 +1,12 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../types';
1
+ import React from 'react';
2
+ import { Image } from '../Image';
3
3
  import { ImageSizeOptions } from '../../utilities';
4
+ declare type PropsWeControl = 'data' | 'options';
4
5
  /**
5
6
  * The `CartLineImage` component renders an `Image` component for the cart line merchandise's image.
6
7
  * It must be a descendent of a `CartLineProvider` component.
7
8
  */
8
- export declare function CartLineImage<TTag extends ElementType = 'img'>(props: Props<TTag> & {
9
+ export declare function CartLineImage(props: Omit<React.ComponentProps<typeof Image>, PropsWeControl> & {
9
10
  options?: ImageSizeOptions;
10
11
  }): JSX.Element | null;
12
+ export {};
@@ -1,7 +1,6 @@
1
- import { ElementType } from 'react';
2
- import { MoneyProps } from '../Money';
3
- import { Props } from '../types';
4
- export interface CartLinePriceProps<TTag> extends Omit<MoneyProps<TTag>, 'data'> {
1
+ import React from 'react';
2
+ import { Money } from '../Money';
3
+ interface CartLinePriceProps {
5
4
  /** The type of price. Valid values:`regular` (default) or `compareAt`. */
6
5
  priceType?: 'regular' | 'compareAt';
7
6
  }
@@ -9,4 +8,5 @@ export interface CartLinePriceProps<TTag> extends Omit<MoneyProps<TTag>, 'data'>
9
8
  * The `CartLinePrice` component renders a `Money` component for the cart line merchandise's price or
10
9
  * compare at price. It must be a descendent of a `CartLineProvider` component.
11
10
  */
12
- export declare function CartLinePrice<TTag extends ElementType>(props: Props<TTag> & CartLinePriceProps<TTag>): JSX.Element | null;
11
+ export declare function CartLinePrice<TTag extends keyof JSX.IntrinsicElements>(props: Omit<React.ComponentProps<typeof Money>, 'data'> & CartLinePriceProps): JSX.Element | null;
12
+ export {};
@@ -15,7 +15,7 @@ export function CartLinePrice(props) {
15
15
  return null;
16
16
  }
17
17
  return (React.createElement(Money, { ...passthroughProps, data: {
18
- amount: price.amount * cartLine.quantity,
18
+ amount: `${parseFloat(price.amount) * cartLine.quantity}`,
19
19
  currencyCode: price.currencyCode,
20
20
  } }));
21
21
  }
@@ -1,10 +1,8 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../types';
3
1
  /**
4
2
  * The `CartLineProductTitle` component renders a `span` element (or the type of HTML element specified by
5
3
  * the `as` prop) with the cart line merchandise's title. It must be a descendent of a `CartLineProvider` component.
6
4
  */
7
- export declare function CartLineProductTitle<TTag extends ElementType>(props: Props<TTag> & {
5
+ export declare function CartLineProductTitle<TTag extends keyof JSX.IntrinsicElements = 'span'>(props: JSX.IntrinsicElements[TTag] & {
8
6
  /** An HTML tag to be rendered as the base element wrapper. The default is `span`. */
9
7
  as?: TTag;
10
8
  }): JSX.Element;
@@ -9,18 +9,12 @@ export declare const CartLineContext: import("react").Context<({
9
9
  } & Pick<import("../../graphql/types/types").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
10
10
  compareAtPriceV2?: import("../../graphql/types/types").Maybe<{
11
11
  __typename?: "MoneyV2" | undefined;
12
- } & {
13
- __typename?: "MoneyV2" | undefined;
14
12
  } & Pick<import("../../graphql/types/types").MoneyV2, "currencyCode" | "amount">> | undefined;
15
13
  priceV2: {
16
14
  __typename?: "MoneyV2" | undefined;
17
- } & {
18
- __typename?: "MoneyV2" | undefined;
19
15
  } & Pick<import("../../graphql/types/types").MoneyV2, "currencyCode" | "amount">;
20
16
  image?: import("../../graphql/types/types").Maybe<{
21
17
  __typename?: "Image" | undefined;
22
- } & {
23
- __typename?: "Image" | undefined;
24
18
  } & Pick<import("../../graphql/types/types").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
25
19
  product: {
26
20
  __typename?: "Product" | undefined;
@@ -1,10 +1,8 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../types';
3
1
  /**
4
2
  * The `CartLineQuantity` component renders a `span` element (or the type of HTML element
5
3
  * specified by the `as` prop) with the cart line's quantity. It must be a descendent of a `CartLineProvider` component.
6
4
  */
7
- export declare function CartLineQuantity<TTag extends ElementType>(props: Props<TTag> & {
5
+ export declare function CartLineQuantity<TTag extends keyof JSX.IntrinsicElements = 'span'>(props: JSX.IntrinsicElements[TTag] & {
8
6
  /** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
9
7
  as?: TTag;
10
8
  }): JSX.Element;
@@ -436,7 +436,12 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
436
436
  : 0,
437
437
  cartCreate,
438
438
  linesAdd(lines) {
439
- addLineItem(lines, state);
439
+ if ('cart' in state && state.cart.id) {
440
+ addLineItem(lines, state);
441
+ }
442
+ else {
443
+ cartCreate({ lines });
444
+ }
440
445
  },
441
446
  linesRemove(lines) {
442
447
  removeLineItem(lines, state);
@@ -1,10 +1,13 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../../graphql/types/types';
2
- import { CartFragmentFragment } from './CartFragment';
3
6
  export declare type CartAttributesUpdateMutationVariables = Types.Exact<{
4
7
  attributes: Array<Types.AttributeInput> | Types.AttributeInput;
5
8
  cartId: Types.Scalars['ID'];
6
- numCartLines?: Types.Maybe<Types.Scalars['Int']>;
7
- country?: Types.Maybe<Types.CountryCode>;
9
+ numCartLines?: Types.InputMaybe<Types.Scalars['Int']>;
10
+ country?: Types.InputMaybe<Types.CountryCode>;
8
11
  }>;
9
12
  export declare type CartAttributesUpdateMutation = {
10
13
  __typename?: 'Mutation';
@@ -14,6 +17,70 @@ export declare type CartAttributesUpdateMutation = {
14
17
  } & {
15
18
  cart?: Types.Maybe<{
16
19
  __typename?: 'Cart';
17
- } & CartFragmentFragment>;
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
21
+ buyerIdentity: {
22
+ __typename?: 'CartBuyerIdentity';
23
+ } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
24
+ customer?: Types.Maybe<{
25
+ __typename?: 'Customer';
26
+ } & Pick<Types.Customer, 'id' | 'email' | 'firstName' | 'lastName' | 'displayName'>>;
27
+ };
28
+ lines: {
29
+ __typename?: 'CartLineConnection';
30
+ } & {
31
+ edges: Array<{
32
+ __typename?: 'CartLineEdge';
33
+ } & {
34
+ node: {
35
+ __typename?: 'CartLine';
36
+ } & Pick<Types.CartLine, 'id' | 'quantity'> & {
37
+ attributes: Array<{
38
+ __typename?: 'Attribute';
39
+ } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ merchandise: {
41
+ __typename?: 'ProductVariant';
42
+ } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
43
+ compareAtPriceV2?: Types.Maybe<{
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
46
+ priceV2: {
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
49
+ image?: Types.Maybe<{
50
+ __typename?: 'Image';
51
+ } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
52
+ product: {
53
+ __typename?: 'Product';
54
+ } & Pick<Types.Product, 'handle' | 'title'>;
55
+ selectedOptions: Array<{
56
+ __typename?: 'SelectedOption';
57
+ } & Pick<Types.SelectedOption, 'name' | 'value'>>;
58
+ };
59
+ };
60
+ }>;
61
+ };
62
+ estimatedCost: {
63
+ __typename?: 'CartEstimatedCost';
64
+ } & {
65
+ subtotalAmount: {
66
+ __typename?: 'MoneyV2';
67
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
68
+ totalAmount: {
69
+ __typename?: 'MoneyV2';
70
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
71
+ totalDutyAmount?: Types.Maybe<{
72
+ __typename?: 'MoneyV2';
73
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
74
+ totalTaxAmount?: Types.Maybe<{
75
+ __typename?: 'MoneyV2';
76
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
77
+ };
78
+ attributes: Array<{
79
+ __typename?: 'Attribute';
80
+ } & Pick<Types.Attribute, 'key' | 'value'>>;
81
+ discountCodes: Array<{
82
+ __typename?: 'CartDiscountCode';
83
+ } & Pick<Types.CartDiscountCode, 'code' | 'applicable'>>;
84
+ }>;
18
85
  }>;
19
86
  };
@@ -1,10 +1,13 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../../graphql/types/types';
2
- import { CartFragmentFragment } from './CartFragment';
3
6
  export declare type CartBuyerIdentityUpdateMutationVariables = Types.Exact<{
4
7
  cartId: Types.Scalars['ID'];
5
8
  buyerIdentity: Types.CartBuyerIdentityInput;
6
- numCartLines?: Types.Maybe<Types.Scalars['Int']>;
7
- country?: Types.Maybe<Types.CountryCode>;
9
+ numCartLines?: Types.InputMaybe<Types.Scalars['Int']>;
10
+ country?: Types.InputMaybe<Types.CountryCode>;
8
11
  }>;
9
12
  export declare type CartBuyerIdentityUpdateMutation = {
10
13
  __typename?: 'Mutation';
@@ -14,6 +17,70 @@ export declare type CartBuyerIdentityUpdateMutation = {
14
17
  } & {
15
18
  cart?: Types.Maybe<{
16
19
  __typename?: 'Cart';
17
- } & CartFragmentFragment>;
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
21
+ buyerIdentity: {
22
+ __typename?: 'CartBuyerIdentity';
23
+ } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
24
+ customer?: Types.Maybe<{
25
+ __typename?: 'Customer';
26
+ } & Pick<Types.Customer, 'id' | 'email' | 'firstName' | 'lastName' | 'displayName'>>;
27
+ };
28
+ lines: {
29
+ __typename?: 'CartLineConnection';
30
+ } & {
31
+ edges: Array<{
32
+ __typename?: 'CartLineEdge';
33
+ } & {
34
+ node: {
35
+ __typename?: 'CartLine';
36
+ } & Pick<Types.CartLine, 'id' | 'quantity'> & {
37
+ attributes: Array<{
38
+ __typename?: 'Attribute';
39
+ } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ merchandise: {
41
+ __typename?: 'ProductVariant';
42
+ } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
43
+ compareAtPriceV2?: Types.Maybe<{
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
46
+ priceV2: {
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
49
+ image?: Types.Maybe<{
50
+ __typename?: 'Image';
51
+ } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
52
+ product: {
53
+ __typename?: 'Product';
54
+ } & Pick<Types.Product, 'handle' | 'title'>;
55
+ selectedOptions: Array<{
56
+ __typename?: 'SelectedOption';
57
+ } & Pick<Types.SelectedOption, 'name' | 'value'>>;
58
+ };
59
+ };
60
+ }>;
61
+ };
62
+ estimatedCost: {
63
+ __typename?: 'CartEstimatedCost';
64
+ } & {
65
+ subtotalAmount: {
66
+ __typename?: 'MoneyV2';
67
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
68
+ totalAmount: {
69
+ __typename?: 'MoneyV2';
70
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
71
+ totalDutyAmount?: Types.Maybe<{
72
+ __typename?: 'MoneyV2';
73
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
74
+ totalTaxAmount?: Types.Maybe<{
75
+ __typename?: 'MoneyV2';
76
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
77
+ };
78
+ attributes: Array<{
79
+ __typename?: 'Attribute';
80
+ } & Pick<Types.Attribute, 'key' | 'value'>>;
81
+ discountCodes: Array<{
82
+ __typename?: 'CartDiscountCode';
83
+ } & Pick<Types.CartDiscountCode, 'code' | 'applicable'>>;
84
+ }>;
18
85
  }>;
19
86
  };