@shopify/hydrogen 0.12.0 → 0.13.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 (256) hide show
  1. package/CHANGELOG.md +310 -26
  2. package/dist/esnext/client.d.ts +2 -0
  3. package/dist/esnext/client.js +2 -0
  4. package/dist/esnext/components/CartLineProvider/context.d.ts +10 -10
  5. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +1 -1
  6. package/dist/esnext/components/CartProvider/CartProvider.client.js +2 -1
  7. package/dist/esnext/components/CartProvider/cart-queries.d.ts +9 -0
  8. package/dist/esnext/components/CartProvider/cart-queries.js +876 -0
  9. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +1 -1
  10. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +1 -1
  11. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +1 -1
  12. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +1 -1
  13. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +1 -1
  14. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +1 -1
  15. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +1 -1
  16. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +1 -1
  17. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +1 -1
  18. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +1 -1
  19. package/dist/esnext/components/CartProvider/hooks.d.ts +1 -1
  20. package/dist/esnext/components/CartProvider/hooks.js +4 -1
  21. package/dist/esnext/components/CartProvider/types.d.ts +1 -1
  22. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +6 -5
  23. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +5 -2
  24. package/dist/esnext/components/Image/Image.d.ts +14 -12
  25. package/dist/esnext/components/Image/Image.js +17 -14
  26. package/dist/esnext/components/Link/Link.client.d.ts +4 -5
  27. package/dist/esnext/components/Link/Link.client.js +5 -4
  28. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +1 -3
  29. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +0 -1
  30. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +2 -2
  31. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +15 -4
  32. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +1 -8
  33. package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
  34. package/dist/esnext/components/LocalizationProvider/index.js +0 -1
  35. package/dist/esnext/components/MediaFile/MediaFile.d.ts +4 -3
  36. package/dist/esnext/components/Metafield/Metafield.client.d.ts +2 -2
  37. package/dist/esnext/components/Metafield/Metafield.client.js +8 -5
  38. package/dist/esnext/components/Metafield/types.d.ts +1 -1
  39. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +57 -56
  40. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +10 -4
  41. package/dist/esnext/components/Money/Money.client.d.ts +5 -4
  42. package/dist/esnext/components/Money/Money.client.js +1 -1
  43. package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +9 -4
  44. package/dist/esnext/components/ProductDescription/ProductDescription.client.js +4 -3
  45. package/dist/esnext/components/ProductMetafield/ProductMetafield.client.js +3 -3
  46. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +2 -2
  47. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +3 -2
  48. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +1 -0
  49. package/dist/esnext/components/ProductProvider/context.d.ts +23 -14
  50. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +3 -2
  51. package/dist/esnext/components/Seo/CollectionSeo.client.js +2 -2
  52. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +3 -2
  53. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +2 -2
  54. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +1 -1
  55. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +3 -2
  56. package/dist/esnext/components/Seo/ImageSeo.client.js +1 -1
  57. package/dist/esnext/components/Seo/PageSeo.client.d.ts +3 -2
  58. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +3 -3
  59. package/dist/esnext/components/Seo/ProductSeo.client.js +10 -5
  60. package/dist/esnext/components/Seo/Seo.client.d.ts +10 -7
  61. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +3 -4
  62. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +1 -1
  63. package/dist/esnext/components/Seo/seo-types.d.ts +17 -0
  64. package/dist/esnext/components/{ExternalVideo/ExternalVideoFragment.js → Seo/seo-types.js} +0 -0
  65. package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +7 -6
  66. package/dist/esnext/components/UnitPrice/UnitPrice.client.js +1 -1
  67. package/dist/esnext/components/Video/Video.d.ts +5 -4
  68. package/dist/esnext/components/Video/Video.js +10 -2
  69. package/dist/esnext/components/index.d.ts +0 -3
  70. package/dist/esnext/components/index.js +0 -3
  71. package/dist/esnext/entry-client.js +9 -4
  72. package/dist/esnext/entry-server.js +99 -87
  73. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  74. package/dist/esnext/foundation/{Router/FileRoutes.js → FileRoutes/FileRoutes.server.js} +20 -10
  75. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  76. package/dist/esnext/foundation/Redirect/Redirect.client.js +14 -0
  77. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  78. package/dist/esnext/foundation/Route/Route.server.js +33 -0
  79. package/dist/esnext/foundation/Router/{Router.d.ts → BrowserRouter.client.d.ts} +3 -2
  80. package/dist/esnext/foundation/Router/{Router.js → BrowserRouter.client.js} +7 -5
  81. package/dist/esnext/foundation/Router/Router.server.d.ts +5 -3
  82. package/dist/esnext/foundation/Router/Router.server.js +7 -22
  83. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +19 -24
  84. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +0 -1
  85. package/dist/esnext/foundation/ShopifyProvider/index.js +0 -1
  86. package/dist/esnext/foundation/index.d.ts +0 -1
  87. package/dist/esnext/foundation/index.js +0 -1
  88. package/dist/esnext/{hooks → foundation}/useNavigate/useNavigate.d.ts +6 -3
  89. package/dist/esnext/{hooks → foundation}/useNavigate/useNavigate.js +4 -1
  90. package/dist/esnext/foundation/useQuery/hooks.d.ts +2 -4
  91. package/dist/esnext/foundation/useQuery/hooks.js +5 -2
  92. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +9 -0
  93. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +7 -0
  94. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  95. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  96. package/dist/esnext/foundation/useUrl/useUrl.js +1 -1
  97. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.d.ts +6 -0
  98. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.js +5 -0
  99. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.d.ts +4 -1
  100. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +5 -0
  101. package/dist/esnext/framework/middleware.js +25 -3
  102. package/dist/esnext/framework/plugin.js +6 -1
  103. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  104. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +28 -0
  105. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +61 -75
  106. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +1 -1
  107. package/dist/esnext/hooks/index.d.ts +0 -1
  108. package/dist/esnext/hooks/index.js +0 -1
  109. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +10 -10
  110. package/dist/esnext/hooks/useCountry/useCountry.d.ts +4 -4
  111. package/dist/esnext/hooks/useMoney/hooks.d.ts +3 -3
  112. package/dist/esnext/hooks/useMoney/hooks.js +2 -2
  113. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +17 -2
  114. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.js +7 -3
  115. package/dist/esnext/hooks/useProduct/useProduct.d.ts +34 -96
  116. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -4
  117. package/dist/esnext/hooks/useProductOptions/helpers.js +13 -6
  118. package/dist/esnext/hooks/useProductOptions/types.d.ts +15 -35
  119. package/dist/esnext/hooks/useProductOptions/useProductOptions.d.ts +6 -5
  120. package/dist/esnext/hooks/useProductOptions/useProductOptions.js +13 -3
  121. package/dist/esnext/hooks/useShopQuery/hooks.js +47 -7
  122. package/dist/esnext/index.d.ts +7 -5
  123. package/dist/esnext/index.js +7 -5
  124. package/dist/esnext/platforms/worker-event.d.ts +0 -8
  125. package/dist/esnext/platforms/worker-event.js +2 -23
  126. package/dist/esnext/platforms/worker.d.ts +14 -0
  127. package/dist/esnext/platforms/worker.js +24 -0
  128. package/dist/esnext/{graphql/types/types.d.ts → storefront-api-types.d.ts} +389 -32
  129. package/dist/esnext/{graphql/types/types.js → storefront-api-types.js} +326 -30
  130. package/dist/esnext/streaming.server.d.ts +9 -5
  131. package/dist/esnext/streaming.server.js +2 -18
  132. package/dist/esnext/types.d.ts +1 -16
  133. package/dist/esnext/utilities/apiRoutes.d.ts +5 -1
  134. package/dist/esnext/utilities/apiRoutes.js +2 -3
  135. package/dist/esnext/utilities/devtools.d.ts +11 -0
  136. package/dist/esnext/utilities/devtools.js +11 -0
  137. package/dist/esnext/utilities/fetch.d.ts +7 -1
  138. package/dist/esnext/utilities/fetch.js +9 -10
  139. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +3 -2
  140. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +9 -2
  141. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  142. package/dist/esnext/utilities/graphql-tracker.js +119 -0
  143. package/dist/esnext/utilities/image_size.d.ts +5 -4
  144. package/dist/esnext/utilities/log/log-query-timeline.d.ts +1 -1
  145. package/dist/esnext/utilities/log/log-query-timeline.js +1 -2
  146. package/dist/esnext/utilities/log/log.d.ts +1 -0
  147. package/dist/esnext/utilities/log/utils.js +3 -0
  148. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +3 -2
  149. package/dist/esnext/version.d.ts +1 -1
  150. package/dist/esnext/version.js +1 -1
  151. package/dist/node/entry-server.js +104 -88
  152. package/dist/node/foundation/Redirect/Redirect.client.d.ts +5 -0
  153. package/dist/node/foundation/Redirect/Redirect.client.js +17 -0
  154. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +13 -0
  155. package/dist/node/foundation/Router/BrowserRouter.client.js +77 -0
  156. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +24 -25
  157. package/dist/node/foundation/ServerRequestProvider/index.js +5 -1
  158. package/dist/node/foundation/ServerStateProvider/ServerStateProvider.js +5 -1
  159. package/dist/node/foundation/ssr-interop.d.ts +29 -0
  160. package/dist/node/foundation/ssr-interop.js +39 -0
  161. package/dist/node/foundation/useNavigate/useNavigate.d.ts +13 -0
  162. package/dist/node/foundation/useNavigate/useNavigate.js +18 -0
  163. package/dist/node/foundation/useServerState/index.d.ts +1 -0
  164. package/dist/node/foundation/useServerState/index.js +5 -0
  165. package/dist/node/foundation/useServerState/use-server-state.d.ts +16 -0
  166. package/dist/node/foundation/useServerState/use-server-state.js +24 -0
  167. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +6 -0
  168. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +5 -0
  169. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +4 -1
  170. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +8 -0
  171. package/dist/node/framework/middleware.js +30 -4
  172. package/dist/node/framework/plugin.js +11 -2
  173. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  174. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +31 -0
  175. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +61 -75
  176. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +1 -1
  177. package/dist/node/{graphql/types/types.d.ts → storefront-api-types.d.ts} +389 -32
  178. package/dist/node/{graphql/types/types.js → storefront-api-types.js} +327 -31
  179. package/dist/node/streaming.server.d.ts +9 -5
  180. package/dist/node/streaming.server.js +2 -18
  181. package/dist/node/types.d.ts +1 -16
  182. package/dist/node/utilities/apiRoutes.d.ts +5 -1
  183. package/dist/node/utilities/apiRoutes.js +2 -3
  184. package/dist/node/utilities/fetch.d.ts +7 -1
  185. package/dist/node/utilities/fetch.js +9 -10
  186. package/dist/node/utilities/log/log-query-timeline.d.ts +1 -1
  187. package/dist/node/utilities/log/log-query-timeline.js +1 -2
  188. package/dist/node/utilities/log/log.d.ts +1 -0
  189. package/dist/node/utilities/log/utils.js +3 -0
  190. package/dist/node/utilities/web-api-polyfill.js +5 -1
  191. package/dist/node/version.d.ts +1 -1
  192. package/dist/node/version.js +1 -1
  193. package/package.json +9 -12
  194. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +43 -104
  195. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1566 -848
  196. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +36 -421
  197. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1523 -864
  198. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +35 -437
  199. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +507 -517
  200. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +10 -246
  201. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +16 -23
  202. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +47 -108
  203. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1033 -306
  204. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +965 -293
  205. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +98 -108
  206. package/vendor/react-server-dom-vite/package.json +0 -2
  207. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +0 -8
  208. package/dist/esnext/components/Image/ImageFragment.d.ts +0 -8
  209. package/dist/esnext/components/Image/ImageFragment.js +0 -1
  210. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +0 -36
  211. package/dist/esnext/components/MediaFile/MediaFileFragment.js +0 -1
  212. package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +0 -22
  213. package/dist/esnext/components/Metafield/MetafieldFragment.js +0 -1
  214. package/dist/esnext/components/ModelViewer/Model3DFragment.d.ts +0 -15
  215. package/dist/esnext/components/ModelViewer/Model3DFragment.js +0 -1
  216. package/dist/esnext/components/Money/MoneyFragment.d.ts +0 -8
  217. package/dist/esnext/components/Money/MoneyFragment.js +0 -1
  218. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +0 -247
  219. package/dist/esnext/components/ProductProvider/ProductProviderFragment.js +0 -1
  220. package/dist/esnext/components/ProductProvider/types.d.ts +0 -19
  221. package/dist/esnext/components/ProductProvider/types.js +0 -1
  222. package/dist/esnext/components/RawHtml/RawHtml.d.ts +0 -17
  223. package/dist/esnext/components/RawHtml/RawHtml.js +0 -21
  224. package/dist/esnext/components/RawHtml/index.d.ts +0 -1
  225. package/dist/esnext/components/RawHtml/index.js +0 -1
  226. package/dist/esnext/components/Seo/SeoFragment.d.ts +0 -66
  227. package/dist/esnext/components/Seo/SeoFragment.js +0 -1
  228. package/dist/esnext/components/Seo/types.d.ts +0 -15
  229. package/dist/esnext/components/Seo/types.js +0 -1
  230. package/dist/esnext/components/UnitPrice/UnitPriceFragment.d.ts +0 -15
  231. package/dist/esnext/components/UnitPrice/UnitPriceFragment.js +0 -1
  232. package/dist/esnext/components/Video/VideoFragment.d.ts +0 -15
  233. package/dist/esnext/components/Video/VideoFragment.js +0 -1
  234. package/dist/esnext/foundation/Router/FileRoutes.d.ts +0 -18
  235. package/dist/esnext/foundation/Router/Route.server.d.ts +0 -9
  236. package/dist/esnext/foundation/Router/Route.server.js +0 -6
  237. package/dist/esnext/foundation/Router/useParams.d.ts +0 -1
  238. package/dist/esnext/foundation/Router/useParams.js +0 -5
  239. package/dist/esnext/fragments.d.ts +0 -20
  240. package/dist/esnext/fragments.js +0 -10
  241. package/dist/esnext/graphql/graphql-constants.d.ts +0 -1756
  242. package/dist/esnext/graphql/graphql-constants.js +0 -3447
  243. package/dist/esnext/hooks/useAvailableCountries/index.d.ts +0 -1
  244. package/dist/esnext/hooks/useAvailableCountries/index.js +0 -1
  245. package/dist/esnext/hooks/useAvailableCountries/useAvailableCountries.d.ts +0 -11
  246. package/dist/esnext/hooks/useAvailableCountries/useAvailableCountries.js +0 -17
  247. package/dist/esnext/hooks/useNavigate/index.d.ts +0 -1
  248. package/dist/esnext/hooks/useNavigate/index.js +0 -1
  249. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.d.ts +0 -31
  250. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.js +0 -1
  251. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.d.ts +0 -46
  252. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.js +0 -1
  253. package/dist/esnext/hooks/useProductOptions/VariantFragment.d.ts +0 -106
  254. package/dist/esnext/hooks/useProductOptions/VariantFragment.js +0 -1
  255. package/fragments.d.ts +0 -1
  256. package/fragments.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,297 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#922](https://github.com/Shopify/hydrogen/pull/922) [`b5eaddc1`](https://github.com/Shopify/hydrogen/commit/b5eaddc113106ae946fd4b5273ff1485c74a2741) Thanks [@frehner](https://github.com/frehner)! - Fragments and their related types have been removed:
8
+
9
+ - ExternalVideoFragment and ExternalVideoFragmentFragment
10
+ - Model3DFragment and Model3DFragmentFragment
11
+ - ImageFragment and ImageFragmentFragment
12
+ - MoneyFragment and MoneyFragmentFragment
13
+ - UnitPriceFragment and UnitPriceFragmentFragment
14
+ - VideoFragment and VideoFragmentFragment
15
+ - MetafieldFragment and MetafieldFragmentFragment
16
+ - Seo fragments and types:
17
+ - DefaultPageSeoFragment and DefaultPageSeoFragmentFragment
18
+ - HomeSeoFragment and HomeSeoFragmentFragment
19
+ - ProductSeoFragment and ProductSeoFragmentFragment
20
+ - CollectionSeoFragment and CollectionSeoFragmentFragment
21
+ - PageSeoFragment and PageSeoFragmentFragment
22
+ - MediaFile fragments and types:
23
+ - MediaFileFragment and MediaFileFragmentFragment
24
+ - MediaFileFragment_ExternalVideo_Fragment
25
+ - MediaFileFragment_MediaImage_Fragment
26
+ - MediaFileFragment_Model3d_Fragment
27
+ - MediaFileFragment_Video_Fragment
28
+ - ProductFragment and ProductFragmentFragment
29
+
30
+ These fragments have been removed to reduce the chances of over-fetching (in other words, querying for fields you don't use) in your GraphQL queries. Please refer to the [Storefront API documentation](https://shopify.dev/api/storefront) for information and guides.
31
+
32
+ * [#912](https://github.com/Shopify/hydrogen/pull/912) [`de0e0d6a`](https://github.com/Shopify/hydrogen/commit/de0e0d6a6652463243ee09013cd30830ce2a246a) Thanks [@blittle](https://github.com/blittle)! - Change the country selector to lazy load available countries. The motivation to do so is that a _lot_ of countries come with the starter template. The problem is 1) the graphql query to fetch them all is relatively slow and 2) all of them get serialized to the browser in each RSC response.
33
+
34
+ This change removes `availableCountries` from the `LocalizationProvider`. As a result, the `useAvailableCountries` hook is also gone. Instead, the available countries are loaded on demand from an API route.
35
+
36
+ Migratation steps:
37
+
38
+ Create an API route to retrieve available countries:
39
+
40
+ ```jsx
41
+ export async function api(request, {queryShop}) {
42
+ const {
43
+ data: {
44
+ localization: {availableCountries},
45
+ },
46
+ } = await queryShop({
47
+ query: QUERY,
48
+ });
49
+
50
+ return availableCountries.sort((a, b) => a.name.localeCompare(b.name));
51
+ }
52
+
53
+ const QUERY = `
54
+ query Localization {
55
+ localization {
56
+ availableCountries {
57
+ isoCode
58
+ name
59
+ currency {
60
+ isoCode
61
+ }
62
+ }
63
+ }
64
+ }
65
+ `;
66
+ ```
67
+
68
+ Then within your client code, query the API route with a `useEffect` hook:
69
+
70
+ ```jsx
71
+ const [countries, setCountries] = useState([]);
72
+
73
+ useEffect(() => {
74
+ fetch('/api/countries')
75
+ .then((resp) => resp.json())
76
+ .then((c) => setCountries(c))
77
+ .catch((e) => setError(e))
78
+ .finally(() => setLoading(false));
79
+ }, []);
80
+ ```
81
+
82
+ See an example on how this could be done inside the Hydrogen Example Template [country selector](https://github.com/Shopify/hydrogen/blob/v1.x-2022-07/examples/template-hydrogen-default/src/components/CountrySelector.client.jsx)
83
+
84
+ - [#698](https://github.com/Shopify/hydrogen/pull/698) [`6f30b9a1`](https://github.com/Shopify/hydrogen/commit/6f30b9a1327f06d648a01dd94d539c7dcb3061e0) Thanks [@jplhomer](https://github.com/jplhomer)! - Basic end-to-end tests have been added to the default Hydrogen template. You can run tests in development:
85
+
86
+ ```bash
87
+ yarn test
88
+ ```
89
+
90
+ Or in continuous-integration (CI) environments:
91
+
92
+ ```bash
93
+ yarn test:ci
94
+ ```
95
+
96
+ * [#932](https://github.com/Shopify/hydrogen/pull/932) [`507c5cbf`](https://github.com/Shopify/hydrogen/commit/507c5cbf233a7f3ca05094e839656de227243299) Thanks [@jplhomer](https://github.com/jplhomer)! - Adds [CSS Modules](https://github.com/css-modules/css-modules) support. Hydrogen now includes a [Vite plugin](https://vitejs.dev/guide/features.html#css-modules) that collects styles for each CSS Module and exports them to a `StyleTag` component. To use CSS Modules in your Hydrogen app, you must render the style tag in the component along with your styles:
97
+
98
+ ```js
99
+ import * as styles from './styles.module.css';
100
+
101
+ export default MyComponent() {
102
+ return (
103
+ <div className={styles.wrapper}>
104
+ // A style is rendered inline
105
+ <styles.StyleTag />
106
+ <p>Hello</p>
107
+ </div>
108
+ );
109
+ }
110
+ ```
111
+
112
+ Explore an [example implementation of CSS Modules in GitHub](https://github.com/Shopify/hydrogen/tree/main/examples/css-modules).
113
+
114
+ - [#846](https://github.com/Shopify/hydrogen/pull/846) [`58c823b5`](https://github.com/Shopify/hydrogen/commit/58c823b5eb5c5c33caa25cae629409ce651b3991) Thanks [@blittle](https://github.com/blittle)! - ## New `<Route>` Component
115
+
116
+ The `<Route>` component is available for routes not defined by the file system. The `<Route>` component must be used within the `<Router>` component.
117
+
118
+ ```jsx
119
+ // app.server.jsx
120
+
121
+ function App({routes, ...serverProps}) {
122
+ return (
123
+ <Suspense fallback={<LoadingFallback />}>
124
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
125
+ <CartProvider>
126
+ <DefaultSeo />
127
+ <Router serverProps={serverProps}>
128
+ <Route path="/custom" page={<CustomRoute />} />
129
+ </Router>
130
+ </CartProvider>
131
+ </ShopifyProvider>
132
+ </Suspense>
133
+ );
134
+ }
135
+
136
+ function CustomRoute() {
137
+ return <h1>Custom route</h1>;
138
+ }
139
+ ```
140
+
141
+ `<Route>` accepts two props:
142
+
143
+ | Property | Type | Required | Description |
144
+ | -------- | --------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
145
+ | `path` | `string` | Yes | The URL path where the route exists. The path can contain variables. For example, `/products/:handle`. |
146
+ | `page` | `A rendered Server Component reference` | Yes | A reference to a React Server Component that's rendered when the route is active. |
147
+
148
+ ## Changes to `<Router>`
149
+
150
+ You can have multiple `<Route>` and `<FileRoutes>` components in your app. Hydrogen will only render one route for each request — whichever it finds first. This means the `<Router>` component no longer takes `fallback` as a prop. It also doesn't need `serverProps`. Instead, to render a 404 "Not Found" page, add `<Route path="*" page={<NotFound />} />` to your app. Make sure it's the last `<Route>` defined inside your app:
151
+
152
+ ```diff
153
+ function App({routes, ...serverProps}) {
154
+ return (
155
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
156
+ <CartProvider>
157
+ <DefaultSeo />
158
+ - <Router
159
+ - fallback={<NotFound response={serverProps.response} />}
160
+ - serverProps={serverProps}
161
+ - >
162
+ + <Router>
163
+ <FileRoutes routes={routes} />
164
+ + <Route path="*" page={<NotFound />} />
165
+ </Router>
166
+ </CartProvider>
167
+ </ShopifyProvider>
168
+ );
169
+ }
170
+ ```
171
+
172
+ ## Changes to `<FileRoutes>`
173
+
174
+ The `<FileRoutes>` component now accepts two additional optional props:
175
+
176
+ | Property | Type | Required | Default Value | Description |
177
+ | ----------- | -------- | -------- | ------------- | ----------------------------------------------------------------------- |
178
+ | `basePath` | `string` | No | `"/"` | A path that's prepended to all file routes. |
179
+ | `dirPrefix` | `string` | No | `"./routes"` | The portion of the file route path that shouldn't be a part of the URL. |
180
+
181
+ You need to modify `dirPrefix` if you want to import routes from a location other than `src/routes`.
182
+
183
+ You can modify `basePath` if you want to prefix all file routes. For example, you can prefix all file routes with a locale:
184
+
185
+ ```jsx
186
+ <Router>
187
+ <FileRoutes basePath={`/${locale}`} routes={routes} />
188
+ <Route path="*" page={<NotFound />} />
189
+ </Router>
190
+ ```
191
+
192
+ ## New `useRouteParams()` hook
193
+
194
+ You can use the `useRouteParams()` hook to retrieve the parameters of an active route. The hook is available in both server and client components:
195
+
196
+ ```jsx
197
+ // products/[handle].server.jsx
198
+
199
+ import {useRouteParams} from '@shopify/hydrogen';
200
+
201
+ export default function Product() {
202
+ const {handle} = useRouteParams();
203
+ // ...
204
+ }
205
+ ```
206
+
207
+ ```jsx
208
+ // ProductDetails.client.jsx
209
+ import {useRouteParams} from '@shopify/hydrogen/client';
210
+
211
+ export default function ProductDetails() {
212
+ const {handle} = useRouteParams();
213
+ // ...
214
+ }
215
+ ```
216
+
217
+ * [#842](https://github.com/Shopify/hydrogen/pull/842) [`626e58ee`](https://github.com/Shopify/hydrogen/commit/626e58eebe3cf994423895bbdf7754c009d701fe) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Removed the `Rawhtml` component.
218
+
219
+ Upgrade your project by replacing references to the `RawHtml` component to follow
220
+ [React's `dangerouslySetInnerHTML`](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml):
221
+
222
+ Change all `RawHtml` component
223
+
224
+ ```jsx
225
+ <RawHtml string="<p>Hello world</p>" />
226
+ ```
227
+
228
+ to jsx equivalent
229
+
230
+ ```jsx
231
+ <div dangerouslySetInnerHTML={{__html: '<p>Hello world</p>'}} />
232
+ ```
233
+
234
+ ### Patch Changes
235
+
236
+ - [#870](https://github.com/Shopify/hydrogen/pull/870) [`4c0fcd8f`](https://github.com/Shopify/hydrogen/commit/4c0fcd8f55a7956ab4641f12a5d9ebcb2587264c) Thanks [@frandiox](https://github.com/frandiox)! - Remove useQuery hook from client exports to avoid leaking server logic to the browser.
237
+
238
+ * [#950](https://github.com/Shopify/hydrogen/pull/950) [`d19fc36b`](https://github.com/Shopify/hydrogen/commit/d19fc36ba548d64a3548df435358ae5bea7cdf8e) Thanks [@frandiox](https://github.com/frandiox)! - Allow disabling minification in vite.config.js
239
+
240
+ - [#981](https://github.com/Shopify/hydrogen/pull/981) [`8dda8a86`](https://github.com/Shopify/hydrogen/commit/8dda8a860bc1cf58511756b6fff999fb7caa6081) Thanks [@michenly](https://github.com/michenly)! - Fix useUrl() when it is in RSC mode
241
+
242
+ * [#965](https://github.com/Shopify/hydrogen/pull/965) [`cdad13ed`](https://github.com/Shopify/hydrogen/commit/cdad13ed85ff17b84981367f39c7d2fe45e72dcf) Thanks [@blittle](https://github.com/blittle)! - Fix server redirects to work properly with RSC responses. For example, the redirect component within the starter template needs to change:
243
+
244
+ ```diff
245
+ export default function Redirect({response}) {
246
+ - response.redirect('/products/snowboard');
247
+ - return <div>This page is redirected</div>;
248
+ + return response.redirect('/products/snowboard');
249
+ }
250
+ ```
251
+
252
+ This server component is rendered two ways:
253
+
254
+ 1. When an app directly loads the redirect route, the server will render a 300 redirect with the proper location header.
255
+ 2. The app is already loaded, but the user navigates to the redirected route. We cannot 300 respond in this scenario, instead `response.redirect(...)` returns a component which will redirect on the client.
256
+
257
+ - [#904](https://github.com/Shopify/hydrogen/pull/904) [`1b46f8d0`](https://github.com/Shopify/hydrogen/commit/1b46f8d00ed5db9abaf0868574e252fa319a8ca9) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Log query key when provided in string
258
+
259
+ * [#758](https://github.com/Shopify/hydrogen/pull/758) [`0bee3af0`](https://github.com/Shopify/hydrogen/commit/0bee3af0373acad85dba38a630d3a81e52d6c134) Thanks [@frandiox](https://github.com/frandiox)! - Upgrade to React experimental version `0.0.0-experimental-2bf7c02f0-20220314`.
260
+
261
+ To upgrade your Hydrogen app, change the pinned version of `react` and `react-dom` in your `package.json` file to this version, or run:
262
+
263
+ ```bash
264
+ yarn add @shopify/hydrogen react@0.0.0-experimental-2bf7c02f0-20220314 react-dom@0.0.0-experimental-2bf7c02f0-20220314
265
+ ```
266
+
267
+ - [#895](https://github.com/Shopify/hydrogen/pull/895) [`1017b541`](https://github.com/Shopify/hydrogen/commit/1017b541c275c030f97ee6dee1e310df1fe89fb5) Thanks [@frandiox](https://github.com/frandiox)! - Improve error thrown in development when entry point fails on load.
268
+
269
+ * [#897](https://github.com/Shopify/hydrogen/pull/897) [`c01044e6`](https://github.com/Shopify/hydrogen/commit/c01044e6b4ebe74f8e2e310e78dbaa8178536016) Thanks [@blittle](https://github.com/blittle)! - Add new custom headers for storefront API calls. See Issue [#660](https://github.com/Shopify/hydrogen/issues/660)
270
+
271
+ - [#908](https://github.com/Shopify/hydrogen/pull/908) [`8f4cd100`](https://github.com/Shopify/hydrogen/commit/8f4cd1005ce9d78a1426223b6d4ad44c3cae2ebc) Thanks [@mcvinci](https://github.com/mcvinci)! - Hydrogen docs: Updates to align with latest release
272
+
273
+ * [#871](https://github.com/Shopify/hydrogen/pull/871) [`4cb07c73`](https://github.com/Shopify/hydrogen/commit/4cb07c7357cf05cc63f9d3c2834ac3c43e8859b5) Thanks [@scottdixon](https://github.com/scottdixon)! - Hydrogen docs: Update ProductProvider example query
274
+
275
+ - [#878](https://github.com/Shopify/hydrogen/pull/878) [`587aa3e6`](https://github.com/Shopify/hydrogen/commit/587aa3e6b7bee39f8f8a88685ef95ec9bb7c057b) Thanks [@frandiox](https://github.com/frandiox)! - Fix preloading queries in workers to prevent waterfall requests.
276
+
277
+ **Breaking change**: `fetchBuilder` no longer accepts a `Request` argument. Instead, it now accepts a `url: string` and `options: FetchInit`:
278
+
279
+ ```diff
280
+ -fetchBuilder(new Request('https://my.endpoint.com', {headers: {foo: 'bar'}}));
281
+ +fetchBuilder('https://my.endpoint.com', {headers: {foo: 'bar}});
282
+ ```
283
+
284
+ * [#923](https://github.com/Shopify/hydrogen/pull/923) [`993be985`](https://github.com/Shopify/hydrogen/commit/993be9856f32f282f14e5c893abfa0a69c5636a4) Thanks [@frandiox](https://github.com/frandiox)! - Provide a Logger option to use GraphQL and disable by default. Improve logging of unused query properties.
285
+
286
+ - [#960](https://github.com/Shopify/hydrogen/pull/960) [`2e8a5ea2`](https://github.com/Shopify/hydrogen/commit/2e8a5ea24c4d506b14ad3b5b9ed81147a879fc2e) Thanks [@mcvinci](https://github.com/mcvinci)! - Hydrogen docs: Add reference to robots.txt.server.js file
287
+
3
288
  ## 0.12.0
4
289
 
5
290
  ### Minor Changes
6
291
 
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.
292
+ - [`8271be8`](https://github.com/Shopify/hydrogen/commit/8271be83331c99f27a258e6532983da4fe4f0b5b) Thanks [@michenly](https://github.com/michenly)! - Export Seo components Fragement and use them in the starter template.
8
293
 
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`.
294
+ * [#827](https://github.com/Shopify/hydrogen/pull/827) [`745e8c0`](https://github.com/Shopify/hydrogen/commit/745e8c0a87a7c41803934565e5a756295ff629c2) Thanks [@michenly](https://github.com/michenly)! - Move any static `Fragment` properties on components to the entry point `@shopify/hydrogen/fragments`.
10
295
  The migration diff are as follows:
11
296
 
12
297
  ```diff
@@ -72,13 +357,13 @@
72
357
  + import type {VideoFragmentFragment} from '@shopify/hydrogen/fragments';
73
358
  ```
74
359
 
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.
360
+ - [#455](https://github.com/Shopify/hydrogen/pull/455) [`81ac653`](https://github.com/Shopify/hydrogen/commit/81ac6534b8464e187b09ee13525319ed0c6c7c1d) Thanks [@johncraigcole](https://github.com/johncraigcole)! - 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
361
 
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.
362
+ * [#809](https://github.com/Shopify/hydrogen/pull/809) [`47f23f9`](https://github.com/Shopify/hydrogen/commit/47f23f921873b782947aed2e54d997ad034801b8) Thanks [@frehner](https://github.com/frehner)! - Upgrade default Storefront API to version '2022-04'. Some components have been updated to use the 2022-04 features and types as well.
78
363
 
79
364
  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
365
 
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:
366
+ - [#780](https://github.com/Shopify/hydrogen/pull/780) [`122a5c5`](https://github.com/Shopify/hydrogen/commit/122a5c5e0b70fa2a11c2c708b303da987f25fc53) Thanks [@jplhomer](https://github.com/jplhomer)! - 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
367
 
83
368
  ```jsx
84
369
  // my-api.server.js
@@ -105,7 +390,7 @@
105
390
  +export default renderHydrogen(App, {shopifyConfig, routes});
106
391
  ```
107
392
 
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.
393
+ * [#712](https://github.com/Shopify/hydrogen/pull/712) [`6368968`](https://github.com/Shopify/hydrogen/commit/6368968e4c68bb44b01b6b0b6903e403269dc233) Thanks [@blittle](https://github.com/blittle)! - 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
394
 
110
395
  Follow these steps to upgrade your `App.server.jsx` file:
111
396
 
@@ -147,26 +432,26 @@
147
432
 
148
433
  ### Patch Changes
149
434
 
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.
435
+ - [#799](https://github.com/Shopify/hydrogen/pull/799) [`350293a`](https://github.com/Shopify/hydrogen/commit/350293a9fa113fa9950aad27cf7ccaa6b535bedb) Thanks [@michenly](https://github.com/michenly)! - Update `linesAdd` to create cart if cart does not exist.
151
436
 
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
437
+ * [#788](https://github.com/Shopify/hydrogen/pull/788) [`9d4c43d`](https://github.com/Shopify/hydrogen/commit/9d4c43d6cc4f0b52affc33274c438a356c95ad37) Thanks [@mcvinci](https://github.com/mcvinci)! - Hydrogen docs: Static assets and component props
153
438
 
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.
439
+ - [#813](https://github.com/Shopify/hydrogen/pull/813) [`b1b959c`](https://github.com/Shopify/hydrogen/commit/b1b959c45ae43d7078c655b4012b6d6cd2db6491) Thanks [@frandiox](https://github.com/frandiox)! - Do not scroll to top if the URL pathname has not changed.
155
440
 
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
441
+ * [#821](https://github.com/Shopify/hydrogen/pull/821) [`548979e`](https://github.com/Shopify/hydrogen/commit/548979ea7cbc38e52628d3359fd6c4edd19b41cc) Thanks [@jplhomer](https://github.com/jplhomer)! - Add null check for ShopifyProvider
157
442
 
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.
443
+ - [#850](https://github.com/Shopify/hydrogen/pull/850) [`74b14e4`](https://github.com/Shopify/hydrogen/commit/74b14e4a66c72125bc1b372c57f305a86a2e1fe4) Thanks [@blittle](https://github.com/blittle)! - Ignore when boomerang doesn't load. This often happens when a adblocker is present on the client.
159
444
  There is no longer an uncaught promise exception in the console.
160
445
 
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.
446
+ * [#803](https://github.com/Shopify/hydrogen/pull/803) [`7528bf4`](https://github.com/Shopify/hydrogen/commit/7528bf4956970d76f37452bd33f9c9a692187c4f) Thanks [@frandiox](https://github.com/frandiox)! - Avoid accessing undefined global \_\_flight as a side effect of another unknown error.
162
447
 
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.
448
+ - [#833](https://github.com/Shopify/hydrogen/pull/833) [`214927a`](https://github.com/Shopify/hydrogen/commit/214927a071b9350d1f70fa02c74227f1e5d77238) Thanks [@frandiox](https://github.com/frandiox)! - Disable worker streaming until it is properly supported.
164
449
 
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
450
+ * [#837](https://github.com/Shopify/hydrogen/pull/837) [`2e76d66`](https://github.com/Shopify/hydrogen/commit/2e76d66ac23d84c13cf9c60e0b7aacf9eddda9ce) Thanks [@jplhomer](https://github.com/jplhomer)! - Minify server build output
166
451
 
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
452
+ - [#819](https://github.com/Shopify/hydrogen/pull/819) [`09d9ad5`](https://github.com/Shopify/hydrogen/commit/09d9ad5d7b65942d9187c6b766bf4c60a6979453) Thanks [@jplhomer](https://github.com/jplhomer)! - Improve logging for useShopQuery errors
168
453
 
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
454
+ * [#825](https://github.com/Shopify/hydrogen/pull/825) [`1215fdb`](https://github.com/Shopify/hydrogen/commit/1215fdb02910190096c6920f533d06f00fc59a6c) Thanks [@michenly](https://github.com/michenly)! - `@shopify/hydrogen` will no longer export the following types
170
455
 
171
456
  - MediaFileProps
172
457
  - VideoProps
@@ -182,21 +467,21 @@
182
467
 
183
468
  Any Component props type should be typed instead with `React.ComponentProps<typeof MyComponent>`.
184
469
 
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.
470
+ - [#792](https://github.com/Shopify/hydrogen/pull/792) [`8aad0b5`](https://github.com/Shopify/hydrogen/commit/8aad0b561ddbef55abc598c91c6e9bd642c46d9c) Thanks [@frandiox](https://github.com/frandiox)! - Attributes from `<html>` and `<body>` elements in `index.html` are now included in the SSR response.
186
471
 
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.
472
+ * [#811](https://github.com/Shopify/hydrogen/pull/811) [`2226b6e`](https://github.com/Shopify/hydrogen/commit/2226b6eda30a29ad79fb89c600a210b615dc5406) Thanks [@frandiox](https://github.com/frandiox)! - Support non-PascalCase filenames for client components.
188
473
 
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
474
+ - [#786](https://github.com/Shopify/hydrogen/pull/786) [`d1ecaf7`](https://github.com/Shopify/hydrogen/commit/d1ecaf7efff4595da46b0ece08c3cd94c6cdd55f) Thanks [@frehner](https://github.com/frehner)! - Updated graphql-codegen, which updates the Typescript types available for each Storefront API object
190
475
 
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
476
+ * [#849](https://github.com/Shopify/hydrogen/pull/849) [`e64fa17`](https://github.com/Shopify/hydrogen/commit/e64fa17c61585a7dc967bef5a2216dde40b2fc42) Thanks [@blittle](https://github.com/blittle)! - Fix server the server to only log once for the full time it takes to stream render a page
192
477
 
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.
478
+ - [#394](https://github.com/Shopify/hydrogen/pull/394) [`818312d`](https://github.com/Shopify/hydrogen/commit/818312d72618882056d0344f069568e71766d32d) Thanks [@sahilmob](https://github.com/sahilmob)! - Respond with 404 if the route has no matches.
194
479
 
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.
480
+ * [#841](https://github.com/Shopify/hydrogen/pull/841) [`0aa74cf`](https://github.com/Shopify/hydrogen/commit/0aa74cf78dae555fc111c06df3d2b73b022af4f0) Thanks [@michenly](https://github.com/michenly)! - Update MediaFile's options prop type to included Image options.
196
481
 
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
482
+ - [#796](https://github.com/Shopify/hydrogen/pull/796) [`1dc62e2`](https://github.com/Shopify/hydrogen/commit/1dc62e2514b53411ae750d81c0a1b4f50eae9aff) Thanks [@mcvinci](https://github.com/mcvinci)! - Hydrogen docs: Strict mode
198
483
 
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.
484
+ * [#813](https://github.com/Shopify/hydrogen/pull/813) [`b1b959c`](https://github.com/Shopify/hydrogen/commit/b1b959c45ae43d7078c655b4012b6d6cd2db6491) Thanks [@frandiox](https://github.com/frandiox)! - Remove Router client-only logic from server bundle and avoid extra waterfall requests during Hydration.
200
485
  Extract part of the client bundle into separate modules that can be loaded in parallel.
201
486
 
202
487
  ## 0.11.1
@@ -207,7 +492,7 @@
207
492
 
208
493
  * [#761](https://github.com/Shopify/hydrogen/pull/761) [`1142647`](https://github.com/Shopify/hydrogen/commit/114264716bc8f3027e3e6395d523714adbc92014) Thanks [@frehner](https://github.com/frehner)! - Fix issue with components that take in the `as` prop not validating other props when a component is passed to `as`.
209
494
 
210
- - [#752](https://github.com/Shopify/hydrogen/pull/752) [`b96179f`](https://github.com/Shopify/hydrogen/commit/b96179fdf960da52332a981e29a742b677826834) Thanks [@jplhomer](https://github.com/jplhomer)! - Ensure ProductSeo knows how to handle `featuredImage = null`
495
+ - [#752](https://github.com/Shopify/hydrogen/pull/752) [`428aa7a`](https://github.com/Shopify/hydrogen/commit/428aa7adac179dd1efffc29bf382a7bb0a2c8971) Thanks [@michenly](https://github.com/michenly)! - Ensure ProductSeo knows how to handle `featuredImage = null`
211
496
 
212
497
  * [#774](https://github.com/Shopify/hydrogen/pull/774) [`052f148`](https://github.com/Shopify/hydrogen/commit/052f148e0d33029cdc2540afa5ead32825962f3a) Thanks [@frandiox](https://github.com/frandiox)! - Fix internal url usage in platforms like Vercel, which already provides protocol and host in `request.url`.
213
498
 
@@ -707,4 +992,3 @@ function SomeComponent() {
707
992
  [0.10.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.0
708
993
  [0.10.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.1
709
994
  [0.11.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.11.0
710
- [unreleased]: https://github.com/Shopify/hydrogen/compare/v0.11.0...HEAD
@@ -5,3 +5,5 @@ export * from './foundation/useShop';
5
5
  export * from './foundation/ServerStateProvider';
6
6
  export { Head } from './foundation/Head';
7
7
  export * from './utilities';
8
+ export { useRouteParams } from './foundation/useRouteParams/useRouteParams';
9
+ export { useNavigate } from './foundation/useNavigate/useNavigate';
@@ -5,3 +5,5 @@ export * from './foundation/useShop';
5
5
  export * from './foundation/ServerStateProvider';
6
6
  export { Head } from './foundation/Head';
7
7
  export * from './utilities';
8
+ export { useRouteParams } from './foundation/useRouteParams/useRouteParams';
9
+ export { useNavigate } from './foundation/useNavigate/useNavigate';
@@ -1,26 +1,26 @@
1
1
  export declare const CartLineContext: import("react").Context<({
2
2
  __typename?: "CartLine" | undefined;
3
- } & Pick<import("../../graphql/types/types").CartLine, "id" | "quantity"> & {
3
+ } & Pick<import("../../storefront-api-types").CartLine, "id" | "quantity"> & {
4
4
  attributes: ({
5
5
  __typename?: "Attribute" | undefined;
6
- } & Pick<import("../../graphql/types/types").Attribute, "key" | "value">)[];
6
+ } & Pick<import("../../storefront-api-types").Attribute, "key" | "value">)[];
7
7
  merchandise: {
8
8
  __typename?: "ProductVariant" | undefined;
9
- } & Pick<import("../../graphql/types/types").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
10
- compareAtPriceV2?: import("../../graphql/types/types").Maybe<{
9
+ } & Pick<import("../../storefront-api-types").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
10
+ compareAtPriceV2?: import("../../storefront-api-types").Maybe<{
11
11
  __typename?: "MoneyV2" | undefined;
12
- } & Pick<import("../../graphql/types/types").MoneyV2, "currencyCode" | "amount">> | undefined;
12
+ } & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">> | undefined;
13
13
  priceV2: {
14
14
  __typename?: "MoneyV2" | undefined;
15
- } & Pick<import("../../graphql/types/types").MoneyV2, "currencyCode" | "amount">;
16
- image?: import("../../graphql/types/types").Maybe<{
15
+ } & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">;
16
+ image?: import("../../storefront-api-types").Maybe<{
17
17
  __typename?: "Image" | undefined;
18
- } & Pick<import("../../graphql/types/types").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
18
+ } & Pick<import("../../storefront-api-types").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
19
19
  product: {
20
20
  __typename?: "Product" | undefined;
21
- } & Pick<import("../../graphql/types/types").Product, "title" | "handle">;
21
+ } & Pick<import("../../storefront-api-types").Product, "title" | "handle">;
22
22
  selectedOptions: ({
23
23
  __typename?: "SelectedOption" | undefined;
24
- } & Pick<import("../../graphql/types/types").SelectedOption, "name" | "value">)[];
24
+ } & Pick<import("../../storefront-api-types").SelectedOption, "name" | "value">)[];
25
25
  };
26
26
  }) | null>;
@@ -30,7 +30,7 @@ export declare function CartProvider({ children, numCartLines, onCreate, onLineA
30
30
  /** A callback that is invoked when the process to update the cart discount codes begins, but before the discount codes are updated in the Storefront API. */
31
31
  onDiscountCodesUpdate?: () => void;
32
32
  /**
33
- * A cart object from the Storefront API to populate the initial state of the provider.
33
+ * An object with fields that correspond to the Storefront API's [Cart object](/api/storefront/latest/objects/cart).
34
34
  */
35
35
  data?: CartFragmentFragment;
36
36
  }): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useCallback, useReducer, useMemo, useRef, } from 'react';
2
2
  import { flattenConnection } from '../../utilities';
3
- import { CartLineAdd, CartCreate, CartLineRemove, CartLineUpdate, CartNoteUpdate, CartBuyerIdentityUpdate, CartAttributesUpdate, CartDiscountCodesUpdate, CartQuery, } from '../../graphql/graphql-constants';
3
+ import { CartLineAdd, CartCreate, CartLineRemove, CartLineUpdate, CartNoteUpdate, CartBuyerIdentityUpdate, CartAttributesUpdate, CartDiscountCodesUpdate, CartQuery, } from './cart-queries';
4
4
  import { useCartFetch } from './hooks';
5
5
  import { CartContext } from './context';
6
6
  import { CART_ID_STORAGE_KEY } from './constants';
@@ -480,6 +480,7 @@ function cartFromGraphQL(cart) {
480
480
  var _a;
481
481
  return {
482
482
  ...cart,
483
+ // @ts-expect-error While the cart still uses fragments, there will be a TS error here until we remove those fragments and get the type in-line
483
484
  lines: flattenConnection(cart.lines),
484
485
  note: (_a = cart.note) !== null && _a !== void 0 ? _a : undefined,
485
486
  };
@@ -0,0 +1,9 @@
1
+ export declare const CartLineAdd = "\nmutation CartLineAdd($cartId: ID!, $lines: [CartLineInput!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
2
+ export declare const CartCreate = "\nmutation CartCreate($input: CartInput!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartCreate(input: $input) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
3
+ export declare const CartLineRemove = "\nmutation CartLineRemove($cartId: ID!, $lines: [ID!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartLinesRemove(cartId: $cartId, lineIds: $lines) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
4
+ export declare const CartLineUpdate = "\nmutation CartLineUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
5
+ export declare const CartNoteUpdate = "\nmutation CartNoteUpdate($cartId: ID!, $note: String, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
6
+ export declare const CartBuyerIdentityUpdate = "\nmutation CartBuyerIdentityUpdate(\n $cartId: ID!\n $buyerIdentity: CartBuyerIdentityInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n) @inContext(country: $country) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
7
+ export declare const CartAttributesUpdate = "\nmutation CartAttributesUpdate($attributes: [AttributeInput!]!, $cartId: ID!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
8
+ export declare const CartDiscountCodesUpdate = "\nmutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!], $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...CartFragment\n }\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
9
+ export declare const CartQuery = "\nquery CartQuery($id: ID!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cart(id: $id) {\n ...CartFragment\n }\n}\n\nfragment CartFragment on Cart {\n id\n checkoutUrl\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n estimatedCost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";