@shopify/hydrogen 0.12.0 → 0.13.2

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 (264) hide show
  1. package/CHANGELOG.md +331 -27
  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.d.ts +1 -0
  73. package/dist/esnext/entry-server.js +101 -88
  74. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  75. package/dist/esnext/foundation/{Router/FileRoutes.js → FileRoutes/FileRoutes.server.js} +20 -10
  76. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  77. package/dist/esnext/foundation/Redirect/Redirect.client.js +14 -0
  78. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  79. package/dist/esnext/foundation/Route/Route.server.js +33 -0
  80. package/dist/esnext/foundation/Router/{Router.d.ts → BrowserRouter.client.d.ts} +3 -2
  81. package/dist/esnext/foundation/Router/{Router.js → BrowserRouter.client.js} +7 -5
  82. package/dist/esnext/foundation/Router/Router.server.d.ts +5 -3
  83. package/dist/esnext/foundation/Router/Router.server.js +7 -22
  84. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +19 -24
  85. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +0 -1
  86. package/dist/esnext/foundation/ShopifyProvider/index.js +0 -1
  87. package/dist/esnext/foundation/index.d.ts +0 -1
  88. package/dist/esnext/foundation/index.js +0 -1
  89. package/dist/esnext/{hooks → foundation}/useNavigate/useNavigate.d.ts +6 -3
  90. package/dist/esnext/{hooks → foundation}/useNavigate/useNavigate.js +4 -1
  91. package/dist/esnext/foundation/useQuery/hooks.d.ts +5 -4
  92. package/dist/esnext/foundation/useQuery/hooks.js +13 -4
  93. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +9 -0
  94. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +7 -0
  95. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  96. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  97. package/dist/esnext/foundation/useUrl/useUrl.js +1 -1
  98. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.d.ts +13 -0
  99. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.js +28 -7
  100. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.d.ts +4 -1
  101. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +5 -0
  102. package/dist/esnext/framework/cache/in-memory.d.ts +1 -0
  103. package/dist/esnext/framework/cache/in-memory.js +15 -5
  104. package/dist/esnext/framework/middleware.js +25 -3
  105. package/dist/esnext/framework/plugin.js +6 -1
  106. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  107. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +28 -0
  108. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +61 -75
  109. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +1 -1
  110. package/dist/esnext/hooks/index.d.ts +0 -1
  111. package/dist/esnext/hooks/index.js +0 -1
  112. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +10 -10
  113. package/dist/esnext/hooks/useCountry/useCountry.d.ts +4 -4
  114. package/dist/esnext/hooks/useMoney/hooks.d.ts +3 -3
  115. package/dist/esnext/hooks/useMoney/hooks.js +2 -2
  116. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +17 -2
  117. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.js +7 -3
  118. package/dist/esnext/hooks/useProduct/useProduct.d.ts +34 -96
  119. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -4
  120. package/dist/esnext/hooks/useProductOptions/helpers.js +13 -6
  121. package/dist/esnext/hooks/useProductOptions/types.d.ts +15 -35
  122. package/dist/esnext/hooks/useProductOptions/useProductOptions.d.ts +6 -5
  123. package/dist/esnext/hooks/useProductOptions/useProductOptions.js +13 -3
  124. package/dist/esnext/hooks/useShopQuery/hooks.js +68 -15
  125. package/dist/esnext/index.d.ts +7 -5
  126. package/dist/esnext/index.js +7 -5
  127. package/dist/esnext/platforms/node.d.ts +2 -3
  128. package/dist/esnext/platforms/node.js +5 -3
  129. package/dist/esnext/platforms/worker-event.d.ts +0 -8
  130. package/dist/esnext/platforms/worker-event.js +2 -23
  131. package/dist/esnext/platforms/worker.d.ts +14 -0
  132. package/dist/esnext/platforms/worker.js +25 -0
  133. package/dist/esnext/{graphql/types/types.d.ts → storefront-api-types.d.ts} +389 -32
  134. package/dist/esnext/{graphql/types/types.js → storefront-api-types.js} +326 -30
  135. package/dist/esnext/streaming.server.d.ts +9 -5
  136. package/dist/esnext/streaming.server.js +2 -18
  137. package/dist/esnext/types.d.ts +1 -16
  138. package/dist/esnext/utilities/apiRoutes.d.ts +5 -1
  139. package/dist/esnext/utilities/apiRoutes.js +5 -4
  140. package/dist/esnext/utilities/devtools.d.ts +11 -0
  141. package/dist/esnext/utilities/devtools.js +11 -0
  142. package/dist/esnext/utilities/fetch.d.ts +7 -1
  143. package/dist/esnext/utilities/fetch.js +9 -10
  144. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +3 -2
  145. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +6 -2
  146. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  147. package/dist/esnext/utilities/graphql-tracker.js +119 -0
  148. package/dist/esnext/utilities/image_size.d.ts +5 -4
  149. package/dist/esnext/utilities/log/log-query-timeline.d.ts +1 -1
  150. package/dist/esnext/utilities/log/log-query-timeline.js +1 -2
  151. package/dist/esnext/utilities/log/log.d.ts +1 -0
  152. package/dist/esnext/utilities/log/utils.js +3 -0
  153. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +3 -2
  154. package/dist/esnext/version.d.ts +1 -1
  155. package/dist/esnext/version.js +1 -1
  156. package/dist/node/entry-server.d.ts +1 -0
  157. package/dist/node/entry-server.js +106 -89
  158. package/dist/node/foundation/Redirect/Redirect.client.d.ts +5 -0
  159. package/dist/node/foundation/Redirect/Redirect.client.js +17 -0
  160. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +13 -0
  161. package/dist/node/foundation/Router/BrowserRouter.client.js +77 -0
  162. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +24 -25
  163. package/dist/node/foundation/ServerRequestProvider/index.js +5 -1
  164. package/dist/node/foundation/ServerStateProvider/ServerStateProvider.js +5 -1
  165. package/dist/node/foundation/ssr-interop.d.ts +29 -0
  166. package/dist/node/foundation/ssr-interop.js +39 -0
  167. package/dist/node/foundation/useNavigate/useNavigate.d.ts +13 -0
  168. package/dist/node/foundation/useNavigate/useNavigate.js +18 -0
  169. package/dist/node/foundation/useServerState/index.d.ts +1 -0
  170. package/dist/node/foundation/useServerState/index.js +5 -0
  171. package/dist/node/foundation/useServerState/use-server-state.d.ts +16 -0
  172. package/dist/node/foundation/useServerState/use-server-state.js +24 -0
  173. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +13 -0
  174. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +28 -7
  175. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +4 -1
  176. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +8 -0
  177. package/dist/node/framework/cache/in-memory.d.ts +1 -0
  178. package/dist/node/framework/cache/in-memory.js +15 -5
  179. package/dist/node/framework/middleware.js +30 -4
  180. package/dist/node/framework/plugin.js +11 -2
  181. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  182. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +31 -0
  183. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +61 -75
  184. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +1 -1
  185. package/dist/node/{graphql/types/types.d.ts → storefront-api-types.d.ts} +389 -32
  186. package/dist/node/{graphql/types/types.js → storefront-api-types.js} +327 -31
  187. package/dist/node/streaming.server.d.ts +9 -5
  188. package/dist/node/streaming.server.js +2 -18
  189. package/dist/node/types.d.ts +1 -16
  190. package/dist/node/utilities/apiRoutes.d.ts +5 -1
  191. package/dist/node/utilities/apiRoutes.js +5 -4
  192. package/dist/node/utilities/fetch.d.ts +7 -1
  193. package/dist/node/utilities/fetch.js +9 -10
  194. package/dist/node/utilities/log/log-query-timeline.d.ts +1 -1
  195. package/dist/node/utilities/log/log-query-timeline.js +1 -2
  196. package/dist/node/utilities/log/log.d.ts +1 -0
  197. package/dist/node/utilities/log/utils.js +3 -0
  198. package/dist/node/utilities/web-api-polyfill.js +5 -1
  199. package/dist/node/version.d.ts +1 -1
  200. package/dist/node/version.js +1 -1
  201. package/package.json +9 -12
  202. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +43 -104
  203. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1566 -848
  204. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +36 -421
  205. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1523 -864
  206. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +35 -437
  207. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +507 -517
  208. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +10 -246
  209. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +16 -23
  210. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +47 -108
  211. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1033 -306
  212. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +965 -293
  213. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +98 -108
  214. package/vendor/react-server-dom-vite/package.json +0 -2
  215. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +0 -8
  216. package/dist/esnext/components/Image/ImageFragment.d.ts +0 -8
  217. package/dist/esnext/components/Image/ImageFragment.js +0 -1
  218. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +0 -36
  219. package/dist/esnext/components/MediaFile/MediaFileFragment.js +0 -1
  220. package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +0 -22
  221. package/dist/esnext/components/Metafield/MetafieldFragment.js +0 -1
  222. package/dist/esnext/components/ModelViewer/Model3DFragment.d.ts +0 -15
  223. package/dist/esnext/components/ModelViewer/Model3DFragment.js +0 -1
  224. package/dist/esnext/components/Money/MoneyFragment.d.ts +0 -8
  225. package/dist/esnext/components/Money/MoneyFragment.js +0 -1
  226. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +0 -247
  227. package/dist/esnext/components/ProductProvider/ProductProviderFragment.js +0 -1
  228. package/dist/esnext/components/ProductProvider/types.d.ts +0 -19
  229. package/dist/esnext/components/ProductProvider/types.js +0 -1
  230. package/dist/esnext/components/RawHtml/RawHtml.d.ts +0 -17
  231. package/dist/esnext/components/RawHtml/RawHtml.js +0 -21
  232. package/dist/esnext/components/RawHtml/index.d.ts +0 -1
  233. package/dist/esnext/components/RawHtml/index.js +0 -1
  234. package/dist/esnext/components/Seo/SeoFragment.d.ts +0 -66
  235. package/dist/esnext/components/Seo/SeoFragment.js +0 -1
  236. package/dist/esnext/components/Seo/types.d.ts +0 -15
  237. package/dist/esnext/components/Seo/types.js +0 -1
  238. package/dist/esnext/components/UnitPrice/UnitPriceFragment.d.ts +0 -15
  239. package/dist/esnext/components/UnitPrice/UnitPriceFragment.js +0 -1
  240. package/dist/esnext/components/Video/VideoFragment.d.ts +0 -15
  241. package/dist/esnext/components/Video/VideoFragment.js +0 -1
  242. package/dist/esnext/foundation/Router/FileRoutes.d.ts +0 -18
  243. package/dist/esnext/foundation/Router/Route.server.d.ts +0 -9
  244. package/dist/esnext/foundation/Router/Route.server.js +0 -6
  245. package/dist/esnext/foundation/Router/useParams.d.ts +0 -1
  246. package/dist/esnext/foundation/Router/useParams.js +0 -5
  247. package/dist/esnext/fragments.d.ts +0 -20
  248. package/dist/esnext/fragments.js +0 -10
  249. package/dist/esnext/graphql/graphql-constants.d.ts +0 -1756
  250. package/dist/esnext/graphql/graphql-constants.js +0 -3447
  251. package/dist/esnext/hooks/useAvailableCountries/index.d.ts +0 -1
  252. package/dist/esnext/hooks/useAvailableCountries/index.js +0 -1
  253. package/dist/esnext/hooks/useAvailableCountries/useAvailableCountries.d.ts +0 -11
  254. package/dist/esnext/hooks/useAvailableCountries/useAvailableCountries.js +0 -17
  255. package/dist/esnext/hooks/useNavigate/index.d.ts +0 -1
  256. package/dist/esnext/hooks/useNavigate/index.js +0 -1
  257. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.d.ts +0 -31
  258. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.js +0 -1
  259. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.d.ts +0 -46
  260. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.js +0 -1
  261. package/dist/esnext/hooks/useProductOptions/VariantFragment.d.ts +0 -106
  262. package/dist/esnext/hooks/useProductOptions/VariantFragment.js +0 -1
  263. package/fragments.d.ts +0 -1
  264. package/fragments.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,317 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1013](https://github.com/Shopify/hydrogen/pull/1013) [`94dc94ae`](https://github.com/Shopify/hydrogen/commit/94dc94aeb9dfd5e0120cab610203fdb4f0c61d3c) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix CORS issue in StackBlitz
8
+
9
+ ## 0.13.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1008](https://github.com/Shopify/hydrogen/pull/1008) [`ca1de82b`](https://github.com/Shopify/hydrogen/commit/ca1de82bc38c1c02caa451fb52065da499555e6f) Thanks [@frandiox](https://github.com/frandiox)! - Allow passing `cache` parameter to `createServer` in Node entry.
14
+
15
+ * [#997](https://github.com/Shopify/hydrogen/pull/997) [`fffdc08f`](https://github.com/Shopify/hydrogen/commit/fffdc08f87f71592352a2eb67a63e80704054db2) Thanks [@frandiox](https://github.com/frandiox)! - Allow empty array values in flattenConnection utility.
16
+
17
+ - [#1007](https://github.com/Shopify/hydrogen/pull/1007) [`7cfca7b0`](https://github.com/Shopify/hydrogen/commit/7cfca7b09289e028a463ababb51e69b4e3943d94) Thanks [@scottdixon](https://github.com/scottdixon)! - Fix API index routes https://github.com/Shopify/hydrogen/issues/562
18
+
19
+ * [#1000](https://github.com/Shopify/hydrogen/pull/1000) [`6d0d5068`](https://github.com/Shopify/hydrogen/commit/6d0d50686029c3d66d9dc0ceb0b5f71456c7b19e) Thanks [@frandiox](https://github.com/frandiox)! - Do not cache Storefront API responses that contain GraphQL errors.
20
+
21
+ - [#1003](https://github.com/Shopify/hydrogen/pull/1003) [`d8a9c929`](https://github.com/Shopify/hydrogen/commit/d8a9c9290aaf7c9d058b2c08567294822bea5396) Thanks [@jplhomer](https://github.com/jplhomer)! - Update useShopQuery to accept a custom Storefront API secret token, and forward the Buyer IP.
22
+
23
+ ## 0.13.0
24
+
25
+ ### Minor Changes
26
+
27
+ - [#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:
28
+
29
+ - ExternalVideoFragment and ExternalVideoFragmentFragment
30
+ - Model3DFragment and Model3DFragmentFragment
31
+ - ImageFragment and ImageFragmentFragment
32
+ - MoneyFragment and MoneyFragmentFragment
33
+ - UnitPriceFragment and UnitPriceFragmentFragment
34
+ - VideoFragment and VideoFragmentFragment
35
+ - MetafieldFragment and MetafieldFragmentFragment
36
+ - Seo fragments and types:
37
+ - DefaultPageSeoFragment and DefaultPageSeoFragmentFragment
38
+ - HomeSeoFragment and HomeSeoFragmentFragment
39
+ - ProductSeoFragment and ProductSeoFragmentFragment
40
+ - CollectionSeoFragment and CollectionSeoFragmentFragment
41
+ - PageSeoFragment and PageSeoFragmentFragment
42
+ - MediaFile fragments and types:
43
+ - MediaFileFragment and MediaFileFragmentFragment
44
+ - MediaFileFragment_ExternalVideo_Fragment
45
+ - MediaFileFragment_MediaImage_Fragment
46
+ - MediaFileFragment_Model3d_Fragment
47
+ - MediaFileFragment_Video_Fragment
48
+ - ProductFragment and ProductFragmentFragment
49
+
50
+ 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.
51
+
52
+ * [#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 Demo Store 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.
53
+
54
+ 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.
55
+
56
+ Migratation steps:
57
+
58
+ Create an API route to retrieve available countries:
59
+
60
+ ```jsx
61
+ export async function api(request, {queryShop}) {
62
+ const {
63
+ data: {
64
+ localization: {availableCountries},
65
+ },
66
+ } = await queryShop({
67
+ query: QUERY,
68
+ });
69
+
70
+ return availableCountries.sort((a, b) => a.name.localeCompare(b.name));
71
+ }
72
+
73
+ const QUERY = `
74
+ query Localization {
75
+ localization {
76
+ availableCountries {
77
+ isoCode
78
+ name
79
+ currency {
80
+ isoCode
81
+ }
82
+ }
83
+ }
84
+ }
85
+ `;
86
+ ```
87
+
88
+ Then within your client code, query the API route with a `useEffect` hook:
89
+
90
+ ```jsx
91
+ const [countries, setCountries] = useState([]);
92
+
93
+ useEffect(() => {
94
+ fetch('/api/countries')
95
+ .then((resp) => resp.json())
96
+ .then((c) => setCountries(c))
97
+ .catch((e) => setError(e))
98
+ .finally(() => setLoading(false));
99
+ }, []);
100
+ ```
101
+
102
+ See an example on how this could be done inside the Demo Store template [country selector](https://github.com/Shopify/hydrogen/blob/v1.x-2022-07/examples/template-hydrogen-default/src/components/CountrySelector.client.jsx)
103
+
104
+ - [#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:
105
+
106
+ ```bash
107
+ yarn test
108
+ ```
109
+
110
+ Or in continuous-integration (CI) environments:
111
+
112
+ ```bash
113
+ yarn test:ci
114
+ ```
115
+
116
+ * [#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:
117
+
118
+ ```js
119
+ import * as styles from './styles.module.css';
120
+
121
+ export default MyComponent() {
122
+ return (
123
+ <div className={styles.wrapper}>
124
+ // A style is rendered inline
125
+ <styles.StyleTag />
126
+ <p>Hello</p>
127
+ </div>
128
+ );
129
+ }
130
+ ```
131
+
132
+ Explore an [example implementation of CSS Modules in GitHub](https://github.com/Shopify/hydrogen/tree/main/examples/css-modules).
133
+
134
+ - [#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
135
+
136
+ The `<Route>` component is available for routes not defined by the file system. The `<Route>` component must be used within the `<Router>` component.
137
+
138
+ ```jsx
139
+ // app.server.jsx
140
+
141
+ function App({routes, ...serverProps}) {
142
+ return (
143
+ <Suspense fallback={<LoadingFallback />}>
144
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
145
+ <CartProvider>
146
+ <DefaultSeo />
147
+ <Router serverProps={serverProps}>
148
+ <Route path="/custom" page={<CustomRoute />} />
149
+ </Router>
150
+ </CartProvider>
151
+ </ShopifyProvider>
152
+ </Suspense>
153
+ );
154
+ }
155
+
156
+ function CustomRoute() {
157
+ return <h1>Custom route</h1>;
158
+ }
159
+ ```
160
+
161
+ `<Route>` accepts two props:
162
+
163
+ | Property | Type | Required | Description |
164
+ | -------- | --------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
165
+ | `path` | `string` | Yes | The URL path where the route exists. The path can contain variables. For example, `/products/:handle`. |
166
+ | `page` | `A rendered Server Component reference` | Yes | A reference to a React Server Component that's rendered when the route is active. |
167
+
168
+ ## Changes to `<Router>`
169
+
170
+ 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:
171
+
172
+ ```diff
173
+ function App({routes, ...serverProps}) {
174
+ return (
175
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
176
+ <CartProvider>
177
+ <DefaultSeo />
178
+ - <Router
179
+ - fallback={<NotFound response={serverProps.response} />}
180
+ - serverProps={serverProps}
181
+ - >
182
+ + <Router>
183
+ <FileRoutes routes={routes} />
184
+ + <Route path="*" page={<NotFound />} />
185
+ </Router>
186
+ </CartProvider>
187
+ </ShopifyProvider>
188
+ );
189
+ }
190
+ ```
191
+
192
+ ## Changes to `<FileRoutes>`
193
+
194
+ The `<FileRoutes>` component now accepts two additional optional props:
195
+
196
+ | Property | Type | Required | Default Value | Description |
197
+ | ----------- | -------- | -------- | ------------- | ----------------------------------------------------------------------- |
198
+ | `basePath` | `string` | No | `"/"` | A path that's prepended to all file routes. |
199
+ | `dirPrefix` | `string` | No | `"./routes"` | The portion of the file route path that shouldn't be a part of the URL. |
200
+
201
+ You need to modify `dirPrefix` if you want to import routes from a location other than `src/routes`.
202
+
203
+ You can modify `basePath` if you want to prefix all file routes. For example, you can prefix all file routes with a locale:
204
+
205
+ ```jsx
206
+ <Router>
207
+ <FileRoutes basePath={`/${locale}`} routes={routes} />
208
+ <Route path="*" page={<NotFound />} />
209
+ </Router>
210
+ ```
211
+
212
+ ## New `useRouteParams()` hook
213
+
214
+ You can use the `useRouteParams()` hook to retrieve the parameters of an active route. The hook is available in both server and client components:
215
+
216
+ ```jsx
217
+ // products/[handle].server.jsx
218
+
219
+ import {useRouteParams} from '@shopify/hydrogen';
220
+
221
+ export default function Product() {
222
+ const {handle} = useRouteParams();
223
+ // ...
224
+ }
225
+ ```
226
+
227
+ ```jsx
228
+ // ProductDetails.client.jsx
229
+ import {useRouteParams} from '@shopify/hydrogen/client';
230
+
231
+ export default function ProductDetails() {
232
+ const {handle} = useRouteParams();
233
+ // ...
234
+ }
235
+ ```
236
+
237
+ * [#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.
238
+
239
+ Upgrade your project by replacing references to the `RawHtml` component to follow
240
+ [React's `dangerouslySetInnerHTML`](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml):
241
+
242
+ Change all `RawHtml` component
243
+
244
+ ```jsx
245
+ <RawHtml string="<p>Hello world</p>" />
246
+ ```
247
+
248
+ to jsx equivalent
249
+
250
+ ```jsx
251
+ <div dangerouslySetInnerHTML={{__html: '<p>Hello world</p>'}} />
252
+ ```
253
+
254
+ ### Patch Changes
255
+
256
+ - [#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.
257
+
258
+ * [#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
259
+
260
+ - [#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
261
+
262
+ * [#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 Demo Store template needs to change:
263
+
264
+ ```diff
265
+ export default function Redirect({response}) {
266
+ - response.redirect('/products/snowboard');
267
+ - return <div>This page is redirected</div>;
268
+ + return response.redirect('/products/snowboard');
269
+ }
270
+ ```
271
+
272
+ This server component is rendered two ways:
273
+
274
+ 1. When an app directly loads the redirect route, the server will render a 300 redirect with the proper location header.
275
+ 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.
276
+
277
+ - [#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
278
+
279
+ * [#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`.
280
+
281
+ To upgrade your Hydrogen app, change the pinned version of `react` and `react-dom` in your `package.json` file to this version, or run:
282
+
283
+ ```bash
284
+ yarn add @shopify/hydrogen react@0.0.0-experimental-2bf7c02f0-20220314 react-dom@0.0.0-experimental-2bf7c02f0-20220314
285
+ ```
286
+
287
+ - [#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.
288
+
289
+ * [#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)
290
+
291
+ - [#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
292
+
293
+ * [#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
294
+
295
+ - [#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.
296
+
297
+ **Breaking change**: `fetchBuilder` no longer accepts a `Request` argument. Instead, it now accepts a `url: string` and `options: FetchInit`:
298
+
299
+ ```diff
300
+ -fetchBuilder(new Request('https://my.endpoint.com', {headers: {foo: 'bar'}}));
301
+ +fetchBuilder('https://my.endpoint.com', {headers: {foo: 'bar}});
302
+ ```
303
+
304
+ * [#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.
305
+
306
+ - [#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
307
+
3
308
  ## 0.12.0
4
309
 
5
310
  ### Minor Changes
6
311
 
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.
312
+ - [`8271be8`](https://github.com/Shopify/hydrogen/commit/8271be83331c99f27a258e6532983da4fe4f0b5b) Thanks [@michenly](https://github.com/michenly)! - Export Seo components Fragement and use them in the Demo Store template.
8
313
 
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`.
314
+ * [#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
315
  The migration diff are as follows:
11
316
 
12
317
  ```diff
@@ -72,13 +377,13 @@
72
377
  + import type {VideoFragmentFragment} from '@shopify/hydrogen/fragments';
73
378
  ```
74
379
 
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.
380
+ - [#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
381
 
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.
382
+ * [#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
383
 
79
384
  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
385
 
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:
386
+ - [#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
387
 
83
388
  ```jsx
84
389
  // my-api.server.js
@@ -105,7 +410,7 @@
105
410
  +export default renderHydrogen(App, {shopifyConfig, routes});
106
411
  ```
107
412
 
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.
413
+ * [#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
414
 
110
415
  Follow these steps to upgrade your `App.server.jsx` file:
111
416
 
@@ -147,26 +452,26 @@
147
452
 
148
453
  ### Patch Changes
149
454
 
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.
455
+ - [#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
456
 
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
457
+ * [#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
458
 
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.
459
+ - [#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
460
 
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
461
+ * [#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
462
 
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.
463
+ - [#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
464
  There is no longer an uncaught promise exception in the console.
160
465
 
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.
466
+ * [#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
467
 
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.
468
+ - [#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
469
 
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
470
+ * [#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
471
 
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
472
+ - [#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
473
 
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
474
+ * [#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
475
 
171
476
  - MediaFileProps
172
477
  - VideoProps
@@ -182,21 +487,21 @@
182
487
 
183
488
  Any Component props type should be typed instead with `React.ComponentProps<typeof MyComponent>`.
184
489
 
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.
490
+ - [#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
491
 
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.
492
+ * [#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
493
 
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
494
+ - [#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
495
 
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
496
+ * [#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
497
 
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.
498
+ - [#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
499
 
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.
500
+ * [#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
501
 
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
502
+ - [#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
503
 
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.
504
+ * [#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
505
  Extract part of the client bundle into separate modules that can be loaded in parallel.
201
506
 
202
507
  ## 0.11.1
@@ -207,7 +512,7 @@
207
512
 
208
513
  * [#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
514
 
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`
515
+ - [#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
516
 
212
517
  * [#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
518
 
@@ -640,7 +945,7 @@ function SomeComponent() {
640
945
 
641
946
  ### Fixed
642
947
 
643
- - Starter template GalleryPreview unique key warning
948
+ - Demo Store template GalleryPreview unique key warning
644
949
  - Mitigation for upcoming breaking minor Vite update
645
950
 
646
951
  ## 0.2.0 - 2021-10-08
@@ -707,4 +1012,3 @@ function SomeComponent() {
707
1012
  [0.10.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.0
708
1013
  [0.10.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.1
709
1014
  [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";