@shopify/hydrogen 0.22.0 → 0.24.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 (491) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +5 -5
  3. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +5 -8
  4. package/dist/esnext/components/CartLineProvider/context.d.ts +12 -2
  5. package/dist/esnext/components/CartLines/{CartLines.d.ts → CartLines.client.d.ts} +0 -0
  6. package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +0 -0
  7. package/dist/esnext/components/CartLines/index.d.ts +1 -1
  8. package/dist/esnext/components/CartLines/index.js +1 -1
  9. package/dist/esnext/components/CartProvider/CartProvider.client.js +2 -5
  10. package/dist/esnext/components/CartProvider/cart-queries.d.ts +1 -1
  11. package/dist/esnext/components/CartProvider/cart-queries.js +11 -0
  12. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +11 -1
  13. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +11 -1
  14. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +11 -1
  15. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +11 -1
  16. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +11 -1
  17. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +11 -1
  18. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +11 -1
  19. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +11 -1
  20. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +11 -1
  21. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +11 -1
  22. package/dist/esnext/components/CartProvider/hooks.client.js +3 -5
  23. package/dist/esnext/components/CartProvider/types.d.ts +2 -0
  24. package/dist/esnext/components/DevTools.client.js +1 -1
  25. package/dist/esnext/components/Image/Image.d.ts +8 -0
  26. package/dist/esnext/components/Image/Image.js +58 -10
  27. package/dist/esnext/components/Link/Link.client.d.ts +2 -0
  28. package/dist/esnext/components/Link/Link.client.js +7 -4
  29. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +1 -1
  30. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  31. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +141 -0
  32. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
  33. package/dist/esnext/components/{ProductProvider → ProductOptionsProvider}/context.js +0 -1
  34. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
  35. package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
  36. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -2
  37. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +10 -12
  38. package/dist/esnext/components/index.d.ts +1 -1
  39. package/dist/esnext/components/index.js +1 -1
  40. package/dist/esnext/entry-client.js +106 -6
  41. package/dist/esnext/entry-server.d.ts +2 -15
  42. package/dist/esnext/entry-server.js +246 -322
  43. package/dist/esnext/foundation/Analytics/Analytics.client.js +15 -13
  44. package/dist/esnext/foundation/Analytics/Analytics.server.js +27 -20
  45. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  46. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +16 -14
  47. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
  48. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.server.d.ts +1 -0
  49. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/{PerformanceMetrics.server.js → ServerAnalyticsConnector.server.js} +7 -6
  50. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.d.ts +1 -0
  51. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.js +19 -0
  52. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
  53. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +190 -0
  54. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
  55. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +24 -0
  56. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +28 -0
  57. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +51 -0
  58. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
  59. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
  60. package/dist/esnext/foundation/Analytics/hook.js +4 -2
  61. package/dist/esnext/foundation/Analytics/utils.d.ts +2 -0
  62. package/dist/esnext/foundation/Analytics/utils.js +21 -0
  63. package/dist/{node/framework → esnext/foundation/Cache}/cache-sub-request.d.ts +1 -1
  64. package/dist/esnext/{framework → foundation/Cache}/cache-sub-request.js +3 -3
  65. package/dist/esnext/{framework → foundation/Cache}/cache.d.ts +1 -1
  66. package/dist/esnext/{framework → foundation/Cache}/cache.js +3 -3
  67. package/dist/{node/framework/CachingStrategy → esnext/foundation/Cache/strategies}/index.d.ts +2 -1
  68. package/dist/esnext/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +1 -1
  69. package/dist/esnext/foundation/Cookie/Cookie.d.ts +3 -3
  70. package/dist/{node/framework/Hydration → esnext/foundation/Html}/Html.d.ts +3 -1
  71. package/dist/esnext/{framework/Hydration → foundation/Html}/Html.js +15 -2
  72. package/dist/{node/framework/Hydration/ServerComponentRequest.server.d.ts → esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +8 -3
  73. package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +3 -2
  74. package/dist/{node/framework/Hydration/ServerComponentResponse.server.d.ts → esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +7 -10
  75. package/dist/esnext/{framework/Hydration/ServerComponentResponse.server.js → foundation/HydrogenResponse/HydrogenResponse.server.js} +19 -15
  76. package/dist/esnext/foundation/Router/BrowserRouter.client.js +16 -9
  77. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  78. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
  79. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +5 -6
  80. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +18 -21
  81. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +1 -1
  82. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +1 -1
  83. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +1 -0
  84. package/dist/esnext/foundation/index.d.ts +1 -1
  85. package/dist/esnext/foundation/index.js +1 -1
  86. package/dist/esnext/foundation/runtime.d.ts +2 -0
  87. package/dist/esnext/foundation/runtime.js +6 -0
  88. package/dist/esnext/foundation/session/session.d.ts +3 -3
  89. package/dist/esnext/foundation/ssr-interop.d.ts +2 -2
  90. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +2 -0
  91. package/dist/esnext/foundation/useNavigate/useNavigate.js +11 -4
  92. package/dist/esnext/foundation/useQuery/hooks.d.ts +1 -0
  93. package/dist/esnext/foundation/useQuery/hooks.js +24 -7
  94. package/dist/esnext/foundation/useRequestContext/index.d.ts +15 -0
  95. package/dist/esnext/foundation/useRequestContext/index.js +23 -0
  96. package/dist/esnext/framework/Hydration/rsc.js +2 -0
  97. package/dist/esnext/framework/plugin.js +2 -0
  98. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +5 -2
  99. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +1 -1
  100. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +4 -12
  101. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  102. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
  103. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +12 -2
  104. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +2 -2
  105. package/dist/esnext/hooks/useProductOptions/types.d.ts +17 -15
  106. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -15
  107. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +8 -107
  108. package/dist/esnext/hooks/useShopQuery/hooks.js +12 -6
  109. package/dist/esnext/index.d.ts +9 -3
  110. package/dist/esnext/index.js +7 -3
  111. package/dist/esnext/storefront-api-types.d.ts +10 -339
  112. package/dist/esnext/streaming.server.d.ts +0 -1
  113. package/dist/esnext/streaming.server.js +0 -4
  114. package/dist/esnext/types.d.ts +32 -23
  115. package/dist/esnext/utilities/apiRoutes.d.ts +2 -2
  116. package/dist/esnext/utilities/graphql-tracker.js +1 -1
  117. package/dist/esnext/utilities/index.d.ts +1 -1
  118. package/dist/esnext/utilities/index.js +1 -1
  119. package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
  120. package/dist/esnext/utilities/isBrowser/index.js +1 -0
  121. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
  122. package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
  123. package/dist/esnext/utilities/isServer/isServer.js +2 -2
  124. package/dist/esnext/utilities/log/index.d.ts +1 -1
  125. package/dist/esnext/utilities/log/index.js +1 -1
  126. package/dist/esnext/utilities/log/log-cache-header.d.ts +4 -4
  127. package/dist/esnext/utilities/log/log-query-timeline.d.ts +3 -3
  128. package/dist/esnext/utilities/log/log.d.ts +17 -11
  129. package/dist/esnext/utilities/log/log.js +29 -20
  130. package/dist/esnext/version.d.ts +1 -1
  131. package/dist/esnext/version.js +1 -1
  132. package/dist/node/client.d.ts +16 -0
  133. package/dist/node/client.js +43 -0
  134. package/dist/node/components/AddToCartButton/AddToCartButton.client.d.ts +23 -0
  135. package/dist/node/components/AddToCartButton/AddToCartButton.client.js +74 -0
  136. package/dist/node/components/AddToCartButton/index.d.ts +1 -0
  137. package/dist/node/components/AddToCartButton/index.js +5 -0
  138. package/dist/node/components/BuyNowButton/BuyNowButton.client.d.ts +18 -0
  139. package/dist/node/components/BuyNowButton/BuyNowButton.client.js +53 -0
  140. package/dist/node/components/BuyNowButton/index.d.ts +1 -0
  141. package/dist/node/components/BuyNowButton/index.js +5 -0
  142. package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +11 -0
  143. package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.js +44 -0
  144. package/dist/node/components/CartCheckoutButton/index.d.ts +1 -0
  145. package/dist/node/components/CartCheckoutButton/index.js +5 -0
  146. package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +14 -0
  147. package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.js +36 -0
  148. package/dist/node/components/CartEstimatedCost/index.d.ts +1 -0
  149. package/dist/node/components/CartEstimatedCost/index.js +5 -0
  150. package/dist/node/components/CartLineImage/CartLineImage.client.d.ts +9 -0
  151. package/dist/node/components/CartLineImage/CartLineImage.client.js +18 -0
  152. package/dist/node/components/CartLineImage/index.d.ts +1 -0
  153. package/dist/node/components/CartLineImage/index.js +5 -0
  154. package/dist/node/components/CartLinePrice/CartLinePrice.client.d.ts +12 -0
  155. package/dist/node/components/CartLinePrice/CartLinePrice.client.js +25 -0
  156. package/dist/node/components/CartLinePrice/index.d.ts +1 -0
  157. package/dist/node/components/CartLinePrice/index.js +5 -0
  158. package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -0
  159. package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.js +19 -0
  160. package/dist/node/components/CartLineProductTitle/index.d.ts +1 -0
  161. package/dist/node/components/CartLineProductTitle/index.js +5 -0
  162. package/dist/node/components/CartLineProvider/CartLineProvider.client.d.ts +11 -0
  163. package/dist/node/components/CartLineProvider/CartLineProvider.client.js +15 -0
  164. package/dist/node/components/CartLineProvider/context.d.ts +36 -0
  165. package/dist/node/components/CartLineProvider/context.js +5 -0
  166. package/dist/node/components/CartLineProvider/index.d.ts +2 -0
  167. package/dist/node/components/CartLineProvider/index.js +7 -0
  168. package/dist/node/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -0
  169. package/dist/node/components/CartLineQuantity/CartLineQuantity.client.js +19 -0
  170. package/dist/node/components/CartLineQuantity/index.d.ts +1 -0
  171. package/dist/node/components/CartLineQuantity/index.js +5 -0
  172. package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +14 -0
  173. package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +31 -0
  174. package/dist/node/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
  175. package/dist/node/components/CartLineQuantityAdjustButton/index.js +5 -0
  176. package/dist/node/components/CartLines/CartLines.client.d.ts +15 -0
  177. package/dist/node/components/CartLines/CartLines.client.js +44 -0
  178. package/dist/node/components/CartLines/index.d.ts +1 -0
  179. package/dist/node/components/CartLines/index.js +5 -0
  180. package/dist/node/components/CartProvider/CartProvider.client.d.ts +41 -0
  181. package/dist/node/components/CartProvider/CartProvider.client.js +547 -0
  182. package/dist/node/components/CartProvider/cart-queries.d.ts +10 -0
  183. package/dist/node/components/CartProvider/cart-queries.js +214 -0
  184. package/dist/node/components/CartProvider/constants.d.ts +2 -0
  185. package/dist/node/components/CartProvider/constants.js +5 -0
  186. package/dist/node/components/CartProvider/context.d.ts +2 -0
  187. package/dist/node/components/CartProvider/context.js +5 -0
  188. package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +96 -0
  189. package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.js +2 -0
  190. package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +96 -0
  191. package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +2 -0
  192. package/dist/node/components/CartProvider/graphql/CartCreateMutation.d.ts +95 -0
  193. package/dist/node/components/CartProvider/graphql/CartCreateMutation.js +2 -0
  194. package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +96 -0
  195. package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +2 -0
  196. package/dist/node/components/CartProvider/graphql/CartFragment.d.ts +82 -0
  197. package/dist/node/components/CartProvider/graphql/CartFragment.js +2 -0
  198. package/dist/node/components/CartProvider/graphql/CartLineAddMutation.d.ts +96 -0
  199. package/dist/node/components/CartProvider/graphql/CartLineAddMutation.js +2 -0
  200. package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +96 -0
  201. package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.js +2 -0
  202. package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +96 -0
  203. package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.js +2 -0
  204. package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +96 -0
  205. package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.js +2 -0
  206. package/dist/node/components/CartProvider/graphql/CartQuery.d.ts +91 -0
  207. package/dist/node/components/CartProvider/graphql/CartQuery.js +2 -0
  208. package/dist/node/components/CartProvider/hooks.client.d.ts +15 -0
  209. package/dist/node/components/CartProvider/hooks.client.js +88 -0
  210. package/dist/node/components/CartProvider/index.d.ts +4 -0
  211. package/dist/node/components/CartProvider/index.js +10 -0
  212. package/dist/node/components/CartProvider/types.d.ts +104 -0
  213. package/dist/node/components/CartProvider/types.js +2 -0
  214. package/dist/node/components/CartShopPayButton/CartShopPayButton.client.d.ts +9 -0
  215. package/dist/node/components/CartShopPayButton/CartShopPayButton.client.js +46 -0
  216. package/dist/node/components/CartShopPayButton/index.d.ts +1 -0
  217. package/dist/node/components/CartShopPayButton/index.js +5 -0
  218. package/dist/node/components/ExternalVideo/ExternalVideo.d.ts +21 -0
  219. package/dist/node/components/ExternalVideo/ExternalVideo.js +21 -0
  220. package/dist/node/components/ExternalVideo/index.d.ts +1 -0
  221. package/dist/node/components/ExternalVideo/index.js +5 -0
  222. package/dist/node/components/Image/Image.d.ts +8 -0
  223. package/dist/node/components/Image/Image.js +57 -9
  224. package/dist/node/components/Link/Link.client.d.ts +25 -0
  225. package/dist/node/components/Link/Link.client.js +165 -0
  226. package/dist/node/components/Link/index.d.ts +1 -0
  227. package/dist/node/components/Link/index.js +5 -0
  228. package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
  229. package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.js +11 -0
  230. package/dist/node/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -0
  231. package/dist/node/components/LocalizationProvider/LocalizationContext.client.js +5 -0
  232. package/dist/node/components/LocalizationProvider/LocalizationProvider.server.d.ts +33 -0
  233. package/dist/node/components/LocalizationProvider/LocalizationProvider.server.js +51 -0
  234. package/dist/node/components/MediaFile/MediaFile.d.ts +19 -0
  235. package/dist/node/components/MediaFile/MediaFile.js +39 -0
  236. package/dist/node/components/MediaFile/index.d.ts +1 -0
  237. package/dist/node/components/MediaFile/index.js +5 -0
  238. package/dist/node/components/Metafield/Metafield.client.d.ts +21 -0
  239. package/dist/node/components/Metafield/Metafield.client.js +75 -0
  240. package/dist/node/components/Metafield/index.d.ts +2 -0
  241. package/dist/node/components/Metafield/index.js +5 -0
  242. package/dist/node/components/Metafield/types.d.ts +4 -0
  243. package/dist/node/components/Metafield/types.js +2 -0
  244. package/dist/node/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  245. package/dist/node/components/ModelViewer/ModelViewer.client.js +132 -0
  246. package/dist/node/components/ModelViewer/index.d.ts +1 -0
  247. package/dist/node/components/ModelViewer/index.js +5 -0
  248. package/dist/node/components/Money/Money.client.d.ts +25 -0
  249. package/dist/node/components/Money/Money.client.js +46 -0
  250. package/dist/node/components/Money/index.d.ts +1 -0
  251. package/dist/node/components/Money/index.js +5 -0
  252. package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  253. package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.js +168 -0
  254. package/dist/node/components/ProductOptionsProvider/context.d.ts +2 -0
  255. package/dist/node/components/ProductOptionsProvider/context.js +5 -0
  256. package/dist/node/components/ProductOptionsProvider/index.d.ts +2 -0
  257. package/dist/node/components/ProductOptionsProvider/index.js +7 -0
  258. package/dist/node/components/ProductPrice/ProductPrice.client.d.ts +18 -0
  259. package/dist/node/components/ProductPrice/ProductPrice.client.js +61 -0
  260. package/dist/node/components/ProductPrice/index.d.ts +1 -0
  261. package/dist/node/components/ProductPrice/index.js +5 -0
  262. package/dist/node/components/Seo/CollectionSeo.client.d.ts +3 -0
  263. package/dist/node/components/Seo/CollectionSeo.client.js +22 -0
  264. package/dist/node/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  265. package/dist/node/components/Seo/DefaultPageSeo.client.js +25 -0
  266. package/dist/node/components/Seo/DescriptionSeo.client.d.ts +4 -0
  267. package/dist/node/components/Seo/DescriptionSeo.client.js +17 -0
  268. package/dist/node/components/Seo/HomePageSeo.client.d.ts +2 -0
  269. package/dist/node/components/Seo/HomePageSeo.client.js +32 -0
  270. package/dist/node/components/Seo/ImageSeo.client.d.ts +3 -0
  271. package/dist/node/components/Seo/ImageSeo.client.js +17 -0
  272. package/dist/node/components/Seo/NoIndexSeo.client.d.ts +3 -0
  273. package/dist/node/components/Seo/NoIndexSeo.client.js +17 -0
  274. package/dist/node/components/Seo/PageSeo.client.d.ts +3 -0
  275. package/dist/node/components/Seo/PageSeo.client.js +20 -0
  276. package/dist/node/components/Seo/ProductSeo.client.d.ts +5 -0
  277. package/dist/node/components/Seo/ProductSeo.client.js +70 -0
  278. package/dist/node/components/Seo/Seo.client.d.ts +30 -0
  279. package/dist/node/components/Seo/Seo.client.js +38 -0
  280. package/dist/node/components/Seo/TitleSeo.client.d.ts +3 -0
  281. package/dist/node/components/Seo/TitleSeo.client.js +17 -0
  282. package/dist/node/components/Seo/TwitterSeo.client.d.ts +2 -0
  283. package/dist/node/components/Seo/TwitterSeo.client.js +16 -0
  284. package/dist/node/components/Seo/index.d.ts +1 -0
  285. package/dist/node/components/Seo/index.js +5 -0
  286. package/dist/node/components/Seo/seo-types.d.ts +17 -0
  287. package/dist/node/components/Seo/seo-types.js +2 -0
  288. package/dist/node/components/ShopPayButton/ShopPayButton.client.d.ts +38 -0
  289. package/dist/node/components/ShopPayButton/ShopPayButton.client.js +60 -0
  290. package/dist/node/components/ShopPayButton/index.d.ts +1 -0
  291. package/dist/node/components/ShopPayButton/index.js +5 -0
  292. package/dist/node/components/Video/Video.d.ts +14 -0
  293. package/dist/node/components/Video/Video.js +31 -0
  294. package/dist/node/components/Video/index.d.ts +1 -0
  295. package/dist/node/components/Video/index.js +5 -0
  296. package/dist/node/components/index.d.ts +28 -0
  297. package/dist/node/components/index.js +59 -0
  298. package/dist/node/components/types.d.ts +71 -0
  299. package/dist/node/components/types.js +11 -0
  300. package/dist/node/entry-server.d.ts +2 -15
  301. package/dist/node/entry-server.js +245 -321
  302. package/dist/node/foundation/Analytics/Analytics.client.js +15 -13
  303. package/dist/node/foundation/Analytics/Analytics.server.js +27 -20
  304. package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  305. package/dist/node/foundation/Analytics/ClientAnalytics.js +15 -13
  306. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
  307. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  308. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +68 -0
  309. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  310. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +27 -0
  311. package/dist/node/foundation/Analytics/hook.js +4 -2
  312. package/dist/node/foundation/Analytics/index.d.ts +1 -0
  313. package/dist/node/foundation/Analytics/index.js +5 -0
  314. package/dist/node/foundation/Analytics/utils.d.ts +2 -0
  315. package/dist/node/foundation/Analytics/utils.js +24 -1
  316. package/dist/{esnext/framework → node/foundation/Cache}/cache-sub-request.d.ts +1 -1
  317. package/dist/node/{framework → foundation/Cache}/cache-sub-request.js +4 -4
  318. package/dist/node/{framework → foundation/Cache}/cache.d.ts +1 -1
  319. package/dist/node/{framework → foundation/Cache}/cache.js +5 -5
  320. package/dist/{esnext/framework/CachingStrategy → node/foundation/Cache/strategies}/index.d.ts +2 -1
  321. package/dist/node/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +3 -3
  322. package/dist/node/foundation/Head/Head.client.d.ts +5 -0
  323. package/dist/node/foundation/Head/Head.client.js +17 -0
  324. package/dist/node/foundation/Head/index.d.ts +1 -0
  325. package/dist/node/foundation/Head/index.js +5 -0
  326. package/dist/{esnext/framework/Hydration → node/foundation/Html}/Html.d.ts +3 -1
  327. package/dist/node/{framework/Hydration → foundation/Html}/Html.js +15 -2
  328. package/dist/{esnext/framework/Hydration/ServerComponentRequest.server.d.ts → node/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +8 -3
  329. package/dist/node/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +5 -4
  330. package/dist/{esnext/framework/Hydration/ServerComponentResponse.server.d.ts → node/foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +7 -10
  331. package/dist/node/{framework/Hydration/ServerComponentResponse.server.js → foundation/HydrogenResponse/HydrogenResponse.server.js} +23 -19
  332. package/dist/node/foundation/Router/BrowserRouter.client.js +16 -9
  333. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  334. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
  335. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +5 -6
  336. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +18 -21
  337. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  338. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.js +35 -0
  339. package/dist/node/foundation/ShopifyProvider/index.d.ts +1 -0
  340. package/dist/node/foundation/ShopifyProvider/index.js +5 -0
  341. package/dist/node/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  342. package/dist/node/foundation/fetchSync/client/fetchSync.js +33 -0
  343. package/dist/node/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  344. package/dist/node/foundation/fetchSync/server/fetchSync.js +33 -0
  345. package/dist/node/foundation/fetchSync/types.d.ts +5 -0
  346. package/dist/node/foundation/fetchSync/types.js +2 -0
  347. package/dist/node/foundation/index.d.ts +3 -0
  348. package/dist/node/foundation/index.js +10 -0
  349. package/dist/node/foundation/runtime.d.ts +2 -0
  350. package/dist/node/foundation/runtime.js +11 -0
  351. package/dist/node/foundation/session/session.d.ts +3 -3
  352. package/dist/node/foundation/ssr-interop.d.ts +2 -2
  353. package/dist/node/foundation/useNavigate/useNavigate.d.ts +2 -0
  354. package/dist/node/foundation/useNavigate/useNavigate.js +11 -4
  355. package/dist/node/foundation/useQuery/hooks.d.ts +37 -0
  356. package/dist/node/foundation/useQuery/hooks.js +119 -0
  357. package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.d.ts +10 -0
  358. package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.js +34 -0
  359. package/dist/node/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  360. package/dist/node/foundation/useRouteParams/useRouteParams.js +13 -0
  361. package/dist/node/foundation/useServerProps/index.d.ts +1 -0
  362. package/dist/node/foundation/useServerProps/index.js +5 -0
  363. package/dist/node/foundation/useSession/useSession.d.ts +2 -0
  364. package/dist/node/foundation/useSession/useSession.js +12 -0
  365. package/dist/node/foundation/useShop/index.d.ts +1 -0
  366. package/dist/node/foundation/useShop/index.js +5 -0
  367. package/dist/node/foundation/useShop/use-shop.d.ts +6 -0
  368. package/dist/node/foundation/useShop/use-shop.js +18 -0
  369. package/dist/node/foundation/useUrl/index.d.ts +1 -0
  370. package/dist/node/foundation/useUrl/index.js +5 -0
  371. package/dist/node/foundation/useUrl/useUrl.d.ts +4 -0
  372. package/dist/node/foundation/useUrl/useUrl.js +32 -0
  373. package/dist/node/framework/Hydration/rsc.js +2 -0
  374. package/dist/node/framework/plugin.js +2 -0
  375. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +5 -2
  376. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +1 -1
  377. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +4 -12
  378. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  379. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
  380. package/dist/node/hooks/index.d.ts +6 -0
  381. package/dist/node/hooks/index.js +28 -0
  382. package/dist/node/hooks/useCart/index.d.ts +1 -0
  383. package/dist/node/hooks/useCart/index.js +5 -0
  384. package/dist/node/hooks/useCart/useCart.d.ts +4 -0
  385. package/dist/node/hooks/useCart/useCart.js +19 -0
  386. package/dist/node/hooks/useCartLine/index.d.ts +1 -0
  387. package/dist/node/hooks/useCartLine/index.js +5 -0
  388. package/dist/node/hooks/useCartLine/useCartLine.d.ts +39 -0
  389. package/dist/node/hooks/useCartLine/useCartLine.js +16 -0
  390. package/dist/node/hooks/useCountry/index.d.ts +1 -0
  391. package/dist/node/hooks/useCountry/index.js +5 -0
  392. package/dist/node/hooks/useCountry/useCountry.d.ts +7 -0
  393. package/dist/node/hooks/useCountry/useCountry.js +21 -0
  394. package/dist/node/hooks/useLoadScript/index.d.ts +1 -0
  395. package/dist/node/hooks/useLoadScript/index.js +5 -0
  396. package/dist/node/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  397. package/dist/node/hooks/useLoadScript/useLoadScript.client.js +27 -0
  398. package/dist/node/hooks/useMeasurement/hooks.d.ts +9 -0
  399. package/dist/node/hooks/useMeasurement/hooks.js +17 -0
  400. package/dist/node/hooks/useMeasurement/index.d.ts +1 -0
  401. package/dist/node/hooks/useMeasurement/index.js +5 -0
  402. package/dist/node/hooks/useMoney/hooks.d.ts +54 -0
  403. package/dist/node/hooks/useMoney/hooks.js +70 -0
  404. package/dist/node/hooks/useMoney/index.d.ts +1 -0
  405. package/dist/node/hooks/useMoney/index.js +5 -0
  406. package/dist/node/hooks/useParsedMetafields/index.d.ts +1 -0
  407. package/dist/node/hooks/useParsedMetafields/index.js +5 -0
  408. package/dist/node/hooks/useParsedMetafields/useParsedMetafields.d.ts +21 -0
  409. package/dist/node/hooks/useParsedMetafields/useParsedMetafields.js +25 -0
  410. package/dist/node/hooks/useProductOptions/helpers.d.ts +6 -0
  411. package/dist/node/hooks/useProductOptions/helpers.js +46 -0
  412. package/dist/node/hooks/useProductOptions/index.d.ts +2 -0
  413. package/dist/node/hooks/useProductOptions/index.js +20 -0
  414. package/dist/node/hooks/useProductOptions/types.d.ts +44 -0
  415. package/dist/node/hooks/useProductOptions/types.js +2 -0
  416. package/dist/node/hooks/useProductOptions/useProductOptions.client.d.ts +1 -0
  417. package/dist/node/hooks/useProductOptions/useProductOptions.client.js +13 -0
  418. package/dist/node/hooks/useShopQuery/hooks.d.ts +28 -0
  419. package/dist/node/hooks/useShopQuery/hooks.js +171 -0
  420. package/dist/node/hooks/useShopQuery/index.d.ts +1 -0
  421. package/dist/node/hooks/useShopQuery/index.js +5 -0
  422. package/dist/node/storefront-api-types.d.ts +10 -339
  423. package/dist/node/streaming.server.d.ts +0 -1
  424. package/dist/node/streaming.server.js +1 -6
  425. package/dist/node/types.d.ts +32 -23
  426. package/dist/node/utilities/apiRoutes.d.ts +2 -2
  427. package/dist/node/utilities/devtools.d.ts +11 -0
  428. package/dist/node/utilities/devtools.js +15 -0
  429. package/dist/node/utilities/graphql-tag.d.ts +1 -0
  430. package/dist/node/utilities/graphql-tag.js +10 -0
  431. package/dist/node/utilities/graphql-tracker.d.ts +17 -0
  432. package/dist/node/utilities/graphql-tracker.js +130 -0
  433. package/dist/node/utilities/index.d.ts +1 -1
  434. package/dist/node/utilities/index.js +3 -3
  435. package/dist/node/utilities/isBrowser/index.d.ts +1 -0
  436. package/dist/node/utilities/isBrowser/index.js +5 -0
  437. package/dist/node/utilities/isBrowser/isBrowser.d.ts +4 -0
  438. package/dist/node/utilities/isBrowser/isBrowser.js +10 -0
  439. package/dist/node/utilities/isServer/isServer.js +2 -2
  440. package/dist/node/utilities/log/index.d.ts +1 -1
  441. package/dist/node/utilities/log/index.js +1 -3
  442. package/dist/node/utilities/log/log-cache-header.d.ts +4 -4
  443. package/dist/node/utilities/log/log-query-timeline.d.ts +3 -3
  444. package/dist/node/utilities/log/log.d.ts +17 -11
  445. package/dist/node/utilities/log/log.js +30 -23
  446. package/dist/node/version.d.ts +1 -1
  447. package/dist/node/version.js +1 -1
  448. package/package.json +4 -2
  449. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +234 -53
  450. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +77 -59
  451. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +30 -30
  452. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +199 -70
  453. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +38 -35
  454. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +9 -8
  455. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +3 -3
  456. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -7
  457. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +235 -54
  458. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +77 -59
  459. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +199 -70
  460. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +9 -8
  461. package/vendor/react-server-dom-vite/package.json +1 -1
  462. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +0 -8
  463. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +0 -12
  464. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -24
  465. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -34
  466. package/dist/esnext/components/ProductProvider/context.d.ts +0 -29
  467. package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
  468. package/dist/esnext/components/ProductProvider/index.js +0 -2
  469. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +0 -1
  470. package/dist/esnext/framework/config.d.ts +0 -6
  471. package/dist/esnext/framework/config.js +0 -6
  472. package/dist/esnext/framework/runtime.d.ts +0 -13
  473. package/dist/esnext/framework/runtime.js +0 -27
  474. package/dist/esnext/hooks/useProduct/index.d.ts +0 -1
  475. package/dist/esnext/hooks/useProduct/index.js +0 -1
  476. package/dist/esnext/hooks/useProduct/useProduct.d.ts +0 -52
  477. package/dist/esnext/hooks/useProduct/useProduct.js +0 -43
  478. package/dist/esnext/utilities/isClient/index.d.ts +0 -1
  479. package/dist/esnext/utilities/isClient/index.js +0 -1
  480. package/dist/esnext/utilities/isClient/isClient.d.ts +0 -4
  481. package/dist/esnext/utilities/isClient/isClient.js +0 -6
  482. package/dist/node/framework/config.d.ts +0 -6
  483. package/dist/node/framework/config.js +0 -11
  484. package/dist/node/framework/runtime.d.ts +0 -13
  485. package/dist/node/framework/runtime.js +0 -35
  486. package/dist/node/utilities/defer.d.ts +0 -6
  487. package/dist/node/utilities/defer.js +0 -18
  488. package/dist/node/utilities/isClient/index.d.ts +0 -1
  489. package/dist/node/utilities/isClient/index.js +0 -5
  490. package/dist/node/utilities/isClient/isClient.d.ts +0 -4
  491. package/dist/node/utilities/isClient/isClient.js +0 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,245 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1489](https://github.com/Shopify/hydrogen/pull/1489) [`e2ee2d45`](https://github.com/Shopify/hydrogen/commit/e2ee2d4575613ae34727de9c1a6280904bb2e3ff) Thanks [@blittle](https://github.com/blittle)! - In an effort to be performant by default, the [preloaded queries](https://shopify.dev/custom-storefronts/hydrogen/framework/preloaded-queries) are turned on by default when caching is also enabled. By default, each query has caching enabled too, so `preload` will on universally by default.
8
+
9
+ * [#1237](https://github.com/Shopify/hydrogen/pull/1237) [`356e75f3`](https://github.com/Shopify/hydrogen/commit/356e75f351c04ff393e996c34632005331ec0872) Thanks [@frehner](https://github.com/frehner)! - Updated Cart queries in two ways, one of which requires you to be using Storefront API `2022-07`:
10
+
11
+ 1. [`CartLine`](https://shopify.dev/api/storefront/2022-04/objects/CartLine#fields) now uses [`CartLineEstimatedCost`'s `totalAmount`](https://shopify.dev/api/storefront/2022-04/objects/CartLineEstimatedCost) field for calculating the Line's total, instead of doing it manually.
12
+ 2. Cart now uses [`totalQuantity`](https://shopify.dev/api/storefront/2022-07/objects/Cart#field-cart-totalquantity) for calculating how many items are in the cart, instead of doing this manually. **Note that this feature is only available in Storefront API `2022-07` and newer.**
13
+
14
+ ### Patch Changes
15
+
16
+ - [#1473](https://github.com/Shopify/hydrogen/pull/1473) [`a7f3b4bf`](https://github.com/Shopify/hydrogen/commit/a7f3b4bfe0d66fb0440dff3d641a181372de313a) Thanks [@frandiox](https://github.com/frandiox)! - Reduce CPU consumption when rendering React Server Components.
17
+
18
+ * [#1453](https://github.com/Shopify/hydrogen/pull/1453) [`84b9e6d3`](https://github.com/Shopify/hydrogen/commit/84b9e6d3516a74f94fab691d6ff7605623351f1e) Thanks [@jplhomer](https://github.com/jplhomer)! - Update `setSelectedVariant` types to allow `null` to be passed.
19
+
20
+ - [#1484](https://github.com/Shopify/hydrogen/pull/1484) [`990bfd8b`](https://github.com/Shopify/hydrogen/commit/990bfd8b928425f2685901c1a02b686354d18d4d) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Fix ClientAnalytics losing subscriber object when passed as a param
21
+
22
+ * [#1509](https://github.com/Shopify/hydrogen/pull/1509) [`05081b01`](https://github.com/Shopify/hydrogen/commit/05081b01283c023e9c751c04ed496003daf47091) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix `<BuyNowButton>` so it can be rendered without being nested in a `<CartProvider>`
23
+
24
+ - [#1469](https://github.com/Shopify/hydrogen/pull/1469) [`07d45290`](https://github.com/Shopify/hydrogen/commit/07d452905492bfa1bd58c681b8d56407fdc4716b) Thanks [@frandiox](https://github.com/frandiox)! - Fix path resolution when using aliases in server components.
25
+
26
+ * [#1471](https://github.com/Shopify/hydrogen/pull/1471) [`5b4e08df`](https://github.com/Shopify/hydrogen/commit/5b4e08df97dd2343452b0d1f7ff59ac5bbf98d32) Thanks [@frandiox](https://github.com/frandiox)! - Added an experimental hook `useRequestContext` that provides server-only context for third party integrations.
27
+
28
+ - [#1486](https://github.com/Shopify/hydrogen/pull/1486) [`a31e007d`](https://github.com/Shopify/hydrogen/commit/a31e007dbc2a1a6ce12e39ffc3f63f45e90abfa7) Thanks [@frehner](https://github.com/frehner)! - Fix `<ProductOptionsProvider/>`'s `setSelectedOptions()` function to update the `selectedVariant` as well
29
+
30
+ ## 0.23.0
31
+
32
+ ### Minor Changes
33
+
34
+ - [#1389](https://github.com/Shopify/hydrogen/pull/1389) [`9a21108f`](https://github.com/Shopify/hydrogen/commit/9a21108f6ff89474db9ff8bec26733fcbe744bdc) Thanks [@blittle](https://github.com/blittle)! - **Breaking change**
35
+
36
+ The utility `isClient` has been renamed to `isBrowser`. This is because the utility really checks if the running context is a browser, _not_ if the context is a client component.
37
+
38
+ All client components by default also run on the server when they are server rendered. If you don't want that to happen, use the `isBrowser()` hook. Remember that anything not server rendered will be unavailable for SEO bots.
39
+
40
+ * [#1431](https://github.com/Shopify/hydrogen/pull/1431) [`6975bdb9`](https://github.com/Shopify/hydrogen/commit/6975bdb90cfdc03562d21cec09150c52ff31ff78) Thanks [@jplhomer](https://github.com/jplhomer)! - Add `scroll` prop to `Link` and `navigate` to allow the scroll restoration behavior to be disabled.
41
+
42
+ By default, when a `<Link>` component is clicked, Hydrogen emulates default browser behavior and attempts to restore the scroll position previously used in the visitor's session. For new pages, this defaults to scrolling to the top of the page.
43
+
44
+ However, if you are building a user interface that should fetch a new server components request and update the URL but not modify scroll position, then you can disable scroll restoration using the `scroll` prop:
45
+
46
+ ```jsx
47
+ import {Link} from '@shopify/hydrogen';
48
+ export default function Index({request}) {
49
+ const url = new URL(request.normalizedUrl);
50
+
51
+ return (
52
+ <>
53
+ <p>Current param is: {url.searchParams.get('param')}</p>
54
+ <Link to="/?param=foo" scroll={false}>
55
+ Update param to foo
56
+ </Link>
57
+ </>
58
+ );
59
+ }
60
+ ```
61
+
62
+ - [#1325](https://github.com/Shopify/hydrogen/pull/1325) [`572c18d1`](https://github.com/Shopify/hydrogen/commit/572c18d1893b212cfc3f1be3043a67dcca251629) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - - Fix clientAnalytics not waiting for all server analytics data before sending page view event
63
+
64
+ - Fix server analytics connector erroring out after more than 1 server analytics connectors are attached
65
+ - Shopify analytics components
66
+
67
+ # Updates to server analytics connectors
68
+
69
+ The server analytics connector interface has updated to
70
+
71
+ ```jsx
72
+ export function request(
73
+ requestUrl: string,
74
+ requestHeader: Headers,
75
+ data?: any,
76
+ contentType?: string
77
+ ): void {
78
+ // Do something with the analytic event.
79
+ }
80
+ ```
81
+
82
+ # Introducing Shopify analytics
83
+
84
+ Optional analytics components that allows you to send ecommerce related analytics to
85
+ Shopify. Adding the Shopify analytics components will allow the Shopify admin - Analytics
86
+ dashboard to work.
87
+
88
+ For information, see [Shopify Analytics](https://shopify.dev/api/hydrogen/components/framework/shopifyanalytics)
89
+
90
+ * [#1334](https://github.com/Shopify/hydrogen/pull/1334) [`58e039d4`](https://github.com/Shopify/hydrogen/commit/58e039d45cf69b670628f9f7ea62cb7c2d8425d9) Thanks [@blittle](https://github.com/blittle)! - With the introduction of authenticated pages, we also now provide the ability to prevent pages from being indexed by bots. You can do so by passing `noindex` to the `Seo` component:
91
+
92
+ ```jsx
93
+ <Seo type="noindex" data={{title: 'Login'}} />
94
+ ```
95
+
96
+ - [#1397](https://github.com/Shopify/hydrogen/pull/1397) [`fbd185ab`](https://github.com/Shopify/hydrogen/commit/fbd185ab47e7335992b7844af0ef0b0aea6d70a5) Thanks [@frehner](https://github.com/frehner)! - ## `<ProductProvider/>` and `<ProductOptionsProvider/>`
97
+
98
+ - `<ProductProvider/>` has been removed
99
+ - `<ProductPrice/>` was the only component left that used it; now it requires a `data` prop that takes in the product object
100
+ - `<ProductOptionsProvider/>` now maintains and provides the state that `useProductOptions` used to keep track of by itself. This change enables you to use multiple `useProductOptions` hook calls and have them share the same state (such as selected variant, options, etc.)
101
+
102
+ * [#1403](https://github.com/Shopify/hydrogen/pull/1403) [`979f8177`](https://github.com/Shopify/hydrogen/commit/979f81775a4bfa83276030da07cb012e6cb08e2f) Thanks [@frandiox](https://github.com/frandiox)! - **Breaking change**: The `setLogger` and `setLoggerOptions` utilities have been removed. The same information can now be passed under the `logger` property in Hydrogen config:
103
+
104
+ ```diff
105
+ // App.server.jsx
106
+
107
+ -import {setLogger, setLoggerOptions} from '@shopify/hydrogen';
108
+
109
+ -setLogger({
110
+ - trace() {},
111
+ - error() {},
112
+ - // ...
113
+ -});
114
+
115
+ -setLoggerOptions({
116
+ - showQueryTiming: true,
117
+ - showCacheControlHeader: true,
118
+ - // ...
119
+ -});
120
+
121
+ function App() {
122
+ // ...
123
+ }
124
+
125
+ export default renderHydrogen(App);
126
+ ```
127
+
128
+ ```diff
129
+ // hydrogen.config.js
130
+
131
+ export default defineConfig({
132
+ // ...
133
+ + logger: {
134
+ + trace() {},
135
+ + error() {},
136
+ + showQueryTiming: true,
137
+ + showCacheControlHeader: true,
138
+ + // ...
139
+ + },
140
+ });
141
+ ```
142
+
143
+ - [#1433](https://github.com/Shopify/hydrogen/pull/1433) [`cd354d3a`](https://github.com/Shopify/hydrogen/commit/cd354d3a6205b5a8ef14426040121ac620c8c158) Thanks [@frandiox](https://github.com/frandiox)! - The `response.writeHead` method has been removed, while `response.status` and `response.statusText` are now writable.
144
+
145
+ ```diff
146
+ function App({response}) {
147
+ - response.writeHead({
148
+ - headers: {'custom-header': 'value'},
149
+ - status: 404,
150
+ - });
151
+ + response.headers.set('custom-header', 'value');
152
+ + response.status = 404;
153
+ }
154
+ ```
155
+
156
+ * [#1418](https://github.com/Shopify/hydrogen/pull/1418) [`512cb009`](https://github.com/Shopify/hydrogen/commit/512cb009fadeb1907fafa2cef8b568081799335f) Thanks [@frandiox](https://github.com/frandiox)! - **Breaking change**: The client configuration, including the `strictMode` option, has been moved from custom client entry handlers to the Hydrogen configuration file. If you had a custom client entry file just to pass client options, you can remove it and do the same in `hydrogen.config.js`:
157
+
158
+ ```diff
159
+ // Custom client entry handler
160
+
161
+ -renderHydrogen(ClientWrapper, {strictMode: false});
162
+ +renderHydrogen(ClientWrapper);
163
+ ```
164
+
165
+ ```diff
166
+ // hydrogen.config.jsx
167
+
168
+ export default defineConfig({
169
+ + strictMode: false,
170
+ });
171
+ ```
172
+
173
+ To remove a custom client entry handler in case it's not needed anymore, delete the custom file and change `index.html`:
174
+
175
+ ```diff
176
+ <body>
177
+ <div id="root"></div>
178
+ - <script type="module" src="/src/custom-client-entry"></script>
179
+ + <script type="module" src="/@shopify/hydrogen/entry-client"></script>
180
+ </body>
181
+ ```
182
+
183
+ - [#1401](https://github.com/Shopify/hydrogen/pull/1401) [`335b70ce`](https://github.com/Shopify/hydrogen/commit/335b70ce67f9f137875fcd18f32e00c1b1b4c533) Thanks [@frandiox](https://github.com/frandiox)! - **Breaking change**: The `enableStreaming` config option has been deprecated. The same feature can be done directly in the app:
184
+
185
+ ```diff
186
+ // hydrogen.config.js
187
+
188
+ export default defineConfig({
189
+ shopify: {
190
+ // ...
191
+ },
192
+ - enableStreaming: (req) => {
193
+ - return req.headers.get('user-agent') !== 'custom bot';
194
+ - },
195
+ });
196
+ ```
197
+
198
+ ```diff
199
+ // App.server.jsx
200
+
201
+ -function App() {
202
+ +function App({request, response}) {
203
+ + if (request.headers.get('user-agent') === 'custom bot') {
204
+ + response.doNotStream();
205
+ + }
206
+
207
+ return <Suspense fallback={'Loading...'}>{/*...*/}</Suspense>;
208
+ }
209
+
210
+ export default renderHydrogen(App);
211
+ ```
212
+
213
+ ### Patch Changes
214
+
215
+ - [#1425](https://github.com/Shopify/hydrogen/pull/1425) [`e213aa86`](https://github.com/Shopify/hydrogen/commit/e213aa8656b17bf649fef714befa99b9618aae45) Thanks [@frandiox](https://github.com/frandiox)! - Rename internal Hydrogen global variables that could conflict with third party libraries that use the same names.
216
+
217
+ * [#1361](https://github.com/Shopify/hydrogen/pull/1361) [`cf2ef664`](https://github.com/Shopify/hydrogen/commit/cf2ef664cd1e91bc53fc34698ac23797c398e74f) Thanks [@frandiox](https://github.com/frandiox)! - Improve component bundling to reduce the total amount of JS files downloaded in the browser.
218
+
219
+ - [#1452](https://github.com/Shopify/hydrogen/pull/1452) [`ed1586a7`](https://github.com/Shopify/hydrogen/commit/ed1586a758fd36bddcc422a75db8a7971ce946d5) Thanks [@frandiox](https://github.com/frandiox)! - Reduce CPU consumption when rendering React Server Components.
220
+
221
+ * [#1399](https://github.com/Shopify/hydrogen/pull/1399) [`583ce40c`](https://github.com/Shopify/hydrogen/commit/583ce40c97391bb22e6e15e736e6237e9a1ea085) Thanks [@frandiox](https://github.com/frandiox)! - Confusing warnings that are not actionable have been removed.
222
+
223
+ - [#1460](https://github.com/Shopify/hydrogen/pull/1460) [`18056879`](https://github.com/Shopify/hydrogen/commit/18056879f1ea1dc54f146184bfdd4f01f24df636) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Fix doc links
224
+
225
+ * [#1444](https://github.com/Shopify/hydrogen/pull/1444) [`0b4ee487`](https://github.com/Shopify/hydrogen/commit/0b4ee4876998923f206f6d28b1a3ef95c9616e59) Thanks [@blittle](https://github.com/blittle)! - Propagate a better error message when the response from the storefront API is not JSON parseable
226
+
227
+ - [#1227](https://github.com/Shopify/hydrogen/pull/1227) [`8eae0a07`](https://github.com/Shopify/hydrogen/commit/8eae0a07ab02e61ac8742e42488825090ca0aa37) Thanks [@jplhomer](https://github.com/jplhomer)! - Enable streaming by default for all platforms
228
+
229
+ * [#1427](https://github.com/Shopify/hydrogen/pull/1427) [`7115d7d8`](https://github.com/Shopify/hydrogen/commit/7115d7d8dc291b7e5b4dda200baf8a906a005cc8) Thanks [@jplhomer](https://github.com/jplhomer)! - Properly support Node v18
230
+
231
+ - [#1424](https://github.com/Shopify/hydrogen/pull/1424) [`446c12bf`](https://github.com/Shopify/hydrogen/commit/446c12bffa08eadccfd27afe8b5f34c77a61d134) Thanks [@frandiox](https://github.com/frandiox)! - Custom loggers can return promises from their methods. Hydrogen will await for them after the current request is over but before the runtime instance ends.
232
+
233
+ * [#1423](https://github.com/Shopify/hydrogen/pull/1423) [`aaf9efa4`](https://github.com/Shopify/hydrogen/commit/aaf9efa45dc9453e95be8e3020c259368ac5f4d0) Thanks [@frandiox](https://github.com/frandiox)! - Workers context (e.g. `waitUntil`) is now scoped to the current request instead of globally available.
234
+
235
+ - [#1330](https://github.com/Shopify/hydrogen/pull/1330) [`c7dc6440`](https://github.com/Shopify/hydrogen/commit/c7dc644059206e7080c33d9f7e0096c168ae593e) Thanks [@ejfranco06](https://github.com/ejfranco06)! - [#1245] - Generate a default srcset for an image returned by the Shopify CDN on the Image component and allow using a custom set of `widths.`
236
+
237
+ ## 0.22.1
238
+
239
+ ### Patch Changes
240
+
241
+ - [#1394](https://github.com/Shopify/hydrogen/pull/1394) [`3a681ac2`](https://github.com/Shopify/hydrogen/commit/3a681ac289cc7850f79bc080a445bc6c0b6926fb) Thanks [@jplhomer](https://github.com/jplhomer)! - Make graphql-tag a dependency instead of a devDependency
242
+
3
243
  ## 0.22.0
4
244
 
5
245
  ### Minor Changes
@@ -1,20 +1,20 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { useCart } from '../CartProvider';
3
- import { useProduct } from '../ProductProvider';
3
+ import { useProductOptions } from '../ProductOptionsProvider';
4
4
  /**
5
5
  * The `AddToCartButton` component renders a button that adds an item to the cart when pressed.
6
6
  * It must be a descendent of the `CartProvider` component.
7
7
  */
8
8
  export function AddToCartButton(props) {
9
- var _a, _b;
9
+ var _a;
10
10
  const [addingItem, setAddingItem] = useState(false);
11
11
  const { variantId: explicitVariantId, quantity = 1, attributes, children, accessibleAddingToCartLabel, ...passthroughProps } = props;
12
12
  const { status, linesAdd } = useCart();
13
- const product = useProduct();
14
- const variantId = (_b = explicitVariantId !== null && explicitVariantId !== void 0 ? explicitVariantId : (_a = product === null || product === void 0 ? void 0 : product.selectedVariant) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
13
+ const { selectedVariant } = useProductOptions();
14
+ const variantId = (_a = explicitVariantId !== null && explicitVariantId !== void 0 ? explicitVariantId : selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.id) !== null && _a !== void 0 ? _a : '';
15
15
  const disabled = explicitVariantId === null ||
16
16
  variantId === '' ||
17
- (product === null || product === void 0 ? void 0 : product.selectedVariant) === null ||
17
+ selectedVariant === null ||
18
18
  addingItem ||
19
19
  passthroughProps.disabled;
20
20
  useEffect(() => {
@@ -8,14 +8,11 @@ import { Money } from '../Money';
8
8
  export function CartLinePrice(props) {
9
9
  const cartLine = useCartLine();
10
10
  const { priceType = 'regular', ...passthroughProps } = props;
11
- const price = priceType === 'regular'
12
- ? cartLine.merchandise.priceV2
13
- : cartLine.merchandise.compareAtPriceV2;
14
- if (price == null) {
11
+ const moneyV2 = priceType === 'regular'
12
+ ? cartLine.estimatedCost.totalAmount
13
+ : cartLine.estimatedCost.compareAtAmount;
14
+ if (moneyV2 == null) {
15
15
  return null;
16
16
  }
17
- return (React.createElement(Money, { ...passthroughProps, data: {
18
- amount: `${parseFloat(price.amount) * cartLine.quantity}`,
19
- currencyCode: price.currencyCode,
20
- } }));
17
+ return React.createElement(Money, { ...passthroughProps, data: moneyV2 });
21
18
  }
@@ -4,15 +4,25 @@ export declare const CartLineContext: import("react").Context<({
4
4
  attributes: ({
5
5
  __typename?: "Attribute" | undefined;
6
6
  } & Pick<import("../../storefront-api-types").Attribute, "key" | "value">)[];
7
+ estimatedCost: {
8
+ __typename?: "CartLineEstimatedCost" | undefined;
9
+ } & {
10
+ totalAmount: {
11
+ __typename?: "MoneyV2" | undefined;
12
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">;
13
+ compareAtAmount?: import("../../storefront-api-types").Maybe<{
14
+ __typename?: "MoneyV2" | undefined;
15
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">> | undefined;
16
+ };
7
17
  merchandise: {
8
18
  __typename?: "ProductVariant" | undefined;
9
19
  } & Pick<import("../../storefront-api-types").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
10
20
  compareAtPriceV2?: import("../../storefront-api-types").Maybe<{
11
21
  __typename?: "MoneyV2" | undefined;
12
- } & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">> | undefined;
22
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">> | undefined;
13
23
  priceV2: {
14
24
  __typename?: "MoneyV2" | undefined;
15
- } & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">;
25
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">;
16
26
  image?: import("../../storefront-api-types").Maybe<{
17
27
  __typename?: "Image" | undefined;
18
28
  } & Pick<import("../../storefront-api-types").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
@@ -1 +1 @@
1
- export { CartLines } from './CartLines';
1
+ export { CartLines } from './CartLines.client';
@@ -1 +1 @@
1
- export { CartLines } from './CartLines';
1
+ export { CartLines } from './CartLines.client';
@@ -453,6 +453,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
453
453
  // eslint-disable-next-line react-hooks/exhaustive-deps
454
454
  }, [countryCode, customerAccessToken]);
455
455
  const cartContextValue = useMemo(() => {
456
+ var _a, _b;
456
457
  return {
457
458
  ...('cart' in state
458
459
  ? state.cart
@@ -463,11 +464,7 @@ export function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLi
463
464
  }),
464
465
  status: state.status,
465
466
  error: 'error' in state ? state.error : undefined,
466
- totalQuantity: 'cart' in state
467
- ? state.cart.lines.reduce((previous, current) => {
468
- return previous + current.quantity;
469
- }, 0)
470
- : 0,
467
+ totalQuantity: 'cart' in state ? (_b = (_a = state === null || state === void 0 ? void 0 : state.cart) === null || _a === void 0 ? void 0 : _a.totalQuantity) !== null && _b !== void 0 ? _b : 0 : 0,
471
468
  cartCreate,
472
469
  linesAdd(lines) {
473
470
  if ('cart' in state && state.cart.id) {
@@ -7,4 +7,4 @@ export declare const CartBuyerIdentityUpdate: (cartFragment: string) => string;
7
7
  export declare const CartAttributesUpdate: (cartFragment: string) => string;
8
8
  export declare const CartDiscountCodesUpdate: (cartFragment: string) => string;
9
9
  export declare const CartQuery: (cartFragment: string) => string;
10
- export declare const defaultCartFragment = "\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";
10
+ export declare const defaultCartFragment = "\nfragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\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 estimatedCost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmount {\n amount\n currencyCode\n }\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";
@@ -104,6 +104,7 @@ export const defaultCartFragment = `
104
104
  fragment CartFragment on Cart {
105
105
  id
106
106
  checkoutUrl
107
+ totalQuantity
107
108
  buyerIdentity {
108
109
  countryCode
109
110
  customer {
@@ -125,6 +126,16 @@ fragment CartFragment on Cart {
125
126
  key
126
127
  value
127
128
  }
129
+ estimatedCost {
130
+ totalAmount {
131
+ amount
132
+ currencyCode
133
+ }
134
+ compareAtAmount {
135
+ amount
136
+ currencyCode
137
+ }
138
+ }
128
139
  merchandise {
129
140
  ... on ProductVariant {
130
141
  id
@@ -17,7 +17,7 @@ export declare type CartAttributesUpdateMutation = {
17
17
  } & {
18
18
  cart?: Types.Maybe<{
19
19
  __typename?: 'Cart';
20
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
21
21
  buyerIdentity: {
22
22
  __typename?: 'CartBuyerIdentity';
23
23
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -37,6 +37,16 @@ export declare type CartAttributesUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ estimatedCost: {
41
+ __typename?: 'CartLineEstimatedCost';
42
+ } & {
43
+ totalAmount: {
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
+ compareAtAmount?: Types.Maybe<{
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
+ };
40
50
  merchandise: {
41
51
  __typename?: 'ProductVariant';
42
52
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -17,7 +17,7 @@ export declare type CartBuyerIdentityUpdateMutation = {
17
17
  } & {
18
18
  cart?: Types.Maybe<{
19
19
  __typename?: 'Cart';
20
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
21
21
  buyerIdentity: {
22
22
  __typename?: 'CartBuyerIdentity';
23
23
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -37,6 +37,16 @@ export declare type CartBuyerIdentityUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ estimatedCost: {
41
+ __typename?: 'CartLineEstimatedCost';
42
+ } & {
43
+ totalAmount: {
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
+ compareAtAmount?: Types.Maybe<{
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
+ };
40
50
  merchandise: {
41
51
  __typename?: 'ProductVariant';
42
52
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -16,7 +16,7 @@ export declare type CartCreateMutation = {
16
16
  } & {
17
17
  cart?: Types.Maybe<{
18
18
  __typename?: 'Cart';
19
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
19
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
20
20
  buyerIdentity: {
21
21
  __typename?: 'CartBuyerIdentity';
22
22
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -36,6 +36,16 @@ export declare type CartCreateMutation = {
36
36
  attributes: Array<{
37
37
  __typename?: 'Attribute';
38
38
  } & Pick<Types.Attribute, 'key' | 'value'>>;
39
+ estimatedCost: {
40
+ __typename?: 'CartLineEstimatedCost';
41
+ } & {
42
+ totalAmount: {
43
+ __typename?: 'MoneyV2';
44
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
45
+ compareAtAmount?: Types.Maybe<{
46
+ __typename?: 'MoneyV2';
47
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
48
+ };
39
49
  merchandise: {
40
50
  __typename?: 'ProductVariant';
41
51
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -17,7 +17,7 @@ export declare type CartDiscountCodesUpdateMutation = {
17
17
  } & {
18
18
  cart?: Types.Maybe<{
19
19
  __typename?: 'Cart';
20
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
21
21
  buyerIdentity: {
22
22
  __typename?: 'CartBuyerIdentity';
23
23
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -37,6 +37,16 @@ export declare type CartDiscountCodesUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ estimatedCost: {
41
+ __typename?: 'CartLineEstimatedCost';
42
+ } & {
43
+ totalAmount: {
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
+ compareAtAmount?: Types.Maybe<{
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
+ };
40
50
  merchandise: {
41
51
  __typename?: 'ProductVariant';
42
52
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -5,7 +5,7 @@
5
5
  import * as Types from '../../../storefront-api-types';
6
6
  export declare type CartFragmentFragment = {
7
7
  __typename?: 'Cart';
8
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
8
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
9
9
  buyerIdentity: {
10
10
  __typename?: 'CartBuyerIdentity';
11
11
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -25,6 +25,16 @@ export declare type CartFragmentFragment = {
25
25
  attributes: Array<{
26
26
  __typename?: 'Attribute';
27
27
  } & Pick<Types.Attribute, 'key' | 'value'>>;
28
+ estimatedCost: {
29
+ __typename?: 'CartLineEstimatedCost';
30
+ } & {
31
+ totalAmount: {
32
+ __typename?: 'MoneyV2';
33
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
34
+ compareAtAmount?: Types.Maybe<{
35
+ __typename?: 'MoneyV2';
36
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
37
+ };
28
38
  merchandise: {
29
39
  __typename?: 'ProductVariant';
30
40
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -17,7 +17,7 @@ export declare type CartLineAddMutation = {
17
17
  } & {
18
18
  cart?: Types.Maybe<{
19
19
  __typename?: 'Cart';
20
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
21
21
  buyerIdentity: {
22
22
  __typename?: 'CartBuyerIdentity';
23
23
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -37,6 +37,16 @@ export declare type CartLineAddMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ estimatedCost: {
41
+ __typename?: 'CartLineEstimatedCost';
42
+ } & {
43
+ totalAmount: {
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
+ compareAtAmount?: Types.Maybe<{
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
+ };
40
50
  merchandise: {
41
51
  __typename?: 'ProductVariant';
42
52
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -17,7 +17,7 @@ export declare type CartLineRemoveMutation = {
17
17
  } & {
18
18
  cart?: Types.Maybe<{
19
19
  __typename?: 'Cart';
20
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
21
21
  buyerIdentity: {
22
22
  __typename?: 'CartBuyerIdentity';
23
23
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -37,6 +37,16 @@ export declare type CartLineRemoveMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ estimatedCost: {
41
+ __typename?: 'CartLineEstimatedCost';
42
+ } & {
43
+ totalAmount: {
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
+ compareAtAmount?: Types.Maybe<{
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
+ };
40
50
  merchandise: {
41
51
  __typename?: 'ProductVariant';
42
52
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
@@ -17,7 +17,7 @@ export declare type CartLineUpdateMutation = {
17
17
  } & {
18
18
  cart?: Types.Maybe<{
19
19
  __typename?: 'Cart';
20
- } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
20
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'> & {
21
21
  buyerIdentity: {
22
22
  __typename?: 'CartBuyerIdentity';
23
23
  } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
@@ -37,6 +37,16 @@ export declare type CartLineUpdateMutation = {
37
37
  attributes: Array<{
38
38
  __typename?: 'Attribute';
39
39
  } & Pick<Types.Attribute, 'key' | 'value'>>;
40
+ estimatedCost: {
41
+ __typename?: 'CartLineEstimatedCost';
42
+ } & {
43
+ totalAmount: {
44
+ __typename?: 'MoneyV2';
45
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>;
46
+ compareAtAmount?: Types.Maybe<{
47
+ __typename?: 'MoneyV2';
48
+ } & Pick<Types.MoneyV2, 'amount' | 'currencyCode'>>;
49
+ };
40
50
  merchandise: {
41
51
  __typename?: 'ProductVariant';
42
52
  } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {