@shopify/hydrogen 1.0.0-alpha.21 → 1.0.1

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 (789) hide show
  1. package/CHANGELOG.md +2206 -0
  2. package/README.md +2 -2
  3. package/dist/esnext/FileSessionStorage.d.ts +1 -0
  4. package/dist/esnext/FileSessionStorage.js +1 -0
  5. package/dist/esnext/client.d.ts +14 -5
  6. package/dist/esnext/client.js +14 -5
  7. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +12 -7
  8. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +40 -36
  9. package/dist/esnext/components/AddToCartButton/index.d.ts +1 -1
  10. package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +14 -0
  11. package/dist/esnext/components/BaseButton/BaseButton.client.js +15 -0
  12. package/dist/esnext/components/BaseButton/index.d.ts +1 -0
  13. package/dist/esnext/components/BaseButton/index.js +1 -0
  14. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +15 -0
  15. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +27 -0
  16. package/dist/esnext/components/BuyNowButton/index.d.ts +1 -1
  17. package/dist/esnext/components/BuyNowButton/index.js +1 -1
  18. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +7 -3
  19. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +9 -6
  20. package/dist/esnext/components/CartCost/CartCost.client.d.ts +14 -0
  21. package/dist/esnext/components/CartCost/CartCost.client.js +29 -0
  22. package/dist/esnext/components/CartCost/index.d.ts +1 -0
  23. package/dist/esnext/components/CartCost/index.js +1 -0
  24. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +9 -6
  25. package/dist/esnext/components/CartLineImage/CartLineImage.client.js +6 -3
  26. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +10 -4
  27. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +9 -8
  28. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -3
  29. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +4 -0
  30. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +5 -0
  31. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +3 -0
  32. package/dist/esnext/components/CartLineProvider/context.d.ts +20 -10
  33. package/dist/esnext/components/CartLineProvider/index.d.ts +1 -1
  34. package/dist/esnext/components/CartLineProvider/index.js +1 -1
  35. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -3
  36. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +4 -0
  37. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +9 -4
  38. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +22 -13
  39. package/dist/esnext/components/CartLines/CartLines.client.d.ts +15 -0
  40. package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +7 -5
  41. package/dist/esnext/components/CartLines/index.d.ts +1 -1
  42. package/dist/esnext/components/CartLines/index.js +1 -1
  43. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +37 -3
  44. package/dist/esnext/components/CartProvider/CartProvider.client.js +474 -370
  45. package/dist/esnext/components/CartProvider/cart-queries.d.ts +10 -0
  46. package/dist/esnext/components/CartProvider/cart-queries.js +202 -0
  47. package/dist/esnext/components/CartProvider/constants.d.ts +1 -1
  48. package/dist/esnext/components/CartProvider/constants.js +1 -1
  49. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +82 -4
  50. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +82 -4
  51. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +82 -4
  52. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +83 -5
  53. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +22 -8
  54. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +82 -4
  55. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +82 -4
  56. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +82 -4
  57. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +83 -5
  58. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +82 -4
  59. package/dist/esnext/components/CartProvider/hooks.client.d.ts +15 -0
  60. package/dist/esnext/components/CartProvider/hooks.client.js +71 -0
  61. package/dist/esnext/components/CartProvider/index.d.ts +3 -3
  62. package/dist/esnext/components/CartProvider/index.js +2 -3
  63. package/dist/esnext/components/CartProvider/types.d.ts +48 -49
  64. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +7 -2
  65. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +11 -4
  66. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +16 -9
  67. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +11 -6
  68. package/dist/esnext/components/ExternalVideo/index.d.ts +1 -1
  69. package/dist/esnext/components/Image/Image.d.ts +103 -12
  70. package/dist/esnext/components/Image/Image.js +133 -7
  71. package/dist/esnext/components/Image/index.d.ts +2 -1
  72. package/dist/esnext/components/Link/Link.client.d.ts +27 -0
  73. package/dist/esnext/components/Link/Link.client.js +145 -0
  74. package/dist/esnext/components/Link/index.d.ts +1 -0
  75. package/dist/esnext/components/Link/index.js +1 -0
  76. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +2 -2
  77. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +3 -12
  78. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -5
  79. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +19 -2
  80. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +24 -5
  81. package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
  82. package/dist/esnext/components/LocalizationProvider/index.js +0 -1
  83. package/dist/esnext/components/MediaFile/MediaFile.d.ts +18 -18
  84. package/dist/esnext/components/MediaFile/MediaFile.js +20 -10
  85. package/dist/esnext/components/MediaFile/index.d.ts +1 -1
  86. package/dist/esnext/components/Metafield/Metafield.client.d.ts +17 -0
  87. package/dist/esnext/components/Metafield/Metafield.client.js +104 -0
  88. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +12 -0
  89. package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +48 -0
  90. package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +1 -0
  91. package/dist/esnext/components/Metafield/components/StarRating/index.js +1 -0
  92. package/dist/esnext/components/Metafield/components/index.d.ts +1 -0
  93. package/dist/esnext/components/Metafield/components/index.js +1 -0
  94. package/dist/esnext/components/Metafield/index.d.ts +2 -0
  95. package/dist/esnext/components/Metafield/index.js +1 -0
  96. package/dist/esnext/components/Metafield/types.d.ts +4 -0
  97. package/dist/esnext/components/{ProductProvider → Metafield}/types.js +0 -0
  98. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  99. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +104 -0
  100. package/dist/esnext/components/ModelViewer/index.d.ts +1 -0
  101. package/dist/esnext/components/ModelViewer/index.js +1 -0
  102. package/dist/esnext/components/Money/Money.client.d.ts +24 -6
  103. package/dist/esnext/components/Money/Money.client.js +36 -7
  104. package/dist/esnext/components/Money/index.d.ts +1 -1
  105. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  106. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +133 -0
  107. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
  108. package/dist/esnext/components/ProductOptionsProvider/context.js +2 -0
  109. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
  110. package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
  111. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +15 -4
  112. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +35 -13
  113. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +3 -0
  114. package/dist/esnext/components/Seo/CollectionSeo.client.js +14 -0
  115. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  116. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +18 -0
  117. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +4 -0
  118. package/dist/esnext/components/Seo/DescriptionSeo.client.js +10 -0
  119. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +2 -0
  120. package/dist/esnext/components/Seo/HomePageSeo.client.js +25 -0
  121. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +3 -0
  122. package/dist/esnext/components/Seo/ImageSeo.client.js +10 -0
  123. package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +3 -0
  124. package/dist/esnext/components/Seo/NoIndexSeo.client.js +10 -0
  125. package/dist/esnext/components/Seo/PageSeo.client.d.ts +3 -0
  126. package/dist/esnext/components/Seo/PageSeo.client.js +12 -0
  127. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +5 -0
  128. package/dist/esnext/components/Seo/ProductSeo.client.js +62 -0
  129. package/dist/esnext/components/Seo/Seo.client.d.ts +30 -0
  130. package/dist/esnext/components/Seo/Seo.client.js +31 -0
  131. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +3 -0
  132. package/dist/esnext/components/Seo/TitleSeo.client.js +10 -0
  133. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +2 -0
  134. package/dist/esnext/components/Seo/TwitterSeo.client.js +9 -0
  135. package/dist/esnext/components/Seo/index.d.ts +1 -0
  136. package/dist/esnext/components/Seo/index.js +1 -0
  137. package/dist/esnext/components/Seo/seo-types.d.ts +18 -0
  138. package/dist/esnext/components/{ExternalVideo/ExternalVideoFragment.js → Seo/seo-types.js} +0 -0
  139. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +29 -4
  140. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +50 -26
  141. package/dist/esnext/components/ShopPayButton/index.d.ts +1 -1
  142. package/dist/esnext/components/Video/Video.d.ts +13 -12
  143. package/dist/esnext/components/Video/Video.js +21 -6
  144. package/dist/esnext/components/Video/index.d.ts +1 -1
  145. package/dist/esnext/components/index.d.ts +28 -44
  146. package/dist/esnext/components/index.js +26 -86
  147. package/dist/esnext/components/types.d.ts +4 -6
  148. package/dist/esnext/components/types.js +1 -1
  149. package/dist/esnext/config.d.ts +7 -0
  150. package/dist/esnext/config.js +5 -0
  151. package/dist/esnext/constants.d.ts +13 -0
  152. package/dist/esnext/constants.js +13 -0
  153. package/dist/esnext/entry-client.js +145 -23
  154. package/dist/esnext/entry-server.d.ts +5 -2
  155. package/dist/esnext/entry-server.js +570 -247
  156. package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +3 -0
  157. package/dist/esnext/foundation/Analytics/Analytics.client.js +30 -0
  158. package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +1 -0
  159. package/dist/esnext/foundation/Analytics/Analytics.server.js +47 -0
  160. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +27 -0
  161. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +99 -0
  162. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +4 -0
  163. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +51 -0
  164. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  165. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +81 -0
  166. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  167. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +23 -0
  168. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +3 -0
  169. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +7 -0
  170. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +3 -0
  171. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +7 -0
  172. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
  173. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +182 -0
  174. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
  175. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +43 -0
  176. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +26 -0
  177. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +49 -0
  178. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
  179. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
  180. package/dist/esnext/foundation/Analytics/const.d.ts +9 -0
  181. package/dist/esnext/foundation/Analytics/const.js +9 -0
  182. package/dist/esnext/foundation/Analytics/hook.d.ts +1 -0
  183. package/dist/esnext/foundation/Analytics/hook.js +9 -0
  184. package/dist/esnext/foundation/Analytics/index.d.ts +1 -0
  185. package/dist/esnext/foundation/Analytics/index.js +1 -0
  186. package/dist/esnext/foundation/Analytics/types.d.ts +5 -0
  187. package/dist/{worker → esnext/foundation/Analytics}/types.js +0 -0
  188. package/dist/esnext/foundation/Analytics/utils.d.ts +3 -0
  189. package/dist/esnext/foundation/Analytics/utils.js +29 -0
  190. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +4 -0
  191. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +8 -0
  192. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +2 -0
  193. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +23 -0
  194. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.d.ts +1 -0
  195. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.js +3 -0
  196. package/dist/esnext/foundation/Cache/cache-sub-request.d.ts +17 -0
  197. package/dist/esnext/foundation/Cache/cache-sub-request.js +64 -0
  198. package/dist/esnext/foundation/Cache/cache.d.ts +17 -0
  199. package/dist/esnext/foundation/Cache/cache.js +127 -0
  200. package/dist/esnext/foundation/Cache/strategies/index.d.ts +7 -0
  201. package/dist/esnext/foundation/Cache/strategies/index.js +54 -0
  202. package/dist/esnext/foundation/Cookie/Cookie.d.ts +48 -0
  203. package/dist/esnext/foundation/Cookie/Cookie.js +72 -0
  204. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +5 -0
  205. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +31 -0
  206. package/dist/esnext/foundation/DevTools/DevTools.client.d.ts +3 -0
  207. package/dist/esnext/foundation/DevTools/DevTools.client.js +17 -0
  208. package/dist/esnext/foundation/DevTools/DevTools.server.d.ts +1 -0
  209. package/dist/esnext/foundation/DevTools/DevTools.server.js +14 -0
  210. package/dist/esnext/foundation/DevTools/components/GraphQL.client.d.ts +1 -0
  211. package/dist/esnext/foundation/DevTools/components/GraphQL.client.js +25 -0
  212. package/dist/esnext/foundation/DevTools/components/Heading.d.ts +5 -0
  213. package/dist/esnext/foundation/DevTools/components/Heading.js +12 -0
  214. package/dist/esnext/foundation/DevTools/components/Interface.client.d.ts +11 -0
  215. package/dist/esnext/foundation/DevTools/components/Interface.client.js +47 -0
  216. package/dist/esnext/foundation/DevTools/components/Panels.d.ts +8 -0
  217. package/dist/esnext/foundation/DevTools/components/Panels.js +60 -0
  218. package/dist/esnext/foundation/DevTools/components/Performance.client.d.ts +14 -0
  219. package/dist/esnext/foundation/DevTools/components/Performance.client.js +26 -0
  220. package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +7 -0
  221. package/dist/esnext/foundation/DevTools/components/Settings.client.js +20 -0
  222. package/dist/esnext/foundation/DevTools/components/Table.d.ts +9 -0
  223. package/dist/esnext/foundation/DevTools/components/Table.js +7 -0
  224. package/dist/esnext/foundation/DevTools/components/icons.d.ts +2 -0
  225. package/dist/esnext/foundation/DevTools/components/icons.js +13 -0
  226. package/dist/esnext/foundation/DevTools/components/index.d.ts +2 -0
  227. package/dist/esnext/foundation/DevTools/components/index.js +2 -0
  228. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  229. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +69 -0
  230. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +6 -0
  231. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +149 -0
  232. package/dist/esnext/foundation/Head/Head.client.d.ts +5 -0
  233. package/dist/esnext/foundation/Head/Head.client.js +10 -0
  234. package/dist/esnext/foundation/Head/index.d.ts +1 -0
  235. package/dist/esnext/foundation/Head/index.js +1 -0
  236. package/dist/esnext/foundation/Html/Html.d.ts +13 -0
  237. package/dist/esnext/foundation/Html/Html.js +96 -0
  238. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +76 -0
  239. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +210 -0
  240. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +21 -0
  241. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +48 -0
  242. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +5 -0
  243. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +53 -0
  244. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  245. package/dist/esnext/foundation/Redirect/Redirect.client.js +15 -0
  246. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  247. package/dist/esnext/foundation/Route/Route.server.js +28 -0
  248. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +14 -0
  249. package/dist/esnext/foundation/Router/BrowserRouter.client.js +138 -0
  250. package/dist/esnext/foundation/Router/Router.server.d.ts +10 -0
  251. package/dist/esnext/foundation/Router/Router.server.js +8 -0
  252. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +41 -0
  253. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +65 -0
  254. package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +2 -0
  255. package/dist/esnext/foundation/ServerPropsProvider/index.js +1 -0
  256. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +23 -0
  257. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +125 -0
  258. package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +1 -0
  259. package/dist/esnext/foundation/ServerRequestProvider/index.js +1 -0
  260. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +30 -0
  261. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +59 -0
  262. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  263. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +8 -0
  264. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +16 -0
  265. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +60 -0
  266. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +1 -2
  267. package/dist/esnext/foundation/ShopifyProvider/index.js +1 -2
  268. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +12 -10
  269. package/dist/esnext/foundation/constants.d.ts +2 -0
  270. package/dist/esnext/foundation/constants.js +4 -0
  271. package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  272. package/dist/esnext/foundation/fetchSync/client/fetchSync.js +28 -0
  273. package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  274. package/dist/esnext/foundation/fetchSync/server/fetchSync.js +32 -0
  275. package/dist/esnext/foundation/fetchSync/types.d.ts +5 -0
  276. package/dist/esnext/{components/Image/ImageFragment.js → foundation/fetchSync/types.js} +0 -0
  277. package/dist/esnext/foundation/index.d.ts +3 -4
  278. package/dist/esnext/foundation/index.js +3 -4
  279. package/dist/esnext/foundation/runtime.d.ts +2 -0
  280. package/dist/esnext/foundation/runtime.js +6 -0
  281. package/dist/esnext/foundation/session/session.d.ts +27 -0
  282. package/dist/esnext/foundation/session/session.js +37 -0
  283. package/dist/esnext/foundation/ssr-interop.d.ts +29 -0
  284. package/dist/esnext/foundation/ssr-interop.js +35 -0
  285. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +17 -0
  286. package/dist/esnext/foundation/useNavigate/useNavigate.js +39 -0
  287. package/dist/esnext/foundation/useQuery/hooks.d.ts +37 -0
  288. package/dist/esnext/foundation/useQuery/hooks.js +105 -0
  289. package/dist/esnext/foundation/useQuery/index.d.ts +1 -0
  290. package/dist/esnext/foundation/useQuery/index.js +1 -0
  291. package/dist/esnext/foundation/useRequestContext/index.d.ts +15 -0
  292. package/dist/esnext/foundation/useRequestContext/index.js +23 -0
  293. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +13 -0
  294. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +12 -0
  295. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  296. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  297. package/dist/esnext/foundation/useServerProps/index.d.ts +1 -0
  298. package/dist/esnext/foundation/useServerProps/index.js +1 -0
  299. package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +21 -0
  300. package/dist/esnext/foundation/useServerProps/use-server-props.js +35 -0
  301. package/dist/esnext/foundation/useSession/useSession.d.ts +2 -0
  302. package/dist/esnext/foundation/useSession/useSession.js +7 -0
  303. package/dist/esnext/foundation/useShop/index.d.ts +1 -0
  304. package/dist/esnext/foundation/useShop/index.js +1 -0
  305. package/dist/esnext/foundation/useShop/use-shop.d.ts +6 -0
  306. package/dist/esnext/foundation/useShop/use-shop.js +14 -0
  307. package/dist/esnext/foundation/useUrl/index.d.ts +1 -0
  308. package/dist/esnext/foundation/useUrl/index.js +1 -0
  309. package/dist/esnext/foundation/useUrl/useUrl.d.ts +4 -0
  310. package/dist/esnext/foundation/useUrl/useUrl.js +29 -0
  311. package/dist/esnext/framework/cache/in-memory.d.ts +17 -0
  312. package/dist/esnext/framework/cache/in-memory.js +80 -0
  313. package/dist/esnext/framework/graphiql.d.ts +1 -1
  314. package/dist/esnext/framework/graphiql.js +1 -2
  315. package/dist/esnext/framework/load-config.d.ts +5 -0
  316. package/dist/esnext/framework/load-config.js +7 -0
  317. package/dist/esnext/framework/middleware.d.ts +11 -7
  318. package/dist/esnext/framework/middleware.js +49 -68
  319. package/dist/esnext/framework/plugin.d.ts +8 -3
  320. package/dist/esnext/framework/plugin.js +23 -4
  321. package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  322. package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +25 -0
  323. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  324. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +98 -0
  325. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  326. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +35 -0
  327. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  328. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.js +36 -0
  329. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +1 -1
  330. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +79 -20
  331. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +10 -3
  332. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +47 -7
  333. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +2 -0
  334. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +23 -0
  335. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  336. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
  337. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +7 -0
  338. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +101 -0
  339. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  340. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +70 -0
  341. package/dist/esnext/framework/plugins/{vite-plugin-react-server-components-shim.d.ts → vite-plugin-purge-query-cache.d.ts} +0 -0
  342. package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.js +11 -0
  343. package/dist/{node/framework/plugins/vite-plugin-react-server-components-shim.d.ts → esnext/framework/plugins/vite-plugin-ssr-interop.d.ts} +0 -0
  344. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +16 -0
  345. package/dist/esnext/framework/types.d.ts +6 -0
  346. package/dist/esnext/{components/LocalizationProvider/LocalizationQuery.js → framework/types.js} +0 -0
  347. package/dist/esnext/framework/viteception.d.ts +5 -0
  348. package/dist/esnext/framework/viteception.js +16 -0
  349. package/dist/esnext/hooks/index.d.ts +5 -4
  350. package/dist/esnext/hooks/index.js +5 -4
  351. package/dist/esnext/hooks/useCart/index.d.ts +1 -0
  352. package/dist/esnext/hooks/useCart/index.js +1 -0
  353. package/dist/esnext/hooks/useCart/useCart.d.ts +4 -0
  354. package/dist/esnext/hooks/useCart/useCart.js +12 -0
  355. package/dist/esnext/hooks/useCartLine/index.d.ts +1 -0
  356. package/dist/esnext/hooks/useCartLine/index.js +1 -0
  357. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +39 -0
  358. package/dist/esnext/{components/CartLineProvider/hooks.js → hooks/useCartLine/useCartLine.js} +4 -1
  359. package/dist/esnext/hooks/useLoadScript/index.d.ts +1 -0
  360. package/dist/esnext/hooks/useLoadScript/index.js +1 -0
  361. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  362. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +23 -0
  363. package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +4 -0
  364. package/dist/esnext/hooks/useLocalization/useLocalization.js +14 -0
  365. package/dist/esnext/hooks/useMeasurement/hooks.d.ts +9 -0
  366. package/dist/esnext/hooks/useMeasurement/hooks.js +13 -0
  367. package/dist/esnext/hooks/useMeasurement/index.d.ts +1 -0
  368. package/dist/esnext/hooks/useMeasurement/index.js +1 -0
  369. package/dist/esnext/hooks/useMoney/hooks.d.ts +44 -1
  370. package/dist/esnext/hooks/useMoney/hooks.js +69 -22
  371. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -4
  372. package/dist/esnext/hooks/useProductOptions/helpers.js +9 -6
  373. package/dist/esnext/hooks/useProductOptions/index.d.ts +1 -1
  374. package/dist/esnext/hooks/useProductOptions/index.js +1 -1
  375. package/dist/esnext/hooks/useProductOptions/types.d.ts +42 -46
  376. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -0
  377. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +9 -0
  378. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +22 -3
  379. package/dist/esnext/hooks/useShopQuery/hooks.js +163 -24
  380. package/dist/esnext/hooks/useShopQuery/index.d.ts +1 -1
  381. package/dist/esnext/hooks/useShopQuery/index.js +1 -1
  382. package/dist/esnext/index.d.ts +41 -8
  383. package/dist/esnext/index.js +37 -10
  384. package/dist/esnext/node.d.ts +1 -0
  385. package/dist/esnext/node.js +1 -0
  386. package/dist/esnext/platforms/node.d.ts +9 -0
  387. package/dist/esnext/platforms/node.js +41 -0
  388. package/dist/esnext/{components/MediaFile/MediaFileFragment.js → platforms/worker-event.d.ts} +0 -0
  389. package/dist/esnext/platforms/worker-event.js +3 -0
  390. package/dist/esnext/platforms/worker.d.ts +14 -0
  391. package/dist/esnext/platforms/worker.js +25 -0
  392. package/dist/esnext/shared-types.d.ts +27 -0
  393. package/dist/esnext/shared-types.js +4 -0
  394. package/dist/esnext/{graphql/types/types.d.ts → storefront-api-types.d.ts} +2404 -1886
  395. package/dist/esnext/{graphql/types/types.js → storefront-api-types.js} +1079 -722
  396. package/dist/esnext/streaming.server.d.ts +16 -0
  397. package/dist/esnext/streaming.server.js +24 -0
  398. package/dist/esnext/types.d.ts +102 -35
  399. package/dist/esnext/types.js +1 -1
  400. package/dist/esnext/utilities/apiRoutes.d.ts +42 -0
  401. package/dist/esnext/utilities/apiRoutes.js +152 -0
  402. package/dist/esnext/utilities/bot-ua.d.ts +4 -0
  403. package/dist/esnext/utilities/bot-ua.js +61 -0
  404. package/dist/esnext/utilities/defer.d.ts +6 -0
  405. package/dist/esnext/utilities/defer.js +14 -0
  406. package/dist/esnext/utilities/devtools.d.ts +11 -0
  407. package/dist/esnext/utilities/devtools.js +11 -0
  408. package/dist/esnext/utilities/empty-hydrogen-config.d.ts +2 -0
  409. package/dist/esnext/utilities/empty-hydrogen-config.js +2 -0
  410. package/dist/esnext/utilities/error.d.ts +1 -0
  411. package/dist/esnext/utilities/error.js +6 -0
  412. package/dist/esnext/utilities/fetch.d.ts +9 -0
  413. package/dist/esnext/utilities/fetch.js +31 -0
  414. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +7 -0
  415. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +18 -0
  416. package/dist/esnext/utilities/flattenConnection/index.d.ts +1 -0
  417. package/dist/esnext/utilities/flattenConnection/index.js +1 -0
  418. package/dist/esnext/utilities/graphql-tag.d.ts +1 -0
  419. package/dist/esnext/utilities/graphql-tag.js +6 -0
  420. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  421. package/dist/esnext/utilities/graphql-tracker.js +121 -0
  422. package/dist/esnext/utilities/hash.d.ts +2 -0
  423. package/dist/esnext/utilities/hash.js +30 -0
  424. package/dist/esnext/utilities/html-encoding.d.ts +1 -0
  425. package/dist/esnext/utilities/html-encoding.js +8 -0
  426. package/dist/esnext/utilities/image_size.d.ts +30 -14
  427. package/dist/esnext/utilities/image_size.js +80 -30
  428. package/dist/esnext/utilities/index.d.ts +10 -4
  429. package/dist/esnext/utilities/index.js +10 -4
  430. package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
  431. package/dist/esnext/utilities/isBrowser/index.js +1 -0
  432. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
  433. package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
  434. package/dist/esnext/utilities/isServer/index.d.ts +1 -0
  435. package/dist/esnext/utilities/isServer/index.js +1 -0
  436. package/dist/esnext/utilities/isServer/isServer.d.ts +4 -0
  437. package/dist/esnext/utilities/isServer/isServer.js +7 -0
  438. package/dist/esnext/utilities/{script_loader.d.ts → load_script.d.ts} +0 -0
  439. package/dist/esnext/utilities/{script_loader.js → load_script.js} +1 -1
  440. package/dist/esnext/utilities/log/index.d.ts +4 -0
  441. package/dist/esnext/utilities/log/index.js +4 -0
  442. package/dist/esnext/utilities/log/log-cache-api-status.d.ts +1 -0
  443. package/dist/esnext/utilities/log/log-cache-api-status.js +17 -0
  444. package/dist/esnext/utilities/log/log-cache-header.d.ts +10 -0
  445. package/dist/esnext/utilities/log/log-cache-header.js +30 -0
  446. package/dist/esnext/utilities/log/log-query-timeline.d.ts +12 -0
  447. package/dist/esnext/utilities/log/log-query-timeline.js +102 -0
  448. package/dist/esnext/utilities/log/log.d.ts +28 -0
  449. package/dist/esnext/utilities/log/log.js +74 -0
  450. package/dist/esnext/utilities/log/utils.d.ts +3 -0
  451. package/dist/esnext/utilities/log/utils.js +11 -0
  452. package/dist/esnext/utilities/matchPath.d.ts +10 -0
  453. package/dist/esnext/utilities/matchPath.js +54 -0
  454. package/dist/esnext/utilities/measurement.d.ts +3 -0
  455. package/dist/esnext/utilities/measurement.js +98 -0
  456. package/dist/esnext/utilities/object.d.ts +5 -0
  457. package/dist/esnext/utilities/object.js +7 -0
  458. package/dist/esnext/utilities/parse.d.ts +1 -0
  459. package/dist/esnext/utilities/parse.js +9 -0
  460. package/dist/esnext/utilities/parseMetafield/index.d.ts +1 -0
  461. package/dist/esnext/utilities/parseMetafield/index.js +1 -0
  462. package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +15 -0
  463. package/dist/esnext/utilities/parseMetafield/parseMetafield.js +62 -0
  464. package/dist/esnext/utilities/storefrontApi.d.ts +5 -0
  465. package/dist/esnext/utilities/storefrontApi.js +26 -0
  466. package/dist/esnext/utilities/suspense.d.ts +7 -2
  467. package/dist/esnext/utilities/suspense.js +32 -6
  468. package/dist/esnext/utilities/template.d.ts +9 -0
  469. package/dist/esnext/utilities/template.js +22 -0
  470. package/dist/esnext/utilities/timing.d.ts +7 -0
  471. package/dist/esnext/utilities/timing.js +14 -0
  472. package/dist/esnext/{components/Model3D/Model3DFragment.js → utilities/web-api-polyfill.d.ts} +0 -0
  473. package/dist/esnext/utilities/web-api-polyfill.js +25 -0
  474. package/dist/esnext/version.d.ts +1 -1
  475. package/dist/esnext/version.js +1 -1
  476. package/dist/node/framework/cache/in-memory.d.ts +17 -0
  477. package/dist/node/framework/cache/in-memory.js +84 -0
  478. package/dist/node/framework/graphiql.d.ts +1 -1
  479. package/dist/node/framework/graphiql.js +1 -2
  480. package/dist/node/framework/load-config.d.ts +5 -0
  481. package/dist/node/framework/load-config.js +11 -0
  482. package/dist/node/framework/middleware.d.ts +11 -7
  483. package/dist/node/framework/middleware.js +56 -73
  484. package/dist/node/framework/plugin.d.ts +5 -3
  485. package/dist/node/framework/plugin.js +27 -8
  486. package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  487. package/dist/node/framework/plugins/vite-plugin-client-imports.js +28 -0
  488. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  489. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +104 -0
  490. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  491. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +40 -0
  492. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  493. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.js +38 -0
  494. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +1 -1
  495. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +79 -20
  496. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +10 -3
  497. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +48 -7
  498. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +2 -0
  499. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +29 -0
  500. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  501. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
  502. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +7 -0
  503. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +107 -0
  504. package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  505. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +75 -0
  506. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.d.ts +3 -0
  507. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.js +16 -0
  508. package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +3 -0
  509. package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +18 -0
  510. package/dist/node/framework/types.d.ts +6 -0
  511. package/dist/node/{foundation/ShopifyProvider → framework}/types.js +0 -0
  512. package/dist/node/framework/viteception.d.ts +5 -0
  513. package/dist/node/framework/viteception.js +20 -0
  514. package/dist/node/shared-types.d.ts +27 -0
  515. package/dist/node/shared-types.js +5 -0
  516. package/dist/{esnext/components/ProductProvider/ProductProviderFragment.js → node/utilities/web-api-polyfill.d.ts} +0 -0
  517. package/dist/node/utilities/web-api-polyfill.js +53 -0
  518. package/package.json +101 -56
  519. package/vendor/react-server-dom-vite/LICENSE +21 -0
  520. package/vendor/react-server-dom-vite/README.md +5 -0
  521. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +600 -0
  522. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1808 -0
  523. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +47 -0
  524. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1882 -0
  525. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +47 -0
  526. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +629 -0
  527. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +19 -0
  528. package/vendor/react-server-dom-vite/esm/package.json +3 -0
  529. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +83 -0
  530. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +596 -0
  531. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1800 -0
  532. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +1874 -0
  533. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +619 -0
  534. package/vendor/react-server-dom-vite/index.js +7 -0
  535. package/vendor/react-server-dom-vite/package.json +67 -0
  536. package/vendor/react-server-dom-vite/plugin.js +3 -0
  537. package/vendor/react-server-dom-vite/writer.browser.server.js +7 -0
  538. package/vendor/react-server-dom-vite/writer.node.server.js +7 -0
  539. package/client.d.ts +0 -1
  540. package/client.js +0 -1
  541. package/dist/esnext/components/BuyNowButton/BuyNowButton.d.ts +0 -12
  542. package/dist/esnext/components/BuyNowButton/BuyNowButton.js +0 -29
  543. package/dist/esnext/components/CartContainer/CartContainer.client.d.ts +0 -9
  544. package/dist/esnext/components/CartContainer/CartContainer.client.js +0 -24
  545. package/dist/esnext/components/CartContainer/index.d.ts +0 -1
  546. package/dist/esnext/components/CartContainer/index.js +0 -1
  547. package/dist/esnext/components/CartLineAttributes/CartLineAttributes.client.d.ts +0 -10
  548. package/dist/esnext/components/CartLineAttributes/CartLineAttributes.client.js +0 -9
  549. package/dist/esnext/components/CartLineAttributes/index.d.ts +0 -1
  550. package/dist/esnext/components/CartLineAttributes/index.js +0 -1
  551. package/dist/esnext/components/CartLineProvider/hooks.d.ts +0 -26
  552. package/dist/esnext/components/CartLineSelectedOptions/CartLineSelectedOptions.client.d.ts +0 -10
  553. package/dist/esnext/components/CartLineSelectedOptions/CartLineSelectedOptions.client.js +0 -9
  554. package/dist/esnext/components/CartLineSelectedOptions/index.d.ts +0 -1
  555. package/dist/esnext/components/CartLineSelectedOptions/index.js +0 -1
  556. package/dist/esnext/components/CartLines/CartLines.d.ts +0 -7
  557. package/dist/esnext/components/CartProvider/CartServerProvider.server.d.ts +0 -11
  558. package/dist/esnext/components/CartProvider/CartServerProvider.server.js +0 -20
  559. package/dist/esnext/components/CartProvider/hooks.d.ts +0 -18
  560. package/dist/esnext/components/CartProvider/hooks.js +0 -79
  561. package/dist/esnext/components/CartToggle/CartToggle.client.d.ts +0 -8
  562. package/dist/esnext/components/CartToggle/CartToggle.client.js +0 -11
  563. package/dist/esnext/components/CartToggle/index.d.ts +0 -1
  564. package/dist/esnext/components/CartToggle/index.js +0 -1
  565. package/dist/esnext/components/CartTotal/CartTotal.client.d.ts +0 -3
  566. package/dist/esnext/components/CartTotal/CartTotal.client.js +0 -8
  567. package/dist/esnext/components/CartTotal/index.d.ts +0 -1
  568. package/dist/esnext/components/CartTotal/index.js +0 -1
  569. package/dist/esnext/components/CartUIProvider/CartUIProvider.client.d.ts +0 -5
  570. package/dist/esnext/components/CartUIProvider/CartUIProvider.client.js +0 -26
  571. package/dist/esnext/components/CartUIProvider/context.d.ts +0 -9
  572. package/dist/esnext/components/CartUIProvider/context.js +0 -2
  573. package/dist/esnext/components/CartUIProvider/hooks.d.ts +0 -1
  574. package/dist/esnext/components/CartUIProvider/hooks.js +0 -9
  575. package/dist/esnext/components/CartUIProvider/index.d.ts +0 -2
  576. package/dist/esnext/components/CartUIProvider/index.js +0 -2
  577. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +0 -4
  578. package/dist/esnext/components/Image/ImageFragment.d.ts +0 -4
  579. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +0 -18
  580. package/dist/esnext/components/LocalizationProvider/hooks.d.ts +0 -8
  581. package/dist/esnext/components/LocalizationProvider/hooks.js +0 -17
  582. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +0 -22
  583. package/dist/esnext/components/MetafieldDate/MetafieldDate.client.d.ts +0 -8
  584. package/dist/esnext/components/MetafieldDate/MetafieldDate.client.js +0 -11
  585. package/dist/esnext/components/MetafieldDate/index.d.ts +0 -1
  586. package/dist/esnext/components/MetafieldDate/index.js +0 -1
  587. package/dist/esnext/components/MetafieldJson/MetafieldJson.d.ts +0 -8
  588. package/dist/esnext/components/MetafieldJson/MetafieldJson.js +0 -9
  589. package/dist/esnext/components/MetafieldJson/index.d.ts +0 -1
  590. package/dist/esnext/components/MetafieldJson/index.js +0 -1
  591. package/dist/esnext/components/MetafieldPrimitive/MetafieldPrimitive.client.d.ts +0 -12
  592. package/dist/esnext/components/MetafieldPrimitive/MetafieldPrimitive.client.js +0 -31
  593. package/dist/esnext/components/MetafieldPrimitive/index.d.ts +0 -1
  594. package/dist/esnext/components/MetafieldPrimitive/index.js +0 -1
  595. package/dist/esnext/components/MetafieldText/MetafieldText.d.ts +0 -7
  596. package/dist/esnext/components/MetafieldText/MetafieldText.js +0 -9
  597. package/dist/esnext/components/MetafieldText/index.d.ts +0 -1
  598. package/dist/esnext/components/MetafieldText/index.js +0 -1
  599. package/dist/esnext/components/MetafieldUrl/MetafieldUrl.client.d.ts +0 -8
  600. package/dist/esnext/components/MetafieldUrl/MetafieldUrl.client.js +0 -5
  601. package/dist/esnext/components/MetafieldUrl/index.d.ts +0 -1
  602. package/dist/esnext/components/MetafieldUrl/index.js +0 -1
  603. package/dist/esnext/components/MetafieldWeight/MetafieldWeight.client.d.ts +0 -9
  604. package/dist/esnext/components/MetafieldWeight/MetafieldWeight.client.js +0 -10
  605. package/dist/esnext/components/MetafieldWeight/index.d.ts +0 -1
  606. package/dist/esnext/components/MetafieldWeight/index.js +0 -1
  607. package/dist/esnext/components/Model3D/Model3D.client.d.ts +0 -25
  608. package/dist/esnext/components/Model3D/Model3D.client.js +0 -30
  609. package/dist/esnext/components/Model3D/Model3DFragment.d.ts +0 -11
  610. package/dist/esnext/components/Model3D/index.d.ts +0 -1
  611. package/dist/esnext/components/Model3D/index.js +0 -1
  612. package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +0 -3
  613. package/dist/esnext/components/ProductDescription/ProductDescription.client.js +0 -10
  614. package/dist/esnext/components/ProductDescription/index.d.ts +0 -1
  615. package/dist/esnext/components/ProductDescription/index.js +0 -1
  616. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -7
  617. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -46
  618. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +0 -84
  619. package/dist/esnext/components/ProductProvider/context.d.ts +0 -10
  620. package/dist/esnext/components/ProductProvider/context.js +0 -2
  621. package/dist/esnext/components/ProductProvider/hooks.d.ts +0 -1
  622. package/dist/esnext/components/ProductProvider/hooks.js +0 -6
  623. package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
  624. package/dist/esnext/components/ProductProvider/index.js +0 -2
  625. package/dist/esnext/components/ProductProvider/types.d.ts +0 -5
  626. package/dist/esnext/components/ProductTitle/ProductTitle.client.d.ts +0 -3
  627. package/dist/esnext/components/ProductTitle/ProductTitle.client.js +0 -11
  628. package/dist/esnext/components/ProductTitle/index.d.ts +0 -1
  629. package/dist/esnext/components/ProductTitle/index.js +0 -1
  630. package/dist/esnext/components/RawHtml/RawHtml.d.ts +0 -7
  631. package/dist/esnext/components/RawHtml/RawHtml.js +0 -13
  632. package/dist/esnext/components/RawHtml/index.d.ts +0 -1
  633. package/dist/esnext/components/RawHtml/index.js +0 -1
  634. package/dist/esnext/components/SelectedVariantAddToCartButton/SelectedVariantAddToCartButton.client.d.ts +0 -6
  635. package/dist/esnext/components/SelectedVariantAddToCartButton/SelectedVariantAddToCartButton.client.js +0 -12
  636. package/dist/esnext/components/SelectedVariantAddToCartButton/index.d.ts +0 -1
  637. package/dist/esnext/components/SelectedVariantAddToCartButton/index.js +0 -1
  638. package/dist/esnext/components/SelectedVariantBuyNowButton/SelectedVariantBuyNowButton.d.ts +0 -4
  639. package/dist/esnext/components/SelectedVariantBuyNowButton/SelectedVariantBuyNowButton.js +0 -12
  640. package/dist/esnext/components/SelectedVariantBuyNowButton/index.d.ts +0 -1
  641. package/dist/esnext/components/SelectedVariantBuyNowButton/index.js +0 -1
  642. package/dist/esnext/components/SelectedVariantImage/SelectedVariantImage.client.d.ts +0 -6
  643. package/dist/esnext/components/SelectedVariantImage/SelectedVariantImage.client.js +0 -12
  644. package/dist/esnext/components/SelectedVariantImage/index.d.ts +0 -1
  645. package/dist/esnext/components/SelectedVariantImage/index.js +0 -1
  646. package/dist/esnext/components/SelectedVariantPrice/SelectedVariantPrice.client.d.ts +0 -6
  647. package/dist/esnext/components/SelectedVariantPrice/SelectedVariantPrice.client.js +0 -18
  648. package/dist/esnext/components/SelectedVariantPrice/index.d.ts +0 -1
  649. package/dist/esnext/components/SelectedVariantPrice/index.js +0 -1
  650. package/dist/esnext/components/SelectedVariantShopPayButton/SelectedVariantShopPayButton.client.d.ts +0 -2
  651. package/dist/esnext/components/SelectedVariantShopPayButton/SelectedVariantShopPayButton.client.js +0 -12
  652. package/dist/esnext/components/SelectedVariantShopPayButton/index.d.ts +0 -1
  653. package/dist/esnext/components/SelectedVariantShopPayButton/index.js +0 -1
  654. package/dist/esnext/components/SelectedVariantUnitPrice/SelectedVariantUnitPrice.client.d.ts +0 -3
  655. package/dist/esnext/components/SelectedVariantUnitPrice/SelectedVariantUnitPrice.client.js +0 -12
  656. package/dist/esnext/components/SelectedVariantUnitPrice/index.d.ts +0 -1
  657. package/dist/esnext/components/SelectedVariantUnitPrice/index.js +0 -1
  658. package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +0 -8
  659. package/dist/esnext/components/UnitPrice/UnitPrice.client.js +0 -16
  660. package/dist/esnext/components/UnitPrice/index.d.ts +0 -1
  661. package/dist/esnext/components/UnitPrice/index.js +0 -1
  662. package/dist/esnext/components/Video/VideoFragment.d.ts +0 -11
  663. package/dist/esnext/components/Video/VideoFragment.js +0 -1
  664. package/dist/esnext/foundation/ClientMarker/ClientMarker.d.ts +0 -10
  665. package/dist/esnext/foundation/ClientMarker/ClientMarker.js +0 -25
  666. package/dist/esnext/foundation/ClientMarker/index.d.ts +0 -1
  667. package/dist/esnext/foundation/ClientMarker/index.js +0 -1
  668. package/dist/esnext/foundation/Hydration/Cache.client.d.ts +0 -9
  669. package/dist/esnext/foundation/Hydration/Cache.client.js +0 -131
  670. package/dist/esnext/foundation/Hydration/ClientComponents.server.d.ts +0 -13
  671. package/dist/esnext/foundation/Hydration/ClientComponents.server.js +0 -18
  672. package/dist/esnext/foundation/Hydration/Html.d.ts +0 -5
  673. package/dist/esnext/foundation/Hydration/Html.js +0 -9
  674. package/dist/esnext/foundation/Hydration/HydrationContext.server.d.ts +0 -1
  675. package/dist/esnext/foundation/Hydration/HydrationContext.server.js +0 -2
  676. package/dist/esnext/foundation/Hydration/ServerComponentRequest.server.d.ts +0 -13
  677. package/dist/esnext/foundation/Hydration/ServerComponentRequest.server.js +0 -39
  678. package/dist/esnext/foundation/Hydration/ServerComponentResponse.server.d.ts +0 -18
  679. package/dist/esnext/foundation/Hydration/ServerComponentResponse.server.js +0 -35
  680. package/dist/esnext/foundation/Hydration/react-utils.d.ts +0 -5
  681. package/dist/esnext/foundation/Hydration/react-utils.js +0 -55
  682. package/dist/esnext/foundation/Hydration/wire.server.d.ts +0 -4
  683. package/dist/esnext/foundation/Hydration/wire.server.js +0 -75
  684. package/dist/esnext/foundation/Hydration/writer.server.d.ts +0 -14
  685. package/dist/esnext/foundation/Hydration/writer.server.js +0 -29
  686. package/dist/esnext/foundation/Router/DefaultRoutes.d.ts +0 -20
  687. package/dist/esnext/foundation/Router/DefaultRoutes.js +0 -54
  688. package/dist/esnext/foundation/Router/ServerStateRouter.client.d.ts +0 -6
  689. package/dist/esnext/foundation/Router/ServerStateRouter.client.js +0 -27
  690. package/dist/esnext/foundation/Router/index.d.ts +0 -1
  691. package/dist/esnext/foundation/Router/index.js +0 -1
  692. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.client.d.ts +0 -11
  693. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.client.js +0 -48
  694. package/dist/esnext/foundation/ServerStateProvider/index.d.ts +0 -1
  695. package/dist/esnext/foundation/ServerStateProvider/index.js +0 -1
  696. package/dist/esnext/foundation/ShopifyProvider/ShopifyContext.d.ts +0 -1
  697. package/dist/esnext/foundation/ShopifyProvider/ShopifyContext.js +0 -2
  698. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.d.ts +0 -3
  699. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.js +0 -11
  700. package/dist/esnext/foundation/ShopifyProvider/ShopifyServerProvider.server.d.ts +0 -8
  701. package/dist/esnext/foundation/ShopifyProvider/ShopifyServerProvider.server.js +0 -7
  702. package/dist/esnext/foundation/ShopifyProvider/hooks.d.ts +0 -2
  703. package/dist/esnext/foundation/ShopifyProvider/hooks.js +0 -9
  704. package/dist/esnext/framework/plugins/vite-plugin-react-server-components-shim.js +0 -123
  705. package/dist/esnext/framework/server-components.d.ts +0 -12
  706. package/dist/esnext/framework/server-components.js +0 -72
  707. package/dist/esnext/graphql/graphql-constants.d.ts +0 -1267
  708. package/dist/esnext/graphql/graphql-constants.js +0 -2432
  709. package/dist/esnext/handle-event.d.ts +0 -20
  710. package/dist/esnext/handle-event.js +0 -140
  711. package/dist/esnext/handle-worker-event.d.ts +0 -11
  712. package/dist/esnext/handle-worker-event.js +0 -14
  713. package/dist/esnext/hooks/useProductOptions/useProductOptions.d.ts +0 -23
  714. package/dist/esnext/hooks/useProductOptions/useProductOptions.js +0 -84
  715. package/dist/esnext/hooks/useQuery/QueryProvider.d.ts +0 -6
  716. package/dist/esnext/hooks/useQuery/QueryProvider.js +0 -13
  717. package/dist/esnext/hooks/useQuery/hooks.d.ts +0 -12
  718. package/dist/esnext/hooks/useQuery/hooks.js +0 -28
  719. package/dist/esnext/hooks/useQuery/index.d.ts +0 -2
  720. package/dist/esnext/hooks/useQuery/index.js +0 -2
  721. package/dist/esnext/hooks/useWeight/hooks.d.ts +0 -11
  722. package/dist/esnext/hooks/useWeight/hooks.js +0 -29
  723. package/dist/esnext/hooks/useWeight/index.d.ts +0 -1
  724. package/dist/esnext/hooks/useWeight/index.js +0 -1
  725. package/dist/esnext/utilities/connections.d.ts +0 -2
  726. package/dist/esnext/utilities/connections.js +0 -4
  727. package/dist/esnext/utilities/environment.d.ts +0 -2
  728. package/dist/esnext/utilities/environment.js +0 -2
  729. package/dist/node/foundation/ClientMarker/ClientMarker.d.ts +0 -10
  730. package/dist/node/foundation/ClientMarker/ClientMarker.js +0 -48
  731. package/dist/node/foundation/ClientMarker/index.d.ts +0 -1
  732. package/dist/node/foundation/ClientMarker/index.js +0 -13
  733. package/dist/node/foundation/Hydration/HydrationContext.server.d.ts +0 -1
  734. package/dist/node/foundation/Hydration/HydrationContext.server.js +0 -5
  735. package/dist/node/foundation/Hydration/ServerComponentRequest.server.d.ts +0 -13
  736. package/dist/node/foundation/Hydration/ServerComponentRequest.server.js +0 -43
  737. package/dist/node/foundation/Hydration/ServerComponentResponse.server.d.ts +0 -18
  738. package/dist/node/foundation/Hydration/ServerComponentResponse.server.js +0 -39
  739. package/dist/node/foundation/Hydration/react-utils.d.ts +0 -5
  740. package/dist/node/foundation/Hydration/react-utils.js +0 -63
  741. package/dist/node/foundation/Router/DefaultRoutes.d.ts +0 -20
  742. package/dist/node/foundation/Router/DefaultRoutes.js +0 -78
  743. package/dist/node/foundation/Router/index.d.ts +0 -1
  744. package/dist/node/foundation/Router/index.js +0 -5
  745. package/dist/node/foundation/ShopifyProvider/ShopifyContext.d.ts +0 -1
  746. package/dist/node/foundation/ShopifyProvider/ShopifyContext.js +0 -5
  747. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.d.ts +0 -3
  748. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.js +0 -34
  749. package/dist/node/foundation/ShopifyProvider/ShopifyServerProvider.server.d.ts +0 -8
  750. package/dist/node/foundation/ShopifyProvider/ShopifyServerProvider.server.js +0 -14
  751. package/dist/node/foundation/ShopifyProvider/hooks.d.ts +0 -2
  752. package/dist/node/foundation/ShopifyProvider/hooks.js +0 -13
  753. package/dist/node/foundation/ShopifyProvider/index.d.ts +0 -2
  754. package/dist/node/foundation/ShopifyProvider/index.js +0 -8
  755. package/dist/node/foundation/ShopifyProvider/types.d.ts +0 -12
  756. package/dist/node/foundation/index.d.ts +0 -4
  757. package/dist/node/foundation/index.js +0 -13
  758. package/dist/node/framework/plugins/vite-plugin-react-server-components-shim.js +0 -128
  759. package/dist/node/framework/server-components.d.ts +0 -12
  760. package/dist/node/framework/server-components.js +0 -77
  761. package/dist/node/handle-event.d.ts +0 -20
  762. package/dist/node/handle-event.js +0 -143
  763. package/dist/node/hooks/useQuery/QueryProvider.d.ts +0 -6
  764. package/dist/node/hooks/useQuery/QueryProvider.js +0 -20
  765. package/dist/node/hooks/useQuery/hooks.d.ts +0 -12
  766. package/dist/node/hooks/useQuery/hooks.js +0 -32
  767. package/dist/node/hooks/useQuery/index.d.ts +0 -2
  768. package/dist/node/hooks/useQuery/index.js +0 -14
  769. package/dist/node/types.d.ts +0 -48
  770. package/dist/node/types.js +0 -2
  771. package/dist/worker/foundation/Hydration/ServerComponentRequest.server.d.ts +0 -13
  772. package/dist/worker/foundation/Hydration/ServerComponentRequest.server.js +0 -39
  773. package/dist/worker/foundation/Hydration/ServerComponentResponse.server.d.ts +0 -18
  774. package/dist/worker/foundation/Hydration/ServerComponentResponse.server.js +0 -35
  775. package/dist/worker/handle-event.d.ts +0 -20
  776. package/dist/worker/handle-event.js +0 -140
  777. package/dist/worker/handle-worker-event.d.ts +0 -11
  778. package/dist/worker/handle-worker-event.js +0 -14
  779. package/dist/worker/types.d.ts +0 -48
  780. package/entry-client.d.ts +0 -1
  781. package/entry-client.js +0 -1
  782. package/entry-server.d.ts +0 -1
  783. package/entry-server.js +0 -1
  784. package/marker.js +0 -1
  785. package/middleware.d.ts +0 -1
  786. package/middleware.js +0 -1
  787. package/plugin.d.ts +0 -1
  788. package/plugin.js +0 -1
  789. package/worker.js +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,2206 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1716](https://github.com/Shopify/hydrogen/pull/1716) [`4e6356e6`](https://github.com/Shopify/hydrogen/commit/4e6356e67bf92ff621573eac36fe34f37a1c326c) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Fix add to cart Shopify session tracking
8
+
9
+ * [#1713](https://github.com/Shopify/hydrogen/pull/1713) [`ea47ab68`](https://github.com/Shopify/hydrogen/commit/ea47ab68b112c0c1c5b28020c8a2fa91a54f0b78) Thanks [@frandiox](https://github.com/frandiox)! - Fix `fetchSync` when called with relative URLs.
10
+
11
+ ## 1.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - [#1700](https://github.com/Shopify/hydrogen/pull/1700) [`9b6c564e`](https://github.com/Shopify/hydrogen/commit/9b6c564eb20ca75d9995e3eed581339960e222c1) Thanks [@jplhomer](https://github.com/jplhomer)! - Hydrogen is now out of developer preview. Thank you for all of your feedback and contributions the past eight months!
16
+
17
+ ## 0.27.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#1697](https://github.com/Shopify/hydrogen/pull/1697) [`85aab092`](https://github.com/Shopify/hydrogen/commit/85aab092b2f47d77bb917659918a011783cd8c34) Thanks [@blittle](https://github.com/blittle)! - Remove `defaultLocale` from the Hydrogen Config and instead add `defaultCountryCode` and `defaultLanguageCode`. Both of which are also now available by the `useShop()` hook:
22
+
23
+ ```diff
24
+ export default defineConfig({
25
+ shopify: {
26
+ - defaultLocale: 'EN-US',
27
+ + defaultCountryCode: 'US',
28
+ + defaultLanguageCode: 'EN',
29
+ storeDomain: 'hydrogen-preview.myshopify.com',
30
+ storefrontToken: '3b580e70970c4528da70c98e097c2fa0',
31
+ storefrontApiVersion: '2022-07',
32
+ },
33
+ }
34
+ ```
35
+
36
+ * [#1662](https://github.com/Shopify/hydrogen/pull/1662) [`4262b319`](https://github.com/Shopify/hydrogen/commit/4262b3196afb96415d3b0f8f874f351030e6a734) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Fix server analytics route
37
+
38
+ - Fix ServerAnalyticsRoute so that it does complete all async work
39
+ - Move Performance and Shopify analytic reporting to client side
40
+ - Make sure `ShopifyAnalytics` make its own query for shop id and currency
41
+ - Remove query for shop id and currency from `DefaultSeo` component
42
+ - Make Performance and Shopify server analytics connector do nothing
43
+
44
+ ### Deprecated components
45
+
46
+ Remove the following components from `hydrogen.config.js`
47
+
48
+ - `PerformanceMetricsServerAnalyticsConnector`
49
+ - `ShopifyServerAnalyticsConnector`
50
+
51
+ ## 0.26.1
52
+
53
+ ### Patch Changes
54
+
55
+ - [#1663](https://github.com/Shopify/hydrogen/pull/1663) [`66200d6b`](https://github.com/Shopify/hydrogen/commit/66200d6b7d8e54b0746a048e950f067d4b8e0609) Thanks [@jplhomer](https://github.com/jplhomer)! - Default to 'US' CountryCode if locale cannot be parsed correctly
56
+
57
+ * [#1690](https://github.com/Shopify/hydrogen/pull/1690) [`afde8989`](https://github.com/Shopify/hydrogen/commit/afde8989ae03e842de65ac698ab86033e56e7ee2) Thanks [@frehner](https://github.com/frehner)! - Add scale to the filename part of the url in `shopifyImageLoader()`
58
+
59
+ - [#1676](https://github.com/Shopify/hydrogen/pull/1676) [`0149cbf6`](https://github.com/Shopify/hydrogen/commit/0149cbf60b331461ae0c97bb3e18d3f27e143d0a) Thanks [@frandiox](https://github.com/frandiox)! - Avoid writing to Node response if it has been closed early.
60
+
61
+ * [#1674](https://github.com/Shopify/hydrogen/pull/1674) [`8068d3ce`](https://github.com/Shopify/hydrogen/commit/8068d3ce14f44ea83bde8f3729ae2a8cbbf8a52e) Thanks [@frandiox](https://github.com/frandiox)! - Throw error when `<Link>` component is used outside of `<Router>` component.
62
+
63
+ - [#1680](https://github.com/Shopify/hydrogen/pull/1680) [`acf5223f`](https://github.com/Shopify/hydrogen/commit/acf5223fe34cfdd483ae9b0e714445c8cbf11a9d) Thanks [@blittle](https://github.com/blittle)! - Fix basepath to not apply to external URLs in the `<Link` component. Also default the attribute `rel="noreferrer noopener` for external URLs.
64
+
65
+ * [#1670](https://github.com/Shopify/hydrogen/pull/1670) [`8b26f7a6`](https://github.com/Shopify/hydrogen/commit/8b26f7a6f034eaa36bb11974ff3dc5d992e2e97b) Thanks [@frandiox](https://github.com/frandiox)! - Optimize client boundaries only during build by default.
66
+
67
+ ## 0.26.0
68
+
69
+ ### Minor Changes
70
+
71
+ - [#1615](https://github.com/Shopify/hydrogen/pull/1615) [`20bfc438`](https://github.com/Shopify/hydrogen/commit/20bfc4388ed400dc215a41cca44fe8cd4a11022a) Thanks [@frehner](https://github.com/frehner)! - `<CartEstimatedCost/>` has been renamed to `<CartCost/>` to match a recent update to the Storefront API, in which `cart.estimatedCost` is being deprecated in favor of `cart.cost`.
72
+
73
+ Additionally, `cart.cost.compareAtAmount` was renamed to `cart.cost.compareAtAmountPerQuantity`.
74
+
75
+ * [#1619](https://github.com/Shopify/hydrogen/pull/1619) [`b0c13696`](https://github.com/Shopify/hydrogen/commit/b0c13696b6030ab8697147fdbe3ccdf2522a3913) Thanks [@blittle](https://github.com/blittle)! - We have reworked how localization works in Hydrogen. By default the `useLocalization()` hook returns the default locale defined within your [Hydrogen configuration file](https://shopify.dev/custom-storefronts/hydrogen/framework/hydrogen-config). The `<LocalizationProvider>` component now takes `countryCode` and `languageCode` as optional props. Any props given to `<LocalizationProvider>` will also be used by the `useLocalization` hook.
76
+
77
+ **Breaking Change**
78
+
79
+ The `useCountry` hook has been removed. Instead use the [`useLocalization` hook](https://shopify.dev/api/hydrogen/hooks/localization/uselocalization).
80
+
81
+ ```diff
82
+ - import {useCountry, gql} from '@shopify/hydrogen';
83
+ + import {useLocalization, gql} from '@shopify/hydrogen';
84
+
85
+ export function MyComponent() {
86
+
87
+ - const [country] = useCountry();
88
+ + const {country} = useLocalization();
89
+
90
+ return ( /* Your JSX */ );
91
+ }
92
+ ```
93
+
94
+ The `Link` component now respects the `basePath` property defined within it's parent `FileRoutes` component. For example, given `<FileRoutes basePath="/cn">`, a route within that renders `<Link to="/products">` will actually produce an anchor tag prefixed with `/cn`: `<a href="/cn/products">`. You can override the `basePath` with a `basePath` prop on the `Link` component.
95
+
96
+ - [#1646](https://github.com/Shopify/hydrogen/pull/1646) [`1103fb57`](https://github.com/Shopify/hydrogen/commit/1103fb575e51d5948c6bd4885bcd911be1f8bf7e) Thanks [@benjaminsehl](https://github.com/benjaminsehl)! - Updates default SEO titleTemplate for the Homepage
97
+
98
+ ### Patch Changes
99
+
100
+ - [#1569](https://github.com/Shopify/hydrogen/pull/1569) [`e5896a3e`](https://github.com/Shopify/hydrogen/commit/e5896a3e20b0bf2760b238e713a7bc04f7e95e2d) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Clean up full page cache work with `waitUntil`
101
+
102
+ * [#1643](https://github.com/Shopify/hydrogen/pull/1643) [`3b849606`](https://github.com/Shopify/hydrogen/commit/3b849606c4999d19920330f86c535a6f892dcc65) Thanks [@frandiox](https://github.com/frandiox)! - Do not cache client components in browser when using TypeScript.
103
+
104
+ - [#1605](https://github.com/Shopify/hydrogen/pull/1605) [`2eb2c461`](https://github.com/Shopify/hydrogen/commit/2eb2c4615210cafadab8ed154909f3516c72db3e) Thanks [@frandiox](https://github.com/frandiox)! - Fix hydration issues with `useId`.
105
+
106
+ * [#1613](https://github.com/Shopify/hydrogen/pull/1613) [`c45ebd3c`](https://github.com/Shopify/hydrogen/commit/c45ebd3cf468c9f596ef399712506bd766dea54d) Thanks [@frehner](https://github.com/frehner)! - The `<ShopPayButton/>` and `<CartShopPayButton/>` now take in a `width` prop to help customize how wide the `<shop-pay-button>` custom element is, by using the newly added CSS custom property (variable) `--shop-pay-button-width`.
107
+
108
+ - [#1651](https://github.com/Shopify/hydrogen/pull/1651) [`a19be2b2`](https://github.com/Shopify/hydrogen/commit/a19be2b22cee63bf95ade3a4f5803c460651a473) Thanks [@blittle](https://github.com/blittle)! - Fixes to the cart:
109
+
110
+ 1. Fix bug when providing a lower-case country code to the `LocalizationProvider`
111
+ 2. Make sure that the Cart always logs API errors
112
+
113
+ * [#1649](https://github.com/Shopify/hydrogen/pull/1649) [`df0e01ff`](https://github.com/Shopify/hydrogen/commit/df0e01fff6afae22a30be8c0bb750aed016326a4) Thanks [@blittle](https://github.com/blittle)! - Add a `x-powered-by: Shopify-Hydrogen` header which can be disabled with the Hydrogen config property: `poweredByHeader: false`
114
+
115
+ - [#1566](https://github.com/Shopify/hydrogen/pull/1566) [`cfe7385e`](https://github.com/Shopify/hydrogen/commit/cfe7385e0c64c3dc465d1bcd34ad9c7040db9969) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Add storefont id to cart provider query
116
+
117
+ * [#1551](https://github.com/Shopify/hydrogen/pull/1551) [`3d20e92d`](https://github.com/Shopify/hydrogen/commit/3d20e92db3402e356c16d0bc5fc4450f9d8c0df5) Thanks [@jplhomer](https://github.com/jplhomer)! - In-Memory caching is now enabled by default in production for Node.js runtimes.
118
+
119
+ - [#1604](https://github.com/Shopify/hydrogen/pull/1604) [`f3827d31`](https://github.com/Shopify/hydrogen/commit/f3827d31263352689c5149a5509b51d1fdb572d4) Thanks [@cartogram](https://github.com/cartogram)! - Adds new `load-config` entry point that exposes a `loadConfig()` function that will return the configuration object and the path to the found configuration file for a given Hydrogen project root.
120
+
121
+ Example:
122
+
123
+ ```ts
124
+ import {loadConfig} from '@shopify/hydrogen/load-config';
125
+
126
+ const {configuration, configurationPath} = await loadConfig({
127
+ root: 'path/to/hydrogen-app',
128
+ });
129
+ ```
130
+
131
+ * [#1626](https://github.com/Shopify/hydrogen/pull/1626) [`29218452`](https://github.com/Shopify/hydrogen/commit/29218452a1679be629616993d8cc23ad7077667b) Thanks [@frandiox](https://github.com/frandiox)! - Fix import aliases.
132
+
133
+ - [#1622](https://github.com/Shopify/hydrogen/pull/1622) [`d339239d`](https://github.com/Shopify/hydrogen/commit/d339239d23b074cba3ee637166f8120512a6afee) Thanks [@frandiox](https://github.com/frandiox)! - Fix module resolution after HMR in some scenarios.
134
+
135
+ * [#1608](https://github.com/Shopify/hydrogen/pull/1608) [`b834dfdc`](https://github.com/Shopify/hydrogen/commit/b834dfdcddc56c78bb6fbb7e0a681cc3c977b62d) Thanks [@jplhomer](https://github.com/jplhomer)! - Add type exports for `HydrogenRouteProps`, `HydrogenApiRoute`, and `HydrogenApiRouteOptions`.
136
+
137
+ - [#1603](https://github.com/Shopify/hydrogen/pull/1603) [`e1bb5810`](https://github.com/Shopify/hydrogen/commit/e1bb5810f218acc5b7debb60bcdebc6c9594f86c) Thanks [@frandiox](https://github.com/frandiox)! - Do not trigger prefetch when `to` prop is missing in the `Link` component.
138
+
139
+ ## 0.25.1
140
+
141
+ ## 0.25.0
142
+
143
+ ### Minor Changes
144
+
145
+ - [#1570](https://github.com/Shopify/hydrogen/pull/1570) [`36f26e54`](https://github.com/Shopify/hydrogen/commit/36f26e54a0b136fe4b21807756969e592934c9f2) Thanks [@frehner](https://github.com/frehner)! - `<Image/>` now takes into account a specific order for determining the width and height.
146
+
147
+ 1. `loaderOptions`'s width/height
148
+ 2. width/height bare props
149
+ 3. `data`'s width/height
150
+
151
+ `getShopifyImageDimensions()` was also updated to handle this logic.
152
+
153
+ * [#1506](https://github.com/Shopify/hydrogen/pull/1506) [`58d6ef55`](https://github.com/Shopify/hydrogen/commit/58d6ef55be2929c9a1680a6a372bb2e5fdfb7ee6) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Hydrogen now supports full-page caching out of the box. Previously, Hydrogen relied on the network edge to provide full-page caching for dynamic responses (HTML).
154
+
155
+ - [#1346](https://github.com/Shopify/hydrogen/pull/1346) [`01814369`](https://github.com/Shopify/hydrogen/commit/018143693f96b7a200258665de570a9369ae8e65) Thanks [@lordofthecactus](https://github.com/lordofthecactus)! - Add `onClick` and `buttonRef` props to `AddToCartButton`, `BuyNowButton` and `CartLineQuantityAdjustButton`
156
+
157
+ * [#1523](https://github.com/Shopify/hydrogen/pull/1523) [`4ef2e5b9`](https://github.com/Shopify/hydrogen/commit/4ef2e5b93cd537a213334211113c224194d9dd68) Thanks [@blittle](https://github.com/blittle)! - We've simplified the built-in Hydrogen caching strategies. Instead of `CacheSeconds`, `CacheMinutes`, `CacheHours`, `CacheDays`, `CacheMonths`, and `NoStore`, there is no simply `CacheLong`, `CacheShort`, and `CacheNone`. Please remember that you can [build your own caching strategies](https://shopify.dev/custom-storefronts/hydrogen/framework/cache#build-your-own-caching-strategies).
158
+
159
+ - [#1513](https://github.com/Shopify/hydrogen/pull/1513) [`8d67b559`](https://github.com/Shopify/hydrogen/commit/8d67b559e8d59d02ca353ec43fb5b2b3ff2f5961) Thanks [@frandiox](https://github.com/frandiox)! - **Breaking change:** We are starting to use [`exports` property in `package.json`](https://nodejs.org/api/packages.html#package-entry-points) to list all the entry points in this package.
160
+
161
+ This might incur breaking changes in some rare cases when importing private properties from Hydrogen `dist` files. Notice that we **discourage** doing so for anything that is not publicly documented but, if your app was relying on some private properties, then this might help:
162
+
163
+ ```diff
164
+ -import {xyz} from '@shopify/hydrogen/dist/esnext/<internal-path>';
165
+ +import {xyz} from '@shopify/hydrogen/<internal-path>';
166
+ ```
167
+
168
+ Aside from that, it is recommended that TypeScript projects update the `tsconfig.json` file to use `compilerOptions.moduleResolution: "node16"` to make sure Hydrogen types are loaded in your editor.
169
+ For JavaScript projects, create or edit `<root>/jsconfig.json` file with the following information to improve typings:
170
+
171
+ ```json
172
+ {
173
+ "compilerOptions": {
174
+ "target": "es2020",
175
+ "module": "esnext",
176
+ "moduleResolution": "node16",
177
+ "lib": ["dom", "dom.iterable", "scripthost", "es2020"],
178
+ "jsx": "react",
179
+ "types": ["vite/client"]
180
+ },
181
+ "exclude": ["node_modules", "dist"],
182
+ "include": ["**/*.js", "**/*.jsx"]
183
+ }
184
+ ```
185
+
186
+ * [#1528](https://github.com/Shopify/hydrogen/pull/1528) [`72d21b87`](https://github.com/Shopify/hydrogen/commit/72d21b87e48a682794889610741f03560bce0be7) Thanks [@frehner](https://github.com/frehner)! - Metafields have changed in Storefront API `2022-07`. We updated our code to work with that update, which means that the following changes will **only work if you're using `2022-07` or newer.**
187
+
188
+ ## Metafields changes
189
+
190
+ ### Storefront API `2022-07`
191
+
192
+ Metafields have changed how you access them in the Storefront API. See [the release notes](https://shopify.dev/api/release-notes/2022-07) for more details. In order to support the new way of querying metafields, Hydrogen has made the following updates:
193
+
194
+ ### `<Metafield/>`
195
+
196
+ Previously, the `<Metafield/>` component expected you to use `useParseMetafields()` before passing a metafield to it.
197
+
198
+ Now, `<Metafield/>` will use `parseMetafield()` itself so that you don't have to. However, this does mean that if you use `parseMetafield()` and then pass it to `<Metafield/>`, it will likely break because it will try to parse your metafield's value a second time.
199
+
200
+ ### `useParsedMetafields()` and `parseMetafield()`
201
+
202
+ Deprecated `useParsedMetafields()` in favor of `parseMetafield()`. `parseMetafield()` takes in a single metafield and returns a new object, and importantly it can be used on both the client _and_ the server.
203
+
204
+ If you need to memoize the value on the client, then you can do so using `React.memo`:
205
+
206
+ ```tsx
207
+ import {useMemo} from 'react';
208
+ import {parseMetafield} from '@shopify/hydrogen'x
209
+
210
+ function MyComponent() {
211
+ const parsedMetafield = useMemo(() => parseMetafield(metafield), [metafield]);
212
+ }
213
+ ```
214
+
215
+ - [#1517](https://github.com/Shopify/hydrogen/pull/1517) [`68b8185e`](https://github.com/Shopify/hydrogen/commit/68b8185e74805a6453e246f01ce69a38988078ef) Thanks [@frandiox](https://github.com/frandiox)! - **Breaking change:** The utilities used in `hydrogen.config.js` file are now exported from `@shopiy/hydrogen/config` instead of `@shopify/hydrogen`:
216
+
217
+ ```diff
218
+ -import {defineConfig} from '@shopify/hydrogen/config';
219
+ import {
220
+ + defineConfig,
221
+ CookieSessionStorage,
222
+ PerformanceMetricsServerAnalyticsConnector,
223
+ ShopifyServerAnalyticsConnector,
224
+ -} from '@shopify/hydrogen';
225
+ +} from '@shopify/hydrogen/config'
226
+
227
+ export default defineConfig({
228
+ shopify: {/* ... */},
229
+ session: CookieSessionStorage('__session', {
230
+ path: '/',
231
+ /* ... */
232
+ }),
233
+ serverAnalyticsConnectors: [
234
+ PerformanceMetricsServerAnalyticsConnector,
235
+ ShopifyServerAnalyticsConnector,
236
+ ],
237
+ });
238
+ ```
239
+
240
+ ### Patch Changes
241
+
242
+ - [#1494](https://github.com/Shopify/hydrogen/pull/1494) [`3b549439`](https://github.com/Shopify/hydrogen/commit/3b549439bae1ec43ae9171744c576c53d8e8f6f1) Thanks [@jplhomer](https://github.com/jplhomer)! - Update `flattenConnection` to accept `nodes` and `edges` payloads
243
+
244
+ * [#1579](https://github.com/Shopify/hydrogen/pull/1579) [`2f75247c`](https://github.com/Shopify/hydrogen/commit/2f75247c071253ae27f6070a066897b5758a6a4f) Thanks [@frandiox](https://github.com/frandiox)! - Support renaming client component exports in intermediate/facade files.
245
+
246
+ - [#1562](https://github.com/Shopify/hydrogen/pull/1562) [`d38f6413`](https://github.com/Shopify/hydrogen/commit/d38f6413361d1ecb49c52d8389547d2b064081f7) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Add storefront id to useShopQuery calls when available
247
+
248
+ * [#1593](https://github.com/Shopify/hydrogen/pull/1593) [`ae35b70b`](https://github.com/Shopify/hydrogen/commit/ae35b70b0847e1a6270d1c63d2968a3578442e66) Thanks [@juanpprieto](https://github.com/juanpprieto)! - Ensure the effect that updates the `cart.buyerIdenity.countryCode` is run when `countyCode` prop changes
249
+
250
+ - [#1504](https://github.com/Shopify/hydrogen/pull/1504) [`cc453242`](https://github.com/Shopify/hydrogen/commit/cc4532426509fd216f1bc036d5a095a18812b0cb) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix read-only request.status in worker environments.
251
+
252
+ * [#1548](https://github.com/Shopify/hydrogen/pull/1548) [`923cb140`](https://github.com/Shopify/hydrogen/commit/923cb140b44fe989388f8754a8ca88bbfc68ab71) Thanks [@cartogram](https://github.com/cartogram)! - Add new devTools interface for performance, settings and graphQL tracking
253
+
254
+ - [#1375](https://github.com/Shopify/hydrogen/pull/1375) [`217b5f23`](https://github.com/Shopify/hydrogen/commit/217b5f23613da794bb6879ab0c897b66ef6204cf) Thanks [@blittle](https://github.com/blittle)! - Add a built-in healthcheck route available at `/__health`. It responds with a 200 and no body. Also suppresses server logs for built-in routes like healthcheck and analytics.
255
+
256
+ * [#1541](https://github.com/Shopify/hydrogen/pull/1541) [`4fde81f9`](https://github.com/Shopify/hydrogen/commit/4fde81f9d9ee739a6fbe5a8a903d3e6901144bf0) Thanks [@frandiox](https://github.com/frandiox)! - Fix support for latest React@experimental version.
257
+
258
+ - [#1497](https://github.com/Shopify/hydrogen/pull/1497) [`3364225f`](https://github.com/Shopify/hydrogen/commit/3364225ff62d283893643ea28c0135ff22af1dff) Thanks [@blittle](https://github.com/blittle)! - Improve waterfall detection
259
+
260
+ 1. Show a summary in dev mode with instructions on getting details
261
+ 2. Only show the waterfall warning the second time the page is loaded
262
+ 3. Don't show the waterfall warning on preloaded queries
263
+
264
+ * [#1519](https://github.com/Shopify/hydrogen/pull/1519) [`d54b1072`](https://github.com/Shopify/hydrogen/commit/d54b10725b635f4531e94b9391cfd56f31a1d2e5) Thanks [@frandiox](https://github.com/frandiox)! - Improve CPU performance of the `useMoney` hook.
265
+
266
+ - [#1518](https://github.com/Shopify/hydrogen/pull/1518) [`f0b69477`](https://github.com/Shopify/hydrogen/commit/f0b6947762acdfd617c9ccd34615a36a64ab36f2) Thanks [@frandiox](https://github.com/frandiox)! - Compile code to latest supported ES version in workers and Node.
267
+
268
+ * [#1571](https://github.com/Shopify/hydrogen/pull/1571) [`accdc78a`](https://github.com/Shopify/hydrogen/commit/accdc78a13cc1557826509545a322bfa04e6e288) Thanks [@jplhomer](https://github.com/jplhomer)! - Upgrade Hydrogen to React v18.2. To update your app, run `yarn add @shopify/hydrogen@latest react@latest react-dom@latest`.
269
+
270
+ - [#1578](https://github.com/Shopify/hydrogen/pull/1578) [`f5290393`](https://github.com/Shopify/hydrogen/commit/f5290393264c523045cab4082495e81ec72d576d) Thanks [@frandiox](https://github.com/frandiox)! - Fix an issue where newly imported client components were not found in the browser.
271
+
272
+ * [#1556](https://github.com/Shopify/hydrogen/pull/1556) [`06f3d174`](https://github.com/Shopify/hydrogen/commit/06f3d174ff286ece0a7175ac7c2ae37e574f73b0) Thanks [@blittle](https://github.com/blittle)! - Add support for `Request.formData()` within API Routes for Node 16-17. Example:
273
+
274
+ ```ts
275
+ export async function api(request) {
276
+ const formData = await request.formData();
277
+
278
+ const username = formData.get('user');
279
+ const password = formData.get('pass');
280
+
281
+ ...
282
+ }
283
+ ```
284
+
285
+ ## 0.24.0
286
+
287
+ ### Minor Changes
288
+
289
+ - [#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.
290
+
291
+ * [#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`:
292
+
293
+ 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.
294
+ 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.**
295
+
296
+ ### Patch Changes
297
+
298
+ - [#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.
299
+
300
+ * [#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.
301
+
302
+ - [#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
303
+
304
+ * [#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>`
305
+
306
+ - [#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.
307
+
308
+ * [#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.
309
+
310
+ - [#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
311
+
312
+ ## 0.23.0
313
+
314
+ ### Minor Changes
315
+
316
+ - [#1389](https://github.com/Shopify/hydrogen/pull/1389) [`9a21108f`](https://github.com/Shopify/hydrogen/commit/9a21108f6ff89474db9ff8bec26733fcbe744bdc) Thanks [@blittle](https://github.com/blittle)! - **Breaking change**
317
+
318
+ 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.
319
+
320
+ 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.
321
+
322
+ * [#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.
323
+
324
+ 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.
325
+
326
+ 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:
327
+
328
+ ```jsx
329
+ import {Link} from '@shopify/hydrogen';
330
+ export default function Index({request}) {
331
+ const url = new URL(request.normalizedUrl);
332
+
333
+ return (
334
+ <>
335
+ <p>Current param is: {url.searchParams.get('param')}</p>
336
+ <Link to="/?param=foo" scroll={false}>
337
+ Update param to foo
338
+ </Link>
339
+ </>
340
+ );
341
+ }
342
+ ```
343
+
344
+ - [#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
345
+
346
+ - Fix server analytics connector erroring out after more than 1 server analytics connectors are attached
347
+ - Shopify analytics components
348
+
349
+ # Updates to server analytics connectors
350
+
351
+ The server analytics connector interface has updated to
352
+
353
+ ```jsx
354
+ export function request(
355
+ requestUrl: string,
356
+ requestHeader: Headers,
357
+ data?: any,
358
+ contentType?: string
359
+ ): void {
360
+ // Do something with the analytic event.
361
+ }
362
+ ```
363
+
364
+ # Introducing Shopify analytics
365
+
366
+ Optional analytics components that allows you to send ecommerce related analytics to
367
+ Shopify. Adding the Shopify analytics components will allow the Shopify admin - Analytics
368
+ dashboard to work.
369
+
370
+ For information, see [Shopify Analytics](https://shopify.dev/api/hydrogen/components/framework/shopifyanalytics)
371
+
372
+ * [#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:
373
+
374
+ ```jsx
375
+ <Seo type="noindex" data={{title: 'Login'}} />
376
+ ```
377
+
378
+ - [#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/>`
379
+
380
+ - `<ProductProvider/>` has been removed
381
+ - `<ProductPrice/>` was the only component left that used it; now it requires a `data` prop that takes in the product object
382
+ - `<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.)
383
+
384
+ * [#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:
385
+
386
+ ```diff
387
+ // App.server.jsx
388
+
389
+ -import {setLogger, setLoggerOptions} from '@shopify/hydrogen';
390
+
391
+ -setLogger({
392
+ - trace() {},
393
+ - error() {},
394
+ - // ...
395
+ -});
396
+
397
+ -setLoggerOptions({
398
+ - showQueryTiming: true,
399
+ - showCacheControlHeader: true,
400
+ - // ...
401
+ -});
402
+
403
+ function App() {
404
+ // ...
405
+ }
406
+
407
+ export default renderHydrogen(App);
408
+ ```
409
+
410
+ ```diff
411
+ // hydrogen.config.js
412
+
413
+ export default defineConfig({
414
+ // ...
415
+ + logger: {
416
+ + trace() {},
417
+ + error() {},
418
+ + showQueryTiming: true,
419
+ + showCacheControlHeader: true,
420
+ + // ...
421
+ + },
422
+ });
423
+ ```
424
+
425
+ - [#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.
426
+
427
+ ```diff
428
+ function App({response}) {
429
+ - response.writeHead({
430
+ - headers: {'custom-header': 'value'},
431
+ - status: 404,
432
+ - });
433
+ + response.headers.set('custom-header', 'value');
434
+ + response.status = 404;
435
+ }
436
+ ```
437
+
438
+ * [#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`:
439
+
440
+ ```diff
441
+ // Custom client entry handler
442
+
443
+ -renderHydrogen(ClientWrapper, {strictMode: false});
444
+ +renderHydrogen(ClientWrapper);
445
+ ```
446
+
447
+ ```diff
448
+ // hydrogen.config.jsx
449
+
450
+ export default defineConfig({
451
+ + strictMode: false,
452
+ });
453
+ ```
454
+
455
+ To remove a custom client entry handler in case it's not needed anymore, delete the custom file and change `index.html`:
456
+
457
+ ```diff
458
+ <body>
459
+ <div id="root"></div>
460
+ - <script type="module" src="/src/custom-client-entry"></script>
461
+ + <script type="module" src="/@shopify/hydrogen/entry-client"></script>
462
+ </body>
463
+ ```
464
+
465
+ - [#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:
466
+
467
+ ```diff
468
+ // hydrogen.config.js
469
+
470
+ export default defineConfig({
471
+ shopify: {
472
+ // ...
473
+ },
474
+ - enableStreaming: (req) => {
475
+ - return req.headers.get('user-agent') !== 'custom bot';
476
+ - },
477
+ });
478
+ ```
479
+
480
+ ```diff
481
+ // App.server.jsx
482
+
483
+ -function App() {
484
+ +function App({request, response}) {
485
+ + if (request.headers.get('user-agent') === 'custom bot') {
486
+ + response.doNotStream();
487
+ + }
488
+
489
+ return <Suspense fallback={'Loading...'}>{/*...*/}</Suspense>;
490
+ }
491
+
492
+ export default renderHydrogen(App);
493
+ ```
494
+
495
+ ### Patch Changes
496
+
497
+ - [#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.
498
+
499
+ * [#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.
500
+
501
+ - [#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.
502
+
503
+ * [#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.
504
+
505
+ - [#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
506
+
507
+ * [#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
508
+
509
+ - [#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
510
+
511
+ * [#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
512
+
513
+ - [#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.
514
+
515
+ * [#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.
516
+
517
+ - [#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.`
518
+
519
+ ## 0.22.1
520
+
521
+ ### Patch Changes
522
+
523
+ - [#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
524
+
525
+ ## 0.22.0
526
+
527
+ ### Minor Changes
528
+
529
+ - [#930](https://github.com/Shopify/hydrogen/pull/930) [`750baf8f`](https://github.com/Shopify/hydrogen/commit/750baf8ff069d0e06fb92e78a142049a1ce2b1ae) Thanks [@michenly](https://github.com/michenly)! - 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:
530
+
531
+ ```jsx
532
+ <Seo type="noindex" data={{title: 'Login'}} />
533
+ ```
534
+
535
+ * [#1313](https://github.com/Shopify/hydrogen/pull/1313) [`ed1933e3`](https://github.com/Shopify/hydrogen/commit/ed1933e339927322d8008034982b05ff4590e6d8) Thanks [@frandiox](https://github.com/frandiox)! - **Breaking change**: The `routes` property in `hydrogen.config.js` file has been simplified. It is now a string that represents the path to the routes from the project root:
536
+
537
+ ```diff
538
+ // hydrogen.config.js
539
+
540
+ export default defineConfig({
541
+ - routes: import('./src/routes/**/*.server.[jt](s|sx)'),
542
+ + routes: '/src/routes',
543
+ });
544
+ ```
545
+
546
+ Its default value is `/src/routes` so this property can be removed when using this directory.
547
+
548
+ In the object syntax version, `dirPrefix` is removed and `files` becomes a string:
549
+
550
+ ```diff
551
+ // hydrogen.config.js
552
+
553
+ export default defineConfig({
554
+ routes: {
555
+ - files: import('./src/routes/**/*.server.[jt](s|sx)'),
556
+ - dirPrefix: './src/routes',
557
+ + files: '/src/routes',
558
+ basePath: '/',
559
+ },
560
+ });
561
+ ```
562
+
563
+ - [#1332](https://github.com/Shopify/hydrogen/pull/1332) [`5ec1bc62`](https://github.com/Shopify/hydrogen/commit/5ec1bc62cf9e4348aa389d4154f8c80dccfb96bb) Thanks [@frandiox](https://github.com/frandiox)! - A new `gql` utility is exported from `@shopify/hydrogen` that replaces `graphql-tag` dependency when using `useShopQuery`. It helps reducing bundle size in production when compared to the original `graphql-tag`.
564
+
565
+ Before:
566
+
567
+ ```js
568
+ import gql from 'graphql-tag';
569
+
570
+ // ...
571
+
572
+ useShopQuery({
573
+ query: gql`...`,
574
+ // ...
575
+ });
576
+ ```
577
+
578
+ After:
579
+
580
+ ```js
581
+ import {gql} from '@shopify/hydrogen';
582
+
583
+ // ...
584
+
585
+ useShopQuery({
586
+ query: gql`...`,
587
+ // ...
588
+ });
589
+ ```
590
+
591
+ * [#1340](https://github.com/Shopify/hydrogen/pull/1340) [`631832ec`](https://github.com/Shopify/hydrogen/commit/631832ecaef26b918e774515ada6b80668ec5e4e) Thanks [@jplhomer](https://github.com/jplhomer)! - **Breaking change**: The `response.send()` function has been removed. Use `export async function api()` to send custom responses instead.
592
+
593
+ ### Patch Changes
594
+
595
+ - [#1371](https://github.com/Shopify/hydrogen/pull/1371) [`84a2fd09`](https://github.com/Shopify/hydrogen/commit/84a2fd09b7150b1d5e1f92b786f4a6af09e18739) Thanks [@frehner](https://github.com/frehner)! - Made updates to `<Image/>`:
596
+
597
+ - Fixed some TypeScript type issues with Image.
598
+ - `data.url` and `alt` are now required props in Typescript, but won't break the actual component if you don't pass them.
599
+
600
+ * [#1348](https://github.com/Shopify/hydrogen/pull/1348) [`211093e5`](https://github.com/Shopify/hydrogen/commit/211093e5f1a9e2ad115eb667746bfa2c6dd05b82) Thanks [@developit](https://github.com/developit)! - Fix HTML double-decoding in flight response
601
+
602
+ - [#1345](https://github.com/Shopify/hydrogen/pull/1345) [`331ff3c0`](https://github.com/Shopify/hydrogen/commit/331ff3c0f58143df3e7c542116f9a94838710352) Thanks [@frandiox](https://github.com/frandiox)! - Reduce the amount of user app files downloaded in the browser.
603
+
604
+ * [#1322](https://github.com/Shopify/hydrogen/pull/1322) [`36bd77c4`](https://github.com/Shopify/hydrogen/commit/36bd77c4619ec071ea11b764bb16b5670b0afa6b) Thanks [@frandiox](https://github.com/frandiox)! - Fix server hanging in Node.js environment when not using Hydrogen Middleware.
605
+
606
+ - [#1360](https://github.com/Shopify/hydrogen/pull/1360) [`d9b0d03b`](https://github.com/Shopify/hydrogen/commit/d9b0d03b64d2207b314d15fc0acf6a5143610b92) Thanks [@blittle](https://github.com/blittle)! - Fix a problem where encoded html content props passed from server to client components would get double decoded, and break hydration on app load.
607
+
608
+ * [#1355](https://github.com/Shopify/hydrogen/pull/1355) [`c45a45e8`](https://github.com/Shopify/hydrogen/commit/c45a45e895b8407da04c6b4608e7f16170452c24) Thanks [@jplhomer](https://github.com/jplhomer)! - Ensure all Hydrogen components are exported properly
609
+
610
+ - [#1339](https://github.com/Shopify/hydrogen/pull/1339) [`fef4cb84`](https://github.com/Shopify/hydrogen/commit/fef4cb8496d985d37b6113865ac1252f78058aaa) Thanks [@jplhomer](https://github.com/jplhomer)! - Use `import.meta.env.DEV` instead of `process.env.LOCAL_DEV` to hash asset filenames and show performance metrics debugging
611
+
612
+ * [#1320](https://github.com/Shopify/hydrogen/pull/1320) [`7e9df897`](https://github.com/Shopify/hydrogen/commit/7e9df897465012cd0cf374a1a35deb2ca8a16fc3) Thanks [@jplhomer](https://github.com/jplhomer)! - Properly log errors during flight responses
613
+
614
+ - [#1363](https://github.com/Shopify/hydrogen/pull/1363) [`0941d3be`](https://github.com/Shopify/hydrogen/commit/0941d3be12b52edc045b898864435f591fc2c42e) Thanks [@frandiox](https://github.com/frandiox)! - Remove some server utilities from client build.
615
+
616
+ ## 0.21.0
617
+
618
+ ### Minor Changes
619
+
620
+ - [#1327](https://github.com/Shopify/hydrogen/pull/1327) [`ce56311f`](https://github.com/Shopify/hydrogen/commit/ce56311fc1b63df22f77b199980439548f76997a) Thanks [@frehner](https://github.com/frehner)! - **Breaking Change**: `<Money />` updates and `<UnitPrice />` Removed.
621
+
622
+ - `<UnitPrice/>` has been removed
623
+ - `<Money/>` has two new props: `measurement` and `measurementSeparator` which do the work that `UnitPrice` used to do
624
+ - The TypeScript types for `<Money/>` have been improved and should provide a better typed experience now
625
+
626
+ * [#1216](https://github.com/Shopify/hydrogen/pull/1216) [`771786a6`](https://github.com/Shopify/hydrogen/commit/771786a6475c4caadb1abe5f6644e2b5c2abc021) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Fixes an issue where cached sub-requests were not revalidating properly.
627
+
628
+ - [#1304](https://github.com/Shopify/hydrogen/pull/1304) [`aa196150`](https://github.com/Shopify/hydrogen/commit/aa19615024de4fe16d548429665a863e9aae0248) Thanks [@frehner](https://github.com/frehner)! - Removed `<ProductTitle/>` and `<ProductDescription/>` components. To migrate, use `{product.title}` and `{product.description}` instead.
629
+
630
+ * [#1335](https://github.com/Shopify/hydrogen/pull/1335) [`0d90f92b`](https://github.com/Shopify/hydrogen/commit/0d90f92b448b0c4d99be3e5f5fa25d0b70a8315e) Thanks [@blittle](https://github.com/blittle)! - **Breaking Change**
631
+
632
+ The `<ProductMetafield />` component has been removed. Instead, directly use the `<Metafield>` component.
633
+
634
+ ### Patch Changes
635
+
636
+ - [#1311](https://github.com/Shopify/hydrogen/pull/1311) [`3e3fd72f`](https://github.com/Shopify/hydrogen/commit/3e3fd72f7016c0993deceefc121306cf957ef564) Thanks [@jplhomer](https://github.com/jplhomer)! - Client components no longer need to use `@shopify/hydrogen/client` as the import path. All Hydrogen components can now be imported from `@shopify/hydrogen` regardless of their context.
637
+
638
+ * [#1259](https://github.com/Shopify/hydrogen/pull/1259) [`110e9aca`](https://github.com/Shopify/hydrogen/commit/110e9aca385d553e3a87fea406f8bd8a43a0788f) Thanks [@blittle](https://github.com/blittle)! - You can now easily disable streaming on any page conditionally with the `enableStreaming` option inside `hydrogen.config.js`:
639
+
640
+ ```ts
641
+ import {CookieSessionStorage} from '@shopify/hydrogen';
642
+ import {defineConfig} from '@shopify/hydrogen/config';
643
+
644
+ export default defineConfig({
645
+ routes: import.meta.globEager('./src/routes/**/*.server.[jt](s|sx)'),
646
+ shopify: {
647
+ defaultLocale: 'en-us',
648
+ storeDomain: 'hydrogen-preview.myshopify.com',
649
+ storefrontToken: '3b580e70970c4528da70c98e097c2fa0',
650
+ storefrontApiVersion: '2022-07',
651
+ },
652
+ enableStreaming: (req) => req.headers.get('user-agent') !== 'custom bot',
653
+ });
654
+ ```
655
+
656
+ By default all pages are stream rendered except for SEO bots. There shouldn't be many reasons to disable streaming, unless there is a custom bot not covered by Hydrogen's bot detection.
657
+
658
+ - [#1318](https://github.com/Shopify/hydrogen/pull/1318) [`668a24da`](https://github.com/Shopify/hydrogen/commit/668a24daebf180747a002c8020c2e712f5d9a458) Thanks [@blittle](https://github.com/blittle)! - Buffer RSC flight responses. There isn't any benefit to streaming them, because we start a transition on page navigation. Buffering also fixes caching problems on the flight response.
659
+
660
+ * [#1293](https://github.com/Shopify/hydrogen/pull/1293) [`e378ed61`](https://github.com/Shopify/hydrogen/commit/e378ed6199553f64d9e73ad27f9409ef501aa724) Thanks [@jplhomer](https://github.com/jplhomer)! - Reverts [#1272](https://github.com/Shopify/hydrogen/pull/1272) and properly escapes terminating script sequences
661
+
662
+ - [#1283](https://github.com/Shopify/hydrogen/pull/1283) [`eea82cb0`](https://github.com/Shopify/hydrogen/commit/eea82cb02064471d274e534c557caa5d3527bc93) Thanks [@jplhomer](https://github.com/jplhomer)! - Hydrogen has been updated to use the latest stable version of React.
663
+
664
+ To update an existing Hydrogen app:
665
+
666
+ ```bash
667
+ yarn add react@latest react-dom@latest
668
+ ```
669
+
670
+ ## 0.20.0
671
+
672
+ ### Minor Changes
673
+
674
+ - [#1257](https://github.com/Shopify/hydrogen/pull/1257) [`5cd7a672`](https://github.com/Shopify/hydrogen/commit/5cd7a6727befe1e06f35b9ec68d4c81a8858d46f) Thanks [@frandiox](https://github.com/frandiox)! - Support for CSS Modules has been improved. It now behaves closer to the default behavior in Vite where styles are collected automatically.
675
+
676
+ Remove the `StyleTag` component that was needed before:
677
+
678
+ ```diff
679
+ export default function MyComponent() {
680
+ return (
681
+ <div>
682
+ - <myStyles.StyleTag />
683
+ <h1>Title</h1>
684
+ </div>
685
+ );
686
+ }
687
+ ```
688
+
689
+ Optionally, update your wildcard imports to default or named imports:
690
+
691
+ ```diff
692
+ -import * as myStyles from './my.module.css';
693
+ +import myStyles from './my.module.css';
694
+ // Or
695
+ +import {red, green, blue} from './my.module.css';
696
+ ```
697
+
698
+ * [#1271](https://github.com/Shopify/hydrogen/pull/1271) [`9d0359b8`](https://github.com/Shopify/hydrogen/commit/9d0359b87b0cfa04f12ffa9376e5b8ad72c560a3) Thanks [@frehner](https://github.com/frehner)! - ## `<Image/>`
699
+
700
+ The `<Image/>` component and related utility functions were reworked and the following changes apply:
701
+
702
+ - `useImageUrl` is no longer available; use `shopifyImageLoader` instead, which is available to run both server- and client-side.
703
+ - The TypeScript experience with `<Image/>` is improved; props will be validated better, and `loader` and `loaderOptions` will be better typed
704
+ - When using the `src` prop, `width` and `height` are now required
705
+ - When using the `data` prop, `data.width` and `data.height` or `width` and `height` props are required
706
+ - The `src` and `data` props are mutually exclusive
707
+ - The `loader` prop now receives a singular param as an object
708
+ - `options` has been merged with `loaderOptions`. When using the `data` prop, `loaderOptions` will be the options for Shopify CDN images. When using the `src` prop, `loaderOptions` will be whatever you define them to be.
709
+ - The TypeScript type `ImageSizeOptions` is now named `ShopifyLoaderOptions`
710
+ - The TypeScript type `ImageLoaderOptions` is now named `ShopifyLoaderParams`
711
+ - The `priority` prop was removed; use the HTML-standard `loading` prop instead
712
+
713
+ ## `<Video/>`
714
+
715
+ - The `<Video/>` component's `options` props was renamed to `imagePreviewOptions` to add clarity as to what the options were for.
716
+ - `imagePreviewOptions` matches the (newly updated) shape of `<Image/>`'s `loaderOptions`
717
+
718
+ - [#1290](https://github.com/Shopify/hydrogen/pull/1290) [`437b1616`](https://github.com/Shopify/hydrogen/commit/437b1616fcfa15d8b4b2c033b364b2f74b99d6e4) Thanks [@jplhomer](https://github.com/jplhomer)! - Allow cart queries to be customized by adding a new `cartFragment` prop to `CartProvider`. [Learn more](https://shopify.dev/api/hydrogen/components/cart/cartprovider#cart-fragment).
719
+
720
+ ### Patch Changes
721
+
722
+ - [#1247](https://github.com/Shopify/hydrogen/pull/1247) [`ee64873e`](https://github.com/Shopify/hydrogen/commit/ee64873ece372f9be2d6eb08b0594a91f4ed135a) Thanks [@frandiox](https://github.com/frandiox)! - Improve the way client components are discovered in order to reduce bundle sizes.
723
+
724
+ * [#1276](https://github.com/Shopify/hydrogen/pull/1276) [`c6ce6a43`](https://github.com/Shopify/hydrogen/commit/c6ce6a43bbb944b67aec5fdc7e5566768846dac5) Thanks [@frandiox](https://github.com/frandiox)! - Fix page loading in Firefox during development ([known bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1737882)).
725
+
726
+ - [#1286](https://github.com/Shopify/hydrogen/pull/1286) [`53270249`](https://github.com/Shopify/hydrogen/commit/5327024995ff7b8823ddb8ea835b3a5b95175841) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix some sourcemap warnings in server console
727
+
728
+ ## 0.19.0
729
+
730
+ ### Minor Changes
731
+
732
+ - [#1053](https://github.com/Shopify/hydrogen/pull/1053) [`c407f304`](https://github.com/Shopify/hydrogen/commit/c407f304352e0b781fa8a729674153ee9b971977) Thanks [@blittle](https://github.com/blittle)! - The selected country is now persisted a part of the session. This means that the page can be refreshed and the country will still be selected. There are a few breaking changes:
733
+
734
+ 1. `useCountry()` hook now only returns the currently selected country. The `setCountry()` method has been removed.
735
+ 2. The `useCountry()` hook expects a `countryCode` and `countryName` to be a part of the user session.
736
+ 3. The example `/countries` API route has been updated to accept a `POST` request to update the selected country. The CountrySelector components need to be updated to use that route.
737
+
738
+ ```diff
739
+ // src/routes/countries.server.jsx
740
+
741
+ -export async function api(request, {queryShop}) {
742
+ +export async function api(request, {queryShop, session}) {
743
+ + if (request.method === 'POST') {
744
+ + const {isoCode, name} = await request.json();
745
+ +
746
+ + await session.set('countryCode', isoCode);
747
+ + await session.set('countryName', name);
748
+ +
749
+ + return 'success';
750
+ + }
751
+
752
+ const {
753
+ data: {
754
+ localization: {availableCountries},
755
+ },
756
+ } = await queryShop({
757
+ query: QUERY,
758
+ });
759
+ return availableCountries.sort((a, b) => a.name.localeCompare(b.name));
760
+ }
761
+ ```
762
+
763
+ ```diff
764
+ // src/components/CountrySelector.client.jsx
765
+
766
+ export default function CountrySelector() {
767
+ const [listboxOpen, setListboxOpen] = useState(false);
768
+
769
+ - const [selectedCountry, setSelectedCountry] = useCountry();
770
+ + const [selectedCountry] = useCountry();
771
+
772
+ + const setSelectedCountry = useCallback(
773
+ + ({isoCode, name}) => {
774
+ + fetch(`/countries`, {
775
+ + body: JSON.stringify({isoCode, name}),
776
+ + method: 'POST',
777
+ + })
778
+ + .then(() => {
779
+ + window.location.reload();
780
+ + })
781
+ + .catch((error) => {
782
+ + console.error(error);
783
+ + });
784
+ + },
785
+ + [],
786
+ + );
787
+
788
+ return (
789
+ ...
790
+ );
791
+ }
792
+ ```
793
+
794
+ 4. Each server component page that depends on the selected country pulls it from the session with `useSession()`, rather than `serverProps`.
795
+
796
+ ```diff
797
+ // src/routes/products/[handle].server.jsx
798
+ + import { useSession } from '@shopify/hydrogen';
799
+
800
+ - export default function Product({country = {isoCode: 'US'}}) {
801
+ + export default function Product() {
802
+ const {handle} = useRouteParams();
803
+ + const {countryCode = 'US'} = useSession();
804
+ ...
805
+ }
806
+ ```
807
+
808
+ ### Patch Changes
809
+
810
+ - [#1264](https://github.com/Shopify/hydrogen/pull/1264) [`dc966e86`](https://github.com/Shopify/hydrogen/commit/dc966e86b35ffc8a41d8d62e129884926b8db8bc) Thanks [@arlyxiao](https://github.com/arlyxiao)! - Add more bots into user agents
811
+
812
+ * [#1245](https://github.com/Shopify/hydrogen/pull/1245) [`07866e82`](https://github.com/Shopify/hydrogen/commit/07866e8277dfa3195ef1896b16a58df495a9155f) Thanks [@0x15f](https://github.com/0x15f)! - [#1245](https://github.com/Shopify/hydrogen/pull/1245) - Support optional `priority` prop on Image component. When `true`, the image will be eagerly loaded. Defaults to `false`.
813
+
814
+ - [#1272](https://github.com/Shopify/hydrogen/pull/1272) [`c1888652`](https://github.com/Shopify/hydrogen/commit/c188865255c5f20d9db285e375c57127030e23e6) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Remove flight chunk
815
+
816
+ ## 0.18.0
817
+
818
+ ### Minor Changes
819
+
820
+ - [#1065](https://github.com/Shopify/hydrogen/pull/1065) [`81ae47fd`](https://github.com/Shopify/hydrogen/commit/81ae47fdb01be06af155a61e574d43c73122c414) Thanks [@frandiox](https://github.com/frandiox)! - A new config file `hydrogen.config.js` replaces the existing `shopify.config.js` in your Hydrogen app.
821
+
822
+ ## Introducing `hydrogen.config.js`
823
+
824
+ Hydrogen apps now expect a `hydrogen.config.js` in the root folder. This config file accepts Shopify storefront credentials, routes, session configuration, and more.
825
+
826
+ To migrate existing apps, you should create a `hydrogen.config.js` (or `hydrogen.config.ts`) file in your Hydrogen app:
827
+
828
+ ```js
829
+ import {defineConfig} from '@shopify/hydrogen/config';
830
+ import {
831
+ CookieSessionStorage,
832
+ PerformanceMetricsServerAnalyticsConnector,
833
+ } from '@shopify/hydrogen';
834
+
835
+ export default defineConfig({
836
+ routes: import.meta.globEager('./src/routes/**/*.server.[jt](s|sx)'),
837
+ shopify: {
838
+ storeDomain: 'YOUR_STORE.myshopify.com',
839
+ storefrontToken: 'YOUR_STOREFRONT_TOKEN',
840
+ storefrontApiVersion: '2022-07',
841
+ },
842
+ session: CookieSessionStorage('__session', {
843
+ path: '/',
844
+ httpOnly: true,
845
+ secure: process.env.NODE_ENV === 'production',
846
+ sameSite: 'strict',
847
+ maxAge: 60 * 60 * 24 * 30,
848
+ }),
849
+ serverAnalyticsConnectors: [PerformanceMetricsServerAnalyticsConnector],
850
+ });
851
+ ```
852
+
853
+ Then, update your `App.server.jsx` to remove previous arguments from `renderHydrogen()`:
854
+
855
+ ```diff
856
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
857
+
858
+ -function App({routes}) {
859
+ +function App() {
860
+ return (
861
+ <Suspense fallback={<LoadingFallback />}>
862
+ - <ShopifyProvider shopifyConfig={shopifyConfig}>
863
+ + <ShopifyProvider>
864
+ <CartProvider>
865
+ <DefaultSeo />
866
+ <Router>
867
+ - <FileRoutes routes={routes} />
868
+ + <FileRoutes />
869
+ <Route path="*" page={<NotFound />} />
870
+ </Router>
871
+ </CartProvider>
872
+ <PerformanceMetrics />
873
+ {process.env.LOCAL_DEV && <PerformanceMetricsDebug />}
874
+ </ShopifyProvider>
875
+ </Suspense>
876
+ );
877
+ }
878
+
879
+ -const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
880
+ -
881
+ -export default renderHydrogen(App, {
882
+ - routes,
883
+ - shopifyConfig,
884
+ - session: CookieSessionStorage('__session', {
885
+ - path: '/',
886
+ - httpOnly: true,
887
+ - secure: process.env.NODE_ENV === 'production',
888
+ - sameSite: 'strict',
889
+ - maxAge: 60 * 60 * 24 * 30,
890
+ - }),
891
+ - serverAnalyticsConnectors: [PerformanceMetricsServerAnalyticsConnector],
892
+ -});
893
+ +export default renderHydrogen(App);
894
+ ```
895
+
896
+ Next, update `vite.config.js` in your app to remove references to `shopifyConfig`:
897
+
898
+ ```diff
899
+ import {defineConfig} from 'vite';
900
+ import hydrogen from '@shopify/hydrogen/plugin';
901
+ -import shopifyConfig from './shopify.config';
902
+
903
+ // https://vitejs.dev/config/
904
+ export default defineConfig({
905
+ - plugins: [hydrogen(shopifyConfig)],
906
+ + plugins: [hydrogen()],
907
+ ```
908
+
909
+ Finally, delete `shopify.config.js` from your app.
910
+
911
+ [Read more about the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/framework/hydrogen-config)
912
+
913
+ * [#1214](https://github.com/Shopify/hydrogen/pull/1214) [`58ef6d69`](https://github.com/Shopify/hydrogen/commit/58ef6d69f1148e7bc8452fa77e7e8f54396c6105) Thanks [@frehner](https://github.com/frehner)! - Upgraded SFAPI version to 2022-07
914
+
915
+ - [#1232](https://github.com/Shopify/hydrogen/pull/1232) [`d3956d62`](https://github.com/Shopify/hydrogen/commit/d3956d623adb86371ab214b102b53c62ea9ce26c) Thanks [@arlyxiao](https://github.com/arlyxiao)! - Upgrade body-parser in hydrogen package
916
+
917
+ ### Patch Changes
918
+
919
+ - [#1211](https://github.com/Shopify/hydrogen/pull/1211) [`f3d26511`](https://github.com/Shopify/hydrogen/commit/f3d26511b1b0b94de1a43f76a0be9d99b5f2a8f7) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Build chunks are inside assets folder
920
+
921
+ * [#1215](https://github.com/Shopify/hydrogen/pull/1215) [`a0ed7c06`](https://github.com/Shopify/hydrogen/commit/a0ed7c06d045a0063a356097dafcc25e5361aad1) Thanks [@frehner](https://github.com/frehner)! - `useMoney` now returns two additional properties: `withoutTrailingZeros` and `withoutTrailingZerosAndCurrency`
922
+
923
+ `<Money />` now has two additional and optional props: `withoutMoney` and `withoutCurrency`.
924
+
925
+ - [#1242](https://github.com/Shopify/hydrogen/pull/1242) [`c277c688`](https://github.com/Shopify/hydrogen/commit/c277c68836d6d75d509cc68c74e3ccd33706a0c7) Thanks [@blittle](https://github.com/blittle)! - Prevent JSON parsing from prototype poisoning vulnerabilities
926
+
927
+ * [#1210](https://github.com/Shopify/hydrogen/pull/1210) [`a844d26e`](https://github.com/Shopify/hydrogen/commit/a844d26ef258c28fded5293054389b719f0b86f4) Thanks [@blittle](https://github.com/blittle)! - Add eslint back and fix stale product options
928
+
929
+ ## 0.17.3
930
+
931
+ ### Patch Changes
932
+
933
+ - [#1096](https://github.com/Shopify/hydrogen/pull/1096) [`0a15376e`](https://github.com/Shopify/hydrogen/commit/0a15376ec806054ddd5848d9dbfa6e50a85beb49) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Make performance data available with ClientAnalytics and optional for developers to include
934
+
935
+ * [#1209](https://github.com/Shopify/hydrogen/pull/1209) [`d0dada0a`](https://github.com/Shopify/hydrogen/commit/d0dada0a0b3170d2cb885d2f29bbbef0c6d9e9e4) Thanks [@blittle](https://github.com/blittle)! - Make metafields optional within the ProductProvider. Fixes #1127
936
+
937
+ ## 0.17.2
938
+
939
+ ### Patch Changes
940
+
941
+ - [#1161](https://github.com/Shopify/hydrogen/pull/1161) [`6b963fb1`](https://github.com/Shopify/hydrogen/commit/6b963fb1fdd2824683870c8ff3258447bf7fedea) Thanks [@merwan7](https://github.com/merwan7)! - Adds ability to add multiple cookies in one response
942
+
943
+ * [#1162](https://github.com/Shopify/hydrogen/pull/1162) [`5446d544`](https://github.com/Shopify/hydrogen/commit/5446d544f151e233e909e6a6f002e87863ae6151) Thanks [@arlyxiao](https://github.com/arlyxiao)! - Upgrade body-parser
944
+
945
+ - [#1200](https://github.com/Shopify/hydrogen/pull/1200) [`7fb7ee49`](https://github.com/Shopify/hydrogen/commit/7fb7ee497091df3177d53e8745edcae6ba99a87d) Thanks [@blittle](https://github.com/blittle)! - Add bot user agents for Seoradar and Adresults, resolves #1199
946
+
947
+ * [#1167](https://github.com/Shopify/hydrogen/pull/1167) [`0a5ac1cb`](https://github.com/Shopify/hydrogen/commit/0a5ac1cbec449eefe48041ed6aceaac375dfa601) Thanks [@benjaminsehl](https://github.com/benjaminsehl)! - Only warn in console on missing Model3D alt tag, do not throw error
948
+
949
+ - [#1152](https://github.com/Shopify/hydrogen/pull/1152) [`d3e3e695`](https://github.com/Shopify/hydrogen/commit/d3e3e695457e6eb2a3ebf9767e0f10cc3570e880) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix scroll restoration when server props are changed
950
+
951
+ ## 0.17.1
952
+
953
+ ### Patch Changes
954
+
955
+ - [#1145](https://github.com/Shopify/hydrogen/pull/1145) [`865b66e9`](https://github.com/Shopify/hydrogen/commit/865b66e95d67965543bcb92f0f9f15b5742f3596) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix search params on navigation
956
+
957
+ * [#1139](https://github.com/Shopify/hydrogen/pull/1139) [`93525637`](https://github.com/Shopify/hydrogen/commit/9352563761c0405f2e2b39cb6b8b8f577f2522b9) Thanks [@blittle](https://github.com/blittle)! - Fix the scroll restoration on page transitions
958
+
959
+ - [#1144](https://github.com/Shopify/hydrogen/pull/1144) [`dec5eb8e`](https://github.com/Shopify/hydrogen/commit/dec5eb8e34e75c806aa1cfea935814d228ab29d6) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - fix 0.17 build
960
+
961
+ ## 0.17.0
962
+
963
+ ### Minor Changes
964
+
965
+ - [#1044](https://github.com/Shopify/hydrogen/pull/1044) [`c8f5934d`](https://github.com/Shopify/hydrogen/commit/c8f5934d85db63162a13256cfcf21098b390887b) Thanks [@blittle](https://github.com/blittle)! - Hydrogen now has a built in session and cookie implementation. Read more about [how sessions work in Hydrogen](https://shopify.dev/custom-storefronts/hydrogen/framework/sessions). The starter template also includes a cookie session storage implementation. To use the new session implementation within an existing Hydrogen app:
966
+
967
+ ```diff
968
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
969
+ import {
970
+ Router,
971
+ Route,
972
+ FileRoutes,
973
+ ShopifyProvider,
974
+ + CookieSessionStorage,
975
+ } from '@shopify/hydrogen';
976
+ import {Suspense} from 'react';
977
+ import shopifyConfig from '../shopify.config';
978
+ import DefaultSeo from './components/DefaultSeo.server';
979
+ import NotFound from './components/NotFound.server';
980
+ import LoadingFallback from './components/LoadingFallback';
981
+ import CartProvider from './components/CartProvider.client';
982
+
983
+ function App({routes}) {
984
+ return (
985
+ <Suspense fallback={<LoadingFallback />}>
986
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
987
+ <CartProvider>
988
+ <DefaultSeo />
989
+ <Router>
990
+ <FileRoutes routes={routes} />
991
+ <Route path="*" page={<NotFound />} />
992
+ </Router>
993
+ </CartProvider>
994
+ </ShopifyProvider>
995
+ </Suspense>
996
+ );
997
+ }
998
+
999
+ const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
1000
+
1001
+ export default renderHydrogen(App, {
1002
+ routes,
1003
+ shopifyConfig,
1004
+ + session: CookieSessionStorage('__session', {
1005
+ + path: '/',
1006
+ + httpOnly: true,
1007
+ + secure: process.env.NODE_ENV === 'production',
1008
+ + sameSite: 'strict',
1009
+ + maxAge: 60 * 60 * 24 * 30,
1010
+ + }),
1011
+ });
1012
+
1013
+ ```
1014
+
1015
+ * [#881](https://github.com/Shopify/hydrogen/pull/881) [`a31babfb`](https://github.com/Shopify/hydrogen/commit/a31babfb9bf73b732a18487582cec129acbb8b5e) Thanks [@jplhomer](https://github.com/jplhomer)! - ## Change from serverState to serverProps
1016
+
1017
+ **Breaking changes:**
1018
+
1019
+ 1. `useServerState()` is gone. Use `useServerProps()` instead
1020
+ 2. `useServerProps()` is reset on each page navigation. Previously `useServerState()` was not.
1021
+ 3. `useServerProps()` does not contain `pathname` and `search`. Use the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook to programmatically navigate instead.
1022
+
1023
+ **Explanation:**
1024
+
1025
+ The current behavior of server state is to **persist indefinitely** (until a hard page reload). This works great for things like the CountrySelector, where the updated state is meant to persist across navigations. This breaks down for many other use cases. Consider a collection paginator: if you paginate through to the second page of a collection using server state, visit a product page, and then go to a different collection page, the new collection page will use that same pagination variable in server state. This will result in a wonky or errored experience.
1026
+
1027
+ Additionally, we have found that the term for `serverState` is confusing. The hook is used within client components, yet the state is passed as a prop to server components.
1028
+
1029
+ As a result, `serverState` is now gone. Instead communicating between client and server components is through `serverProps`. If a client component wants to re-render server content, it just calls `setServerProps('some', 'data')`. Those props will be serialized to the server, and the server component will re-render. Additionally, the server props are reset on page navigation. So that they will not bleed between pages (fixes #331).
1030
+
1031
+ If you previously relied on `serverState` for global state in your app, you shouldn't use `serverProps` anymore. Instead we'll introduce a new session based mechanism for global state (in the meantime you could manually manage a cookie).
1032
+
1033
+ Lastly, `serverProps` no longer include the `pathname` and `search` parameters. Programmatically navigate in hydrogen instead with the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook.
1034
+
1035
+ - [#1098](https://github.com/Shopify/hydrogen/pull/1098) [`f3dafec4`](https://github.com/Shopify/hydrogen/commit/f3dafec4b3113c85e33a15ee70b3f91c741e74f9) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Obfuscate chunk filename on production build
1036
+
1037
+ ### Patch Changes
1038
+
1039
+ - [#1131](https://github.com/Shopify/hydrogen/pull/1131) [`8199023b`](https://github.com/Shopify/hydrogen/commit/8199023b88924db156e2a687dd6dfce2665ab638) Thanks [@blittle](https://github.com/blittle)! - Fix hydration issue where strings with $ would get converted to a single $
1040
+
1041
+ * [#1105](https://github.com/Shopify/hydrogen/pull/1105) [`57ececf8`](https://github.com/Shopify/hydrogen/commit/57ececf82ee0c264abc256df8b02555772cc2419) Thanks [@frehner](https://github.com/frehner)! - Regenerate the graphql.schema.json which should fix the sudden end-of-line termination, and makes the schema valid again.
1042
+
1043
+ - [#1099](https://github.com/Shopify/hydrogen/pull/1099) [`6b50d371`](https://github.com/Shopify/hydrogen/commit/6b50d37158aab1a4a82626e09865d27e14adfbfb) Thanks [@blittle](https://github.com/blittle)! - Fix Hydrogen to not hard fail when client analytics doesn't load. Analytics might fail to load due to client-side adblockers.
1044
+
1045
+ ## 0.16.1
1046
+
1047
+ ### Patch Changes
1048
+
1049
+ - [#1102](https://github.com/Shopify/hydrogen/pull/1102) [`59ee791a`](https://github.com/Shopify/hydrogen/commit/59ee791ac81f41764b4ab3e5dd667c0c72b672d3) Thanks [@frandiox](https://github.com/frandiox)! - Do not call client exported functions during RSC.
1050
+
1051
+ ## 0.16.0
1052
+
1053
+ ### Patch Changes
1054
+
1055
+ - [#1082](https://github.com/Shopify/hydrogen/pull/1082) [`bd14340c`](https://github.com/Shopify/hydrogen/commit/bd14340c3099a0bf375a5879410cdf0697ed22f6) Thanks [@jplhomer](https://github.com/jplhomer)! - Update `useUrl()` to allow a developer to subscribe to a reactive version of the current router location.
1056
+
1057
+ Example:
1058
+
1059
+ ```jsx
1060
+ import {useUrl} from '@shopify/hydrogen/client';
1061
+
1062
+ function MyClientComponent() {
1063
+ const url = useUrl();
1064
+
1065
+ useEffect(() => {
1066
+ // Record navigation, analytics, etc
1067
+ }, [url]);
1068
+ }
1069
+ ```
1070
+
1071
+ * [#1075](https://github.com/Shopify/hydrogen/pull/1075) [`05dea552`](https://github.com/Shopify/hydrogen/commit/05dea552c90862a125b5111993003355a019b556) Thanks [@jplhomer](https://github.com/jplhomer)! - Properly set buyer IP and secret token for API Route queryShop helper
1072
+
1073
+ ## 0.15.0
1074
+
1075
+ ### Minor Changes
1076
+
1077
+ - [#983](https://github.com/Shopify/hydrogen/pull/983) [`52af261b`](https://github.com/Shopify/hydrogen/commit/52af261ba2bf6ed08e232b9fb2d75e69905f4cc6) Thanks [@jplhomer](https://github.com/jplhomer)! - Introduce Suspense-friendly `fetchSync` API for server and client components.
1078
+
1079
+ When using `fetchSync` in server components, you provide options for caching and preloading. This is similar to the [`useQuery` hook](https://shopify.dev/api/hydrogen/hooks/global/usequery):
1080
+
1081
+ ```jsx
1082
+ import {fetchSync, CacheMinutes} from '@shopify/hydrogen';
1083
+ import {Suspense} from 'react';
1084
+
1085
+ export function MyServerComponent() {
1086
+ return (
1087
+ <Suspense fallback="Loading...">
1088
+ <MyThings />
1089
+ </Suspense>
1090
+ );
1091
+ }
1092
+
1093
+ function MyThings() {
1094
+ const things = fetchSync('https://3p.api.com/things.json', {
1095
+ preload: true,
1096
+ cache: CacheMinutes(),
1097
+ }).json();
1098
+
1099
+ return <h2>{things.title}</h2>;
1100
+ }
1101
+ ```
1102
+
1103
+ When using `fetchSync` in client components, you cannot provide options for caching and preloading. You must import `fetchSync` from `@shopify/hydrogen/client`:
1104
+
1105
+ ```jsx
1106
+ import {fetchSync} from '@shopify/hydrogen/client';
1107
+ import {Suspense} from 'react';
1108
+
1109
+ export function MyClientComponent() {
1110
+ return (
1111
+ <Suspense fallback="Loading...">
1112
+ <MyThings />
1113
+ </Suspense>
1114
+ );
1115
+ }
1116
+
1117
+ function MyThings() {
1118
+ const things = fetchSync('https://3p.api.com/things.json').json();
1119
+
1120
+ return <h2>{things.title}</h2>;
1121
+ }
1122
+ ```
1123
+
1124
+ * [#890](https://github.com/Shopify/hydrogen/pull/890) [`a4c6d6c4`](https://github.com/Shopify/hydrogen/commit/a4c6d6c4d31337cecbd4d5afb76887bcd31ceb65) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Analytics instrumentation - this provides integration points for both server
1125
+ and client side analytics instrumentations
1126
+
1127
+ - [Usage documentation](https://shopify.dev/custom-storefronts/hydrogen/framework/analytics)
1128
+
1129
+ ### Patch Changes
1130
+
1131
+ - [#1061](https://github.com/Shopify/hydrogen/pull/1061) [`a4aa3887`](https://github.com/Shopify/hydrogen/commit/a4aa3887be9f448ec1f4322fadb9821e0d19a0b5) Thanks [@jplhomer](https://github.com/jplhomer)! - Support script tags in index.html that contain line breaks
1132
+
1133
+ * [#1057](https://github.com/Shopify/hydrogen/pull/1057) [`06d92ddc`](https://github.com/Shopify/hydrogen/commit/06d92ddc44e03d37d2dd8a9bbeaa5fab4c4bbbd1) Thanks [@frandiox](https://github.com/frandiox)! - Ability to concatenate requests in API route handlers without leaving the server by returning a new Request instance.
1134
+
1135
+ ```jsx
1136
+ // src/routes/my-page.server.jsx
1137
+
1138
+ export async function api(request) {
1139
+ if (request.method === 'POST') {
1140
+ // do some work here...
1141
+ }
1142
+
1143
+ return new Request(request.url, {method: 'GET'});
1144
+ }
1145
+
1146
+ export default function Page() {
1147
+ return (
1148
+ <form action="/my-page" method="POST">
1149
+ ...
1150
+ </form>
1151
+ );
1152
+ }
1153
+ ```
1154
+
1155
+ In the previous example, a POST request to `/my-page` would run the API handler and automatically continue with the server component rendering (GET). This is useful for handling HTML forms without waterfall requests.
1156
+
1157
+ - [#1049](https://github.com/Shopify/hydrogen/pull/1049) [`b88a885d`](https://github.com/Shopify/hydrogen/commit/b88a885d6b062209497a97d8ce7bcd438787d53c) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Support sub request cache control header `stale-while-revalidate` everywhere
1158
+
1159
+ * [#1047](https://github.com/Shopify/hydrogen/pull/1047) [`5268bf85`](https://github.com/Shopify/hydrogen/commit/5268bf85f61f8abf0e97788b7ae925ad4f3183b2) Thanks [@jplhomer](https://github.com/jplhomer)! - Restore scroll position when navigating using the back and forward buttons.
1160
+
1161
+ - [#1062](https://github.com/Shopify/hydrogen/pull/1062) [`cc172ae7`](https://github.com/Shopify/hydrogen/commit/cc172ae778bad0d654adcd2f41d4a548d1d94a0a) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix encoding of quotes in CSS Modules which caused hydration errors
1162
+
1163
+ * [#1046](https://github.com/Shopify/hydrogen/pull/1046) [`3947d53a`](https://github.com/Shopify/hydrogen/commit/3947d53a99868a1e218bfab958b824ce0484615a) Thanks [@michenly](https://github.com/michenly)! - Fixed server Cookie bug where initializing with empty string will resulted in 1 item in the Cookies Map.
1164
+
1165
+ - [#1059](https://github.com/Shopify/hydrogen/pull/1059) [`401f329d`](https://github.com/Shopify/hydrogen/commit/401f329d331bebc4842204d4df39c4dd6797b4e1) Thanks [@frandiox](https://github.com/frandiox)! - Fix link prefetch mismatch due to query-string
1166
+
1167
+ * [#1072](https://github.com/Shopify/hydrogen/pull/1072) [`47c0c184`](https://github.com/Shopify/hydrogen/commit/47c0c18411eb20fa6652a981b09fd65cbed38304) Thanks [@michenly](https://github.com/michenly)! - Improve type for ShopifyContextValue to be based on ShopifyConfig.
1168
+
1169
+ ## 0.14.0
1170
+
1171
+ ### Minor Changes
1172
+
1173
+ - [#1028](https://github.com/Shopify/hydrogen/pull/1028) [`ba174588`](https://github.com/Shopify/hydrogen/commit/ba174588d8f4a9f1054779a9bf32a92e8d2c921c) Thanks [@michenly](https://github.com/michenly)! - Starting from SF API version `2022-04`, the preferred way to request translatable resources is using the `@inContext` directive. See the [API docs](https://shopify.dev/api/examples/multiple-languages#retrieve-translations-with-the-storefront-api) on how to do this and which resources have translatable properties.
1174
+
1175
+ This causes a breaking change to the `useShopQuery` hook. The `locale` property has been removed from the argument object; `Accept-Language` is no longer being send with every request, and we are no longer using locale as part of the cache key.
1176
+
1177
+ The `useShop` hook will now return the `languageCode` key, which is the first two characters of the existing `locale` key.
1178
+
1179
+ Both `locale` & `languageCode` values are also now capitalized to make it easier to pass into a GraphQL `@inContext` directive.
1180
+
1181
+ * [#1020](https://github.com/Shopify/hydrogen/pull/1020) [`e9529bc8`](https://github.com/Shopify/hydrogen/commit/e9529bc81410e0d99f9d3dbdb138ae61d00f876b) Thanks [@jplhomer](https://github.com/jplhomer)! - Preload `Link` URLs by default when a user signals intent to visit the URL. This includes hovering or focusing on the URL. To disable preloading, pass `<Link preload={false} />` to the component.
1182
+
1183
+ ### Patch Changes
1184
+
1185
+ - [#1017](https://github.com/Shopify/hydrogen/pull/1017) [`4c87fb63`](https://github.com/Shopify/hydrogen/commit/4c87fb639a79da883f99c58acde0d17c713c7620) Thanks [@frandiox](https://github.com/frandiox)! - Do not cache Storefront API responses that contain GraphQL errors (amend previous fix).
1186
+
1187
+ * [#1039](https://github.com/Shopify/hydrogen/pull/1039) [`3a297862`](https://github.com/Shopify/hydrogen/commit/3a29786202947fab0bfe876042b37a91923ed637) Thanks [@frandiox](https://github.com/frandiox)! - Update to Vite 2.9
1188
+
1189
+ - [#1026](https://github.com/Shopify/hydrogen/pull/1026) [`836b064d`](https://github.com/Shopify/hydrogen/commit/836b064d1648fb1a9f209a08a82ee5c20f7dfba9) Thanks [@frehner](https://github.com/frehner)! - Updated the Typescript types and GraphQL schema to the newest updates from Storefront API 2022-04. Of note in this update is the ability to skip `edges` and go directly to `node`, for example: `product.nodes[0]` instead of `product.edges[0].node`
1190
+
1191
+ * [#1032](https://github.com/Shopify/hydrogen/pull/1032) [`03488083`](https://github.com/Shopify/hydrogen/commit/034880833dc500f66f9b67417c00099c283dfa67) Thanks [@jplhomer](https://github.com/jplhomer)! - Catch hydration errors related to experimental server components bugs and prevent them from being logged in production.
1192
+
1193
+ - [#1037](https://github.com/Shopify/hydrogen/pull/1037) [`13376efb`](https://github.com/Shopify/hydrogen/commit/13376efbe4db93efd705b6900a6198708bc37e69) Thanks [@jplhomer](https://github.com/jplhomer)! - Use new header for private Storefront token
1194
+
1195
+ ## 0.13.2
1196
+
1197
+ ### Patch Changes
1198
+
1199
+ - [#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
1200
+
1201
+ ## 0.13.1
1202
+
1203
+ ### Patch Changes
1204
+
1205
+ - [#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.
1206
+
1207
+ * [#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.
1208
+
1209
+ - [#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
1210
+
1211
+ * [#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.
1212
+
1213
+ - [#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.
1214
+
1215
+ ## 0.13.0
1216
+
1217
+ ### Minor Changes
1218
+
1219
+ - [#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:
1220
+
1221
+ - ExternalVideoFragment and ExternalVideoFragmentFragment
1222
+ - Model3DFragment and Model3DFragmentFragment
1223
+ - ImageFragment and ImageFragmentFragment
1224
+ - MoneyFragment and MoneyFragmentFragment
1225
+ - UnitPriceFragment and UnitPriceFragmentFragment
1226
+ - VideoFragment and VideoFragmentFragment
1227
+ - MetafieldFragment and MetafieldFragmentFragment
1228
+ - Seo fragments and types:
1229
+ - DefaultPageSeoFragment and DefaultPageSeoFragmentFragment
1230
+ - HomeSeoFragment and HomeSeoFragmentFragment
1231
+ - ProductSeoFragment and ProductSeoFragmentFragment
1232
+ - CollectionSeoFragment and CollectionSeoFragmentFragment
1233
+ - PageSeoFragment and PageSeoFragmentFragment
1234
+ - MediaFile fragments and types:
1235
+ - MediaFileFragment and MediaFileFragmentFragment
1236
+ - MediaFileFragment_ExternalVideo_Fragment
1237
+ - MediaFileFragment_MediaImage_Fragment
1238
+ - MediaFileFragment_Model3d_Fragment
1239
+ - MediaFileFragment_Video_Fragment
1240
+ - ProductFragment and ProductFragmentFragment
1241
+
1242
+ 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.
1243
+
1244
+ * [#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.
1245
+
1246
+ 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.
1247
+
1248
+ Migratation steps:
1249
+
1250
+ Create an API route to retrieve available countries:
1251
+
1252
+ ```jsx
1253
+ export async function api(request, {queryShop}) {
1254
+ const {
1255
+ data: {
1256
+ localization: {availableCountries},
1257
+ },
1258
+ } = await queryShop({
1259
+ query: QUERY,
1260
+ });
1261
+
1262
+ return availableCountries.sort((a, b) => a.name.localeCompare(b.name));
1263
+ }
1264
+
1265
+ const QUERY = `
1266
+ query Localization {
1267
+ localization {
1268
+ availableCountries {
1269
+ isoCode
1270
+ name
1271
+ currency {
1272
+ isoCode
1273
+ }
1274
+ }
1275
+ }
1276
+ }
1277
+ `;
1278
+ ```
1279
+
1280
+ Then within your client code, query the API route with a `useEffect` hook:
1281
+
1282
+ ```jsx
1283
+ const [countries, setCountries] = useState([]);
1284
+
1285
+ useEffect(() => {
1286
+ fetch('/api/countries')
1287
+ .then((resp) => resp.json())
1288
+ .then((c) => setCountries(c))
1289
+ .catch((e) => setError(e))
1290
+ .finally(() => setLoading(false));
1291
+ }, []);
1292
+ ```
1293
+
1294
+ 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/templates/template-hydrogen-default/src/components/CountrySelector.client.jsx)
1295
+
1296
+ - [#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:
1297
+
1298
+ ```bash
1299
+ yarn test
1300
+ ```
1301
+
1302
+ Or in continuous-integration (CI) environments:
1303
+
1304
+ ```bash
1305
+ yarn test:ci
1306
+ ```
1307
+
1308
+ * [#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:
1309
+
1310
+ ```js
1311
+ import * as styles from './styles.module.css';
1312
+
1313
+ export default MyComponent() {
1314
+ return (
1315
+ <div className={styles.wrapper}>
1316
+ // A style is rendered inline
1317
+ <styles.StyleTag />
1318
+ <p>Hello</p>
1319
+ </div>
1320
+ );
1321
+ }
1322
+ ```
1323
+
1324
+ Explore an [example implementation of CSS Modules in GitHub](https://github.com/Shopify/hydrogen/tree/main/examples/css-modules).
1325
+
1326
+ - [#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
1327
+
1328
+ The `<Route>` component is available for routes not defined by the file system. The `<Route>` component must be used within the `<Router>` component.
1329
+
1330
+ ```jsx
1331
+ // app.server.jsx
1332
+
1333
+ function App({routes, ...serverProps}) {
1334
+ return (
1335
+ <Suspense fallback={<LoadingFallback />}>
1336
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
1337
+ <CartProvider>
1338
+ <DefaultSeo />
1339
+ <Router serverProps={serverProps}>
1340
+ <Route path="/custom" page={<CustomRoute />} />
1341
+ </Router>
1342
+ </CartProvider>
1343
+ </ShopifyProvider>
1344
+ </Suspense>
1345
+ );
1346
+ }
1347
+
1348
+ function CustomRoute() {
1349
+ return <h1>Custom route</h1>;
1350
+ }
1351
+ ```
1352
+
1353
+ `<Route>` accepts two props:
1354
+
1355
+ | Property | Type | Required | Description |
1356
+ | -------- | --------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
1357
+ | `path` | `string` | Yes | The URL path where the route exists. The path can contain variables. For example, `/products/:handle`. |
1358
+ | `page` | `A rendered Server Component reference` | Yes | A reference to a React Server Component that's rendered when the route is active. |
1359
+
1360
+ ## Changes to `<Router>`
1361
+
1362
+ 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:
1363
+
1364
+ ```diff
1365
+ function App({routes, ...serverProps}) {
1366
+ return (
1367
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
1368
+ <CartProvider>
1369
+ <DefaultSeo />
1370
+ - <Router
1371
+ - fallback={<NotFound response={serverProps.response} />}
1372
+ - serverProps={serverProps}
1373
+ - >
1374
+ + <Router>
1375
+ <FileRoutes routes={routes} />
1376
+ + <Route path="*" page={<NotFound />} />
1377
+ </Router>
1378
+ </CartProvider>
1379
+ </ShopifyProvider>
1380
+ );
1381
+ }
1382
+ ```
1383
+
1384
+ ## Changes to `<FileRoutes>`
1385
+
1386
+ The `<FileRoutes>` component now accepts two additional optional props:
1387
+
1388
+ | Property | Type | Required | Default Value | Description |
1389
+ | ----------- | -------- | -------- | ------------- | ----------------------------------------------------------------------- |
1390
+ | `basePath` | `string` | No | `"/"` | A path that's prepended to all file routes. |
1391
+ | `dirPrefix` | `string` | No | `"./routes"` | The portion of the file route path that shouldn't be a part of the URL. |
1392
+
1393
+ You need to modify `dirPrefix` if you want to import routes from a location other than `src/routes`.
1394
+
1395
+ You can modify `basePath` if you want to prefix all file routes. For example, you can prefix all file routes with a locale:
1396
+
1397
+ ```jsx
1398
+ <Router>
1399
+ <FileRoutes basePath={`/${locale}`} routes={routes} />
1400
+ <Route path="*" page={<NotFound />} />
1401
+ </Router>
1402
+ ```
1403
+
1404
+ ## New `useRouteParams()` hook
1405
+
1406
+ You can use the `useRouteParams()` hook to retrieve the parameters of an active route. The hook is available in both server and client components:
1407
+
1408
+ ```jsx
1409
+ // products/[handle].server.jsx
1410
+
1411
+ import {useRouteParams} from '@shopify/hydrogen';
1412
+
1413
+ export default function Product() {
1414
+ const {handle} = useRouteParams();
1415
+ // ...
1416
+ }
1417
+ ```
1418
+
1419
+ ```jsx
1420
+ // ProductDetails.client.jsx
1421
+ import {useRouteParams} from '@shopify/hydrogen/client';
1422
+
1423
+ export default function ProductDetails() {
1424
+ const {handle} = useRouteParams();
1425
+ // ...
1426
+ }
1427
+ ```
1428
+
1429
+ * [#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.
1430
+
1431
+ Upgrade your project by replacing references to the `RawHtml` component to follow
1432
+ [React's `dangerouslySetInnerHTML`](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml):
1433
+
1434
+ Change all `RawHtml` component
1435
+
1436
+ ```jsx
1437
+ <RawHtml string="<p>Hello world</p>" />
1438
+ ```
1439
+
1440
+ to jsx equivalent
1441
+
1442
+ ```jsx
1443
+ <div dangerouslySetInnerHTML={{__html: '<p>Hello world</p>'}} />
1444
+ ```
1445
+
1446
+ ### Patch Changes
1447
+
1448
+ - [#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.
1449
+
1450
+ * [#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
1451
+
1452
+ - [#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
1453
+
1454
+ * [#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:
1455
+
1456
+ ```diff
1457
+ export default function Redirect({response}) {
1458
+ - response.redirect('/products/snowboard');
1459
+ - return <div>This page is redirected</div>;
1460
+ + return response.redirect('/products/snowboard');
1461
+ }
1462
+ ```
1463
+
1464
+ This server component is rendered two ways:
1465
+
1466
+ 1. When an app directly loads the redirect route, the server will render a 300 redirect with the proper location header.
1467
+ 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.
1468
+
1469
+ - [#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
1470
+
1471
+ * [#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`.
1472
+
1473
+ To upgrade your Hydrogen app, change the pinned version of `react` and `react-dom` in your `package.json` file to this version, or run:
1474
+
1475
+ ```bash
1476
+ yarn add @shopify/hydrogen react@0.0.0-experimental-2bf7c02f0-20220314 react-dom@0.0.0-experimental-2bf7c02f0-20220314
1477
+ ```
1478
+
1479
+ - [#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.
1480
+
1481
+ * [#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)
1482
+
1483
+ - [#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
1484
+
1485
+ * [#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
1486
+
1487
+ - [#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.
1488
+
1489
+ **Breaking change**: `fetchBuilder` no longer accepts a `Request` argument. Instead, it now accepts a `url: string` and `options: FetchInit`:
1490
+
1491
+ ```diff
1492
+ -fetchBuilder(new Request('https://my.endpoint.com', {headers: {foo: 'bar'}}));
1493
+ +fetchBuilder('https://my.endpoint.com', {headers: {foo: 'bar}});
1494
+ ```
1495
+
1496
+ * [#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.
1497
+
1498
+ - [#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
1499
+
1500
+ ## 0.12.0
1501
+
1502
+ ### Minor Changes
1503
+
1504
+ - [`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.
1505
+
1506
+ * [#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`.
1507
+ The migration diff are as follows:
1508
+
1509
+ ```diff
1510
+ - import {ExternalVideoFragment} from '@shopify/hydrogen';
1511
+ + import {ExternalVideoFragment} from '@shopify/hydrogen/fragments';
1512
+ - import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen';
1513
+ + import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen/fragments';
1514
+ ```
1515
+
1516
+ ```diff
1517
+ - import {ImageFragment} from '@shopify/hydrogen';
1518
+ + import {ImageFragment} from '@shopify/hydrogen/fragments';
1519
+ - import type {ImageFragmentFragment} from '@shopify/hydrogen';
1520
+ + import type {ImageFragmentFragment} from '@shopify/hydrogen/fragments';
1521
+ ```
1522
+
1523
+ ```diff
1524
+ - import {MediaFileFragment} from '@shopify/hydrogen';
1525
+ + import {MediaFileFragment} from '@shopify/hydrogen/fragments';
1526
+ - import type {MediaFileFragmentFragment} from '@shopify/hydrogen';
1527
+ + import type {MediaFileFragmentFragment} from '@shopify/hydrogen/fragments';
1528
+ ```
1529
+
1530
+ ```diff
1531
+ - import {MetafieldFragment} from '@shopify/hydrogen';
1532
+ + import {MetafieldFragment} from '@shopify/hydrogen/fragments';
1533
+ - import type {MetafieldFragmentFragment} from '@shopify/hydrogen';
1534
+ + import type {MetafieldFragmentFragment} from '@shopify/hydrogen/fragments';
1535
+ ```
1536
+
1537
+ ```diff
1538
+ - import {Model3DFragment} from '@shopify/hydrogen';
1539
+ + import {Model3DFragment} from '@shopify/hydrogen/fragments';
1540
+ - import type {Model3DFragmentFragment} from '@shopify/hydrogen';
1541
+ + import type {Model3DFragmentFragment} from '@shopify/hydrogen/fragments';
1542
+ ```
1543
+
1544
+ ```diff
1545
+ - import {MoneyFragment} from '@shopify/hydrogen';
1546
+ + import {MoneyFragment} from '@shopify/hydrogen/fragments';
1547
+ - import type {MoneyFragmentFragment} from '@shopify/hydrogen';
1548
+ + import type {MoneyFragmentFragment} from '@shopify/hydrogen/fragments';
1549
+ ```
1550
+
1551
+ ```diff
1552
+ - import {ProductProviderFragment} from '@shopify/hydrogen';
1553
+ + import {ProductProviderFragment} from '@shopify/hydrogen/fragments';
1554
+ - import type {ProductProviderFragmentFragment} from '@shopify/hydrogen';
1555
+ + import type {ProductProviderFragmentFragment} from '@shopify/hydrogen/fragments';
1556
+ ```
1557
+
1558
+ ```diff
1559
+ - import {UnitPriceFragment} from '@shopify/hydrogen';
1560
+ + import {UnitPriceFragment} from '@shopify/hydrogen/fragments';
1561
+ - import type {UnitPriceFragmentFragment} from '@shopify/hydrogen';
1562
+ + import type {UnitPriceFragmentFragment} from '@shopify/hydrogen/fragments';
1563
+ ```
1564
+
1565
+ ```diff
1566
+ - import {VideoFragment} from '@shopify/hydrogen';
1567
+ + import {VideoFragment} from '@shopify/hydrogen/fragments';
1568
+ - import type {VideoFragmentFragment} from '@shopify/hydrogen';
1569
+ + import type {VideoFragmentFragment} from '@shopify/hydrogen/fragments';
1570
+ ```
1571
+
1572
+ - [#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.
1573
+
1574
+ * [#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.
1575
+
1576
+ 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.
1577
+
1578
+ - [#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:
1579
+
1580
+ ```jsx
1581
+ // my-api.server.js
1582
+
1583
+ export default function api(request, {queryShop}) {
1584
+ return await queryShop({
1585
+ query: `query ShopName { shop { name } }`,
1586
+ });
1587
+ }
1588
+ ```
1589
+
1590
+ `queryShop` accepts a single argument object with the following properties:
1591
+
1592
+ | Property | Type | Required |
1593
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
1594
+ | `query` | `string \| ASTNode` | Yes |
1595
+ | `variables` | `Record<string, any>` | No |
1596
+ | `locale` | `string`. Defaults to the locale value from the [LocalizationProvider](https://shopify.dev/api/hydrogen/components/localization/localizationprovider) component. | No |
1597
+
1598
+ **Important**: In order to use `queryShop`, you should pass `shopifyConfig` to `renderHydrogen` inside `App.server.jsx`:
1599
+
1600
+ ```diff
1601
+ -export default renderHydrogen(App, {routes});
1602
+ +export default renderHydrogen(App, {shopifyConfig, routes});
1603
+ ```
1604
+
1605
+ * [#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.
1606
+
1607
+ Follow these steps to upgrade your `App.server.jsx` file:
1608
+
1609
+ 1. Rename the parameter `pages` to `routes` when calling `renderHydrogen`.
1610
+ 2. Rename the `DefaultRoutes` component to `FileRoutes`.
1611
+ 3. Add the new `Router` component as a parent of `FileRoutes` and pass `fallback` and `serverProps` props (previously in `DefaultRoutes`).
1612
+ 4. Rename `src/pages` directory to `src/routes` and update the glob import in `App.server.jsx` to `import.meta.globEager('./routes/**/*.server.[jt](s|sx)')`.
1613
+
1614
+ #### Full example of `App.server.jsx`
1615
+
1616
+ ```jsx
1617
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
1618
+ import {Router, FileRoutes, ShopifyProvider} from '@shopify/hydrogen';
1619
+ import {Suspense} from 'react';
1620
+ import shopifyConfig from '../shopify.config';
1621
+ import DefaultSeo from './components/DefaultSeo.server';
1622
+ import NotFound from './components/NotFound.server';
1623
+ import LoadingFallback from './components/LoadingFallback';
1624
+ import CartProvider from './components/CartProvider.client';
1625
+
1626
+ function App({routes, ...serverProps}) {
1627
+ return (
1628
+ <Suspense fallback={<LoadingFallback />}>
1629
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
1630
+ <CartProvider>
1631
+ <DefaultSeo />
1632
+ <Router fallback={<NotFound />} serverProps={serverProps}>
1633
+ <FileRoutes routes={routes} />
1634
+ </Router>
1635
+ </CartProvider>
1636
+ </ShopifyProvider>
1637
+ </Suspense>
1638
+ );
1639
+ }
1640
+
1641
+ const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
1642
+ export default renderHydrogen(App, {shopifyConfig, routes});
1643
+ ```
1644
+
1645
+ ### Patch Changes
1646
+
1647
+ - [#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.
1648
+
1649
+ * [#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
1650
+
1651
+ - [#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.
1652
+
1653
+ * [#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
1654
+
1655
+ - [#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.
1656
+ There is no longer an uncaught promise exception in the console.
1657
+
1658
+ * [#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.
1659
+
1660
+ - [#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.
1661
+
1662
+ * [#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
1663
+
1664
+ - [#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
1665
+
1666
+ * [#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
1667
+
1668
+ - MediaFileProps
1669
+ - VideoProps
1670
+ - ImageProps
1671
+ - ExternalVideoProps
1672
+ - RawHtmlProps
1673
+ - AddToCartButtonProps
1674
+ - ModelViewerProps
1675
+ - MoneyProps
1676
+ - BuyNowButtonProps
1677
+ - BuyNowButtonPropsWeControl
1678
+ - ShopPayButtonProps
1679
+
1680
+ Any Component props type should be typed instead with `React.ComponentProps<typeof MyComponent>`.
1681
+
1682
+ - [#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.
1683
+
1684
+ * [#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.
1685
+
1686
+ - [#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
1687
+
1688
+ * [#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
1689
+
1690
+ - [#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.
1691
+
1692
+ * [#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.
1693
+
1694
+ - [#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
1695
+
1696
+ * [#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.
1697
+ Extract part of the client bundle into separate modules that can be loaded in parallel.
1698
+
1699
+ ## 0.11.1
1700
+
1701
+ ### Patch Changes
1702
+
1703
+ - [#770](https://github.com/Shopify/hydrogen/pull/770) [`71e0255`](https://github.com/Shopify/hydrogen/commit/71e0255ea48dc1caa34d2c05a1556cc0ce6d4ce9) Thanks [@mcvinci](https://github.com/mcvinci)! - Hydrogen docs: Framework and global hooks content updates
1704
+
1705
+ * [#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`.
1706
+
1707
+ - [#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`
1708
+
1709
+ * [#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`.
1710
+
1711
+ - [#744](https://github.com/Shopify/hydrogen/pull/744) [`2e487b7`](https://github.com/Shopify/hydrogen/commit/2e487b7e70fe0572538dc2a24b6b6b36ba9fc804) Thanks [@jplhomer](https://github.com/jplhomer)! - Switch to using Changesets for changelogs.
1712
+
1713
+ * [#775](https://github.com/Shopify/hydrogen/pull/775) [`d5b7ee1`](https://github.com/Shopify/hydrogen/commit/d5b7ee1d8312f64922d1f78afc82ec5ad4a3f457) Thanks [@cartogram](https://github.com/cartogram)! - In cases where the `initialVariantId` is missing on the `<ProductProvider />`, the `selectedVariantId` in the returned `object` from `useProduct()` will now use the first available variant _or_ the first variant (if non are available).
1714
+
1715
+ - [#773](https://github.com/Shopify/hydrogen/pull/773) [`b6a053e`](https://github.com/Shopify/hydrogen/commit/b6a053e774da443b5692dec51546f5558b3018ad) Thanks [@frandiox](https://github.com/frandiox)! - Fix server bundle name in cases where CSS or images are imported in server components.
1716
+
1717
+ * [#764](https://github.com/Shopify/hydrogen/pull/764) [`5e55da4`](https://github.com/Shopify/hydrogen/commit/5e55da4090692369ff6a3d57fbc6d29124bdf2e9) Thanks [@wizardlyhel](https://github.com/wizardlyhel)! - Preload queries breaking fetch on Cloudfare [#764](https://github.com/Shopify/hydrogen/pull/764)
1718
+
1719
+ - [#763](https://github.com/Shopify/hydrogen/pull/763) [`ea2857a`](https://github.com/Shopify/hydrogen/commit/ea2857a515866f37f392bca5da8be1139c055a64) Thanks [@frehner](https://github.com/frehner)! - Client-side apps now have React's `StrictMode` component wrapping the whole app, with an option to disable it. If you do turn it off, it is recommended that you still include the `StrictMode` component at as high of a level as possible in your React tree.
1720
+
1721
+ See also [React 17's docs](https://reactjs.org/docs/strict-mode.html) on `StrictMode`, and [React 18's updates](https://github.com/reactwg/react-18/discussions/19) to `StrictMode`.
1722
+
1723
+ * [#747](https://github.com/Shopify/hydrogen/pull/747) [`2d8ab7e`](https://github.com/Shopify/hydrogen/commit/2d8ab7e2a8038ff8b43e6e9398e0bb2da72220a0) Thanks [@mcvinci](https://github.com/mcvinci)! - Hydrogen docs: Preloaded queries and query timing
1724
+
1725
+ ## [0.11.0] - 2022-02-24
1726
+
1727
+ ### Added
1728
+
1729
+ - New React hook `useScriptLoader` is available to more easily load external scripts
1730
+ - Add `totalQuantity` to the returned object from `useCart()`
1731
+ - Export `ProductPrice` and `ProductMetafield` standalone components
1732
+ - Added `useUrl` hook that allows the consumer to get the current url in server or client component
1733
+ - Added logging option `showCacheApiStatus` and `cacheControlHeader` by @wizardlyhel in [#472](https://github.com/Shopify/hydrogen/pull/472)
1734
+ - Pass HYDROGEN_ASSET_BASE_URL into config to set base URL for compiled assets
1735
+ - Introduce Hydrogen the `<Link>` component and `useNavigate` hook for routing
1736
+ - Add a default virtual entry-client in `/@shopify/hydrogen/entry-client` that can be used in `index.html`
1737
+ - Enable early hydration when streaming
1738
+ - Add variantId prop to `<ProductMetafield />` component [#730](https://github.com/Shopify/hydrogen/pull/730)
1739
+ - Add query timing logging option `showQueryTiming` [#699](https://github.com/Shopify/hydrogen/pull/699)
1740
+ - Add variantId prop to `<ProductPrice />` component
1741
+ - Add `preload` option to `useQuery` and `useShopQuery` [#700](https://github.com/Shopify/hydrogen/pull/700)
1742
+
1743
+ ### Breaking Change
1744
+
1745
+ - `<Model3D>` has been renamed to `<ModelViewer>`
1746
+ - `<Product />` and `<CartLine />` aliases have been removed; use the original components `<ProductProvider />` and `<CartLineProvider />` instead. Their nested component aliases, such as `<Product.Image />`, have also been removed; in this example you should use `<ProductImage />`.
1747
+ - Merge `/src/entry-server.jsx` entry point into `App.server.jsx`
1748
+ - The following components had their prop name renamed. Refer to the documentation or [#627](https://github.com/Shopify/hydrogen/issues/627) for more details.
1749
+ - `<ExternalVideo />`: renamed video prop to data
1750
+ - `<Video />`: renamed video prop to data
1751
+ - `<Image>`: renamed image prop to data
1752
+ - `<MediaFile>`: renamed media prop to data
1753
+ - `<ModelViewer>`: renamed model prop to data
1754
+ - `<Metafield>`: renamed metafield prop to data
1755
+ - `<Money>`: renamed money prop to data
1756
+ - `<UnitPrice>`: renamed unitPrice prop to data, unitPriceMeasurement prop to measurement
1757
+ - `<ProductProvider>`: renamed product prop to data
1758
+ - `<CartProvider>`: renamed cart prop to data
1759
+ - Helmet component has been renamed to Head
1760
+ - Remove the `<SelectedVariantBuyNowButton />` component in favour of using `<BuyNowButton variantId={product.selectedVariant.id} />`
1761
+ - `<SelectedVariantAddToCartButton />` has been removed; the `<AddToCartButton />` will now use the selectedVariant by default.
1762
+ - Remove the `<SelectedVariantImage />` component in favour of using `<Image data={product.selectedVariant.image} />`
1763
+ - Remove the `<SelectedVariantMetafield />` component in favour of using `<ProductMetafield variantId={product.selectedVariant.id} />`
1764
+ - Remove the `<SelectedVariantShopPayButton />` component in favour of using `<ShopPayButton variantId={product.selectedVariant.id} />`
1765
+ - Remove the `<SelectedVariantPrice/>` and `<SelectedVariantUnitPrice/>` component in favour of using `<ProductPrice variantId={product.selectedVariant.id} />`
1766
+
1767
+ ### Changed
1768
+
1769
+ - Change `/react` RSC path to `/__rsc`
1770
+ - `<ShopifyProvider>` can again be used in server components
1771
+ - Use hashes as client component ids instead of absolute paths
1772
+ - Transition away from deprecated currency selector in favor of country selector
1773
+ - Simplify Helmet usage and make it compatible with RSC
1774
+ - The `Seo.client` component has been moved from `src/components` to `@shopify/hydrogen`. The props of the `Seo.client` component also changed to always take in `type` and `data`. Refer to the [`Seo` component reference](../src/components/Seo/README.md) for more details. [#539](https://github.com/Shopify/hydrogen/pull/539)
1775
+ - Standardize cache control header into caching strategies by @wizardlyhel in [#629](https://github.com/Shopify/hydrogen/pull/629)
1776
+ - Target future release to use '2022-01' API Version
1777
+ - Correct Typescript issue where `as` was a default prop for all components when it should not be
1778
+ - Update types and docs for `useCart()` hook and `<CartProvider>`
1779
+ - Track page load performance
1780
+ - The following money components no longer allow the function-as-a-child (also known as "render props") pattern; see [#589](https://github.com/Shopify/hydrogen/pull/589)
1781
+ - `<Money>` Use `useMoney()` for customization
1782
+ - `<CartLinePrice>` Use `useMoney()` for customization
1783
+ - `<ProductPrice>` Use `useMoney()` for customization
1784
+ - `<SelectedVariantPrice>` Use `useMoney()` for customization
1785
+ - `<Metafield>` Use `useParsedMetafields()` for customization
1786
+ - `<ProductMetafield>` Use `useParsedMetafields()` for customization
1787
+ - `<SelectedVariantMetafield>` Use `useParsedMetafields()` for customization
1788
+ - `<UnitPrice>` Use `useMoney()` for customization
1789
+ - `<CartLines>` Use `useCart()` for customization
1790
+ - `<Metafield>` now renders `ratings` as a `<span>` with text instead of stars; `multi_line_text_field` inside of a `<span>` instead of a `<div>`
1791
+ - Use `featureImage` instead of images(first:1) on product query
1792
+ - Update `react-helmet-async` to 1.2.3 and remove our custom types
1793
+
1794
+ ### Fixed
1795
+
1796
+ - Fix index routes. See [#562](https://github.com/Shopify/hydrogen/issues/562)
1797
+ - Fix missing server state on SSR pass
1798
+ - Fix mobile navigation in example that scrolls the body underneath when shown by @Francismori7 in [#582](https://github.com/Shopify/hydrogen/pull/582)
1799
+ - Add charset to content type in HTML responses
1800
+ - Fix header shift when cart is opened by @Francismori7 in [#600](https://github.com/Shopify/hydrogen/pull/600)
1801
+ - Fix bug where search param is not being pass along during RSC streaming call [#623](https://github.com/Shopify/hydrogen/pull/623)
1802
+ - Allow custom entry-client filenames
1803
+ - Clear browser fetch cache by @wizardlyhel in [#591](https://github.com/Shopify/hydrogen/pull/591)
1804
+ - Cannot redefine property error when updating client components
1805
+ - `ShopPayButton` supports quantities greater than 1. Also fixed issues with IDs in Storefront API version 2022-01
1806
+ - Render error in `Gallery.client.jsx` component when product resource has an external video or no images.
1807
+ - Ensure youtube external videos are embed compatible urls
1808
+ - Prevent client components from being cached during development
1809
+ - Backticks in HTML break RSC hydration.
1810
+
1811
+ ### Removed
1812
+
1813
+ - <CartLineSelectedOptions /> and <CartLineAttributes /> components. These components used the “function-as-a-child” pattern which doesn’t allow the `children` prop to be serialized, preventing them from being rendered within Server components.
1814
+
1815
+ _Migration_
1816
+
1817
+ The functionality provided by these components can be replicated using the `useCartLine()` hook instead.
1818
+
1819
+ _Example_
1820
+
1821
+ ```tsx
1822
+ // Before
1823
+ function SomeComponent() {
1824
+ return (
1825
+ <>
1826
+ <CartLineSelectedOptions as="ul" className="text-xs space-y-1">
1827
+ {({name, value}) => (
1828
+ <>
1829
+ {name}: {value}
1830
+ </>
1831
+ )}
1832
+ </CartLineSelectedOptions>
1833
+ <CartLineAttributes as="ul" className="text-sm space-y-1">
1834
+ {({key, value}) => (
1835
+ <>
1836
+ {key}: {value}
1837
+ </>
1838
+ )}
1839
+ </CartLineAttributes>
1840
+ </>
1841
+ );
1842
+ }
1843
+
1844
+ // After
1845
+ function SomeComponent() {
1846
+ const {merchandise} = useCartLine();
1847
+
1848
+ return (
1849
+ <>
1850
+ <ul className="text-xs space-y-1">
1851
+ {merchandise.selectedOptions.map(({name, value}) => (
1852
+ <li key={name}>
1853
+ {name}: {value}
1854
+ </li>
1855
+ ))}
1856
+ </ul>
1857
+ </>
1858
+ );
1859
+ }
1860
+ ```
1861
+
1862
+ - Remove `fetch` workaround
1863
+ - Remove the following hooks. (All the same functionality can be retrieved through the `useCart()` hook)
1864
+ - `useCartAttributesUpdateCallback`
1865
+ - `useCartBuyerIdentityUpdateCallback`
1866
+ - `useCartCheckoutUrl`
1867
+ - `useCartCreateCallback`
1868
+ - `useCartDiscountCodesUpdateCallback`
1869
+ - `useCartLinesAddCallback`
1870
+ - `useCartLinesRemoveCallback`
1871
+ - `useCartLinesTotalQuantity`
1872
+ - `useCartLinesUpdateCallback`
1873
+ - `useCartNoteUpdateCallback`
1874
+ - Remove React Router on the client
1875
+ - Remove `handleEvent` in favor of `handleRequest`
1876
+ - Remove `assetHandler` parameter in the new `handleRequest`
1877
+ - `<SelectedVariantAddToCartButton />` has been removed; the `<AddToCartButton />` will now use the selectedVariant by default.
1878
+ - Remove the `<SelectedVariantImage />` component in favour of using `<Image data={product.selectedVariant.image} />`
1879
+ - Remove the `<SelectedVariantMetafield />` component in favour of using `<ProductMetafield variantId={product.selectedVariant.id} />`
1880
+ - Remove the `<SelectedVariantBuyNowButton />` component in favour of using `<BuyNowButton variantId={product.selectedVariant.id} />`
1881
+ - Remove the `<SelectedVariantShopPayButton />` component in favour of using `<ShopPayButton variantId={product.selectedVariant.id} />`
1882
+
1883
+ ## [0.10.1] - 2022-01-26
1884
+
1885
+ ### Fixed
1886
+
1887
+ - Hot reload for newly added page files
1888
+
1889
+ ## [0.10.0] - 2022-01-25
1890
+
1891
+ ### Changed
1892
+
1893
+ - Warn instead of error when a page server component is missing valid exports
1894
+ - Adopt upstream version of React Server Components. See [#498](https://github.com/Shopify/hydrogen/pull/498) for breaking changes
1895
+ - Bump to latest version of React experimental to include [upstream context bugfix](https://github.com/facebook/react/issues/23089)
1896
+ - Improve API routes by allowing [strings and JS objects](https://github.com/Shopify/hydrogen/issues/476) to be returned.
1897
+
1898
+ ### Breaking Change
1899
+
1900
+ - The 'locale' option in shopify.config.js had been renamed to 'defaultLocale'
1901
+ - Rename `graphqlApiVersion` to `storefrontApiVersion` in `shopify.config.js`
1902
+
1903
+ ### Fixed
1904
+
1905
+ - Make sure that API routes [hot reload properly](https://github.com/Shopify/hydrogen/issues/497)
1906
+
1907
+ ## [0.9.1] - 2022-01-20
1908
+
1909
+ ### Changed
1910
+
1911
+ - Transitive dependency bump.
1912
+
1913
+ ## [0.9.0] - 2022-01-20
1914
+
1915
+ ### Added
1916
+
1917
+ - API routes 🎉
1918
+
1919
+ ### Changed
1920
+
1921
+ - Move to undici instead of node-fetch
1922
+
1923
+ ## [0.8.3] - 2022-01-13
1924
+
1925
+ ### Added
1926
+
1927
+ - Add optional `locale` param to `useShopQuery` to be used as `Accept-Language` in the store Storefront API query
1928
+ - Optional purge query cache per build
1929
+
1930
+ ### Fixed
1931
+
1932
+ - Replace log abbreviations with full text.
1933
+
1934
+ ## [0.8.2] - 2022-01-07
1935
+
1936
+ ### Changed
1937
+
1938
+ - Warn when requests take longer than 3000ms instead of erroring
1939
+ - `useQuery` returns an error if the query's fetch was unsuccessful
1940
+ - `useShopQuery` will give error hints to look at `shopify.config.js` when the Storefront API responds with a 403
1941
+
1942
+ ### Fixed
1943
+
1944
+ - Load logger only once.
1945
+ - Do not attempt to decode product IDs, as they are no longer base64-encoded in `unstable`
1946
+
1947
+ ## [0.8.1] - 2022-01-04
1948
+
1949
+ ### Added
1950
+
1951
+ - Detect bot user agents and give bots a non-streamed response.
1952
+ - Add global `Oxygen.env` for server-only environment variables.
1953
+ - Logging abstraction with default timing information
1954
+
1955
+ ### Changed
1956
+
1957
+ - Upgrade to latest React 18 experimental version
1958
+
1959
+ ### Fixed
1960
+
1961
+ - Cart decrease button removes at zero quantity
1962
+
1963
+ ## [0.8.0] - 2021-12-07
1964
+
1965
+ ### Fixed
1966
+
1967
+ - Export `CartLineSelectedOptions` properly
1968
+ - Fix suspense utility function
1969
+
1970
+ ## [0.7.1] - 2021-12-02
1971
+
1972
+ ### Changed
1973
+
1974
+ - Allow `useShopQuery` to be skippable if no query is passed
1975
+ - Remove usage of `react-query` (Not a breaking change)
1976
+
1977
+ ### Fixed
1978
+
1979
+ - Avoid repeating the same identifier for default and named exports
1980
+ - Remove sourcemap warnings
1981
+
1982
+ ## [0.7.0] - 2021-11-22
1983
+
1984
+ ### Added
1985
+
1986
+ - Add file reference metafield support
1987
+ - Allow custom Model3D poster
1988
+ - Support synchronous server redirects
1989
+
1990
+ ### Fixed
1991
+
1992
+ - Binding of waitUntil in playground/server-components-worker
1993
+ - Default to `retry: false` in `useQuery`
1994
+ - Warn and ignore reserved properties in server state
1995
+ - Run graphiql middleware before vite, fixing graphiql
1996
+
1997
+ ## [0.6.4] - 2021-11-11
1998
+
1999
+ ### Fixed
2000
+
2001
+ - Let Vite handle public assets in development
2002
+ - New lines in hydration request break JSON.parse
2003
+ - Normalize POSIX separators to support windows [#201](https://github.com/Shopify/hydrogen/pull/201)
2004
+ - Scroll to top on app first load
2005
+ - Update variantID to variantId [#78](https://github.com/Shopify/hydrogen/pull/78)
2006
+
2007
+ ## [0.6.3] - 2021-11-10
2008
+
2009
+ ### Fixed
2010
+
2011
+ - Add trailing slash to user components glob
2012
+
2013
+ ## [0.6.2] - 2021-11-10
2014
+
2015
+ ### Fixed
2016
+
2017
+ - Remove CartProvider from BuyNowButton
2018
+ - Reading property of null for component props
2019
+ - Transform deeply-imported client components
2020
+ - Duplicated files and contexts in browser
2021
+
2022
+ ## [0.6.1] - 2021-11-08
2023
+
2024
+ ### Changed
2025
+
2026
+ - Transitive dependency bump.
2027
+
2028
+ ### Fixed
2029
+
2030
+ - Do not set headers after they are sent to client
2031
+
2032
+ ## [0.6.0] - 2021-11-05
2033
+
2034
+ ### Changed
2035
+
2036
+ - Disable the quantity adjust button when the cart is not idle
2037
+ - Use country server state in cart for the inContext directive
2038
+ - Use Image url field instead of deprecated originalSrc field
2039
+ - Switch to unstable API
2040
+
2041
+ ### Fixed
2042
+
2043
+ - Update interaction prompt and interaction promp style attributes for Model3d
2044
+ - Make sure all errors show an error dialog when hydrogen is in dev mode
2045
+ - MediaFile component warning on non-Model3D types
2046
+ - Remove console logs for caching
2047
+ - Lowercased SVG tags in RSC
2048
+ - Make the URL search property available via hooks
2049
+
2050
+ ## 0.5.8 - 2021-11-04
2051
+
2052
+ ### Fixed
2053
+
2054
+ - Ensure delayed callback is fired for cache purposes in Workers runtimes.
2055
+
2056
+ ## 0.5.3 - 2021-11-02
2057
+
2058
+ ### Changed
2059
+
2060
+ - No updates. Transitive dependency bump.
2061
+
2062
+ ## 0.5.2 - 2021-11-02
2063
+
2064
+ ### Changed
2065
+
2066
+ - No updates. Transitive dependency bump.
2067
+
2068
+ ## 0.5.1 - 2021-11-02
2069
+
2070
+ ### Changed
2071
+
2072
+ - No updates. Transitive dependency bump.
2073
+
2074
+ ## 0.5.0 - 2021-11-01
2075
+
2076
+ ### Fixed
2077
+
2078
+ - Update the ServerStateProvider context
2079
+ - Add tabIndex to ShopPayButton
2080
+ - Update LocalizationProvider query, context, and exports
2081
+
2082
+ ## 0.4.3 - 2021-10-29
2083
+
2084
+ ### Added
2085
+
2086
+ - Introduct full-page and sub-request caching API.
2087
+
2088
+ ## 0.4.2 - 2021-10-29
2089
+
2090
+ ### Changed
2091
+
2092
+ - Update Model3D props and add binding to model-viewer events
2093
+
2094
+ ### Fixed
2095
+
2096
+ - Add `passthoughProps.disabled` to `AddToCartButton`
2097
+ - Do not show undefined currency symbol in production
2098
+
2099
+ ## 0.4.0 - 2021-10-27
2100
+
2101
+ ### Added
2102
+
2103
+ - Add external image support to Image component
2104
+
2105
+ ### Changed
2106
+
2107
+ - Make `CartProvider` a client-only concern. [#631](https://github.com/Shopify/hydrogen/pull/631)
2108
+ - Use `Accept: application/hydrogen` as a header when making `fetch` calls against a Hydrogen page. Useful for Custom Responses.
2109
+
2110
+ ### Fixed
2111
+
2112
+ - Lock model-viewer.js version to 1.8
2113
+ - Use the Intl.NumberFormat parts for determining the amount value returned by the useMoney hook
2114
+ - Optimize React related dependencies at server start to avoid page reloads
2115
+ - Do not throw when `storeDomain` contains protocol.
2116
+
2117
+ ## 0.3.0 - 2021-10-20
2118
+
2119
+ ### Added
2120
+
2121
+ - Export utilities in client bundle
2122
+
2123
+ ### Fixed
2124
+
2125
+ - `parseCookies` will split only on first =
2126
+ - Make BuyNowButton a client component since it uses useEffect
2127
+ - Preserve original aspect ratio for product images
2128
+ - Invoke CartProvider callbacks before performing the GraphQL mutations
2129
+ - Fix the accessible label in the AddToCartButton component when an item is added to cart
2130
+ - Cart fetch to return stringified error
2131
+
2132
+ ### Removed
2133
+
2134
+ - Remove sourcemap warnings
2135
+
2136
+ ## 0.2.1 - 2021-10-12
2137
+
2138
+ ### Fixed
2139
+
2140
+ - Demo Store template GalleryPreview unique key warning
2141
+ - Mitigation for upcoming breaking minor Vite update
2142
+
2143
+ ## 0.2.0 - 2021-10-08
2144
+
2145
+ ### Added
2146
+
2147
+ - Added support for images and collections in the ProductProvider component
2148
+ - Added more GraphQL fragments for building block components (Metafield, UnitPrice) and updated exports of these fragments
2149
+
2150
+ ### Breaking Change
2151
+
2152
+ - `useQuery` now behaves exactly like [react-query's hook of the same name](https://react-query.tanstack.com/reference/useQuery#_top)
2153
+
2154
+ ### Fixed
2155
+
2156
+ - Handle products with selling plans
2157
+
2158
+ ## 0.1.2 - 2021-09-30
2159
+
2160
+ ### Fixed
2161
+
2162
+ - SSR issue when running Vite 2.6
2163
+ - Occasional `ProductProviderFragment` error when booting Hydrogen dev server [#571](https://github.com/Shopify/hydrogen/issues/571)
2164
+
2165
+ ## 0.1.1 - 2021-09-24
2166
+
2167
+ ### Added
2168
+
2169
+ - New GraphQL fragments for Variants, SellingPlans, and SellingPlanGroups
2170
+
2171
+ ### Changed
2172
+
2173
+ - Updated types for the `useProductOptions` hook
2174
+
2175
+ ### Fixed
2176
+
2177
+ - `Dynamic require of "stream" is not supported` error in browser logs
2178
+
2179
+ ## 0.1.0 - 2021-09-23
2180
+
2181
+ ### Changed
2182
+
2183
+ - No updates. Transitive dependency bump.
2184
+
2185
+ ## 1.0.0-alpha.22 - 2021-09-22
2186
+
2187
+ ### Changed
2188
+
2189
+ - No updates. Transitive dependency bump.
2190
+
2191
+ [0.6.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.0
2192
+ [0.6.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.1
2193
+ [0.6.2]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.2
2194
+ [0.6.3]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.3
2195
+ [0.6.4]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.4
2196
+ [0.7.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.7.0
2197
+ [0.7.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.7.1
2198
+ [0.8.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.0
2199
+ [0.8.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.1
2200
+ [0.8.2]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.2
2201
+ [0.8.3]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.3
2202
+ [0.9.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.9.0
2203
+ [0.9.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.9.1
2204
+ [0.10.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.0
2205
+ [0.10.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.1
2206
+ [0.11.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.11.0