@shopify/hydrogen 1.0.0-alpha.22 → 1.0.0

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