@shopify/hydrogen 0.0.0-experimental-20220526194818

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 (692) hide show
  1. package/CHANGELOG.md +1643 -0
  2. package/README.md +29 -0
  3. package/client.d.ts +1 -0
  4. package/client.js +1 -0
  5. package/config.d.ts +1 -0
  6. package/config.js +1 -0
  7. package/dist/esnext/FileSessionStorage.d.ts +1 -0
  8. package/dist/esnext/FileSessionStorage.js +1 -0
  9. package/dist/esnext/client.d.ts +16 -0
  10. package/dist/esnext/client.js +16 -0
  11. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +23 -0
  12. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +47 -0
  13. package/dist/esnext/components/AddToCartButton/index.d.ts +1 -0
  14. package/dist/esnext/components/AddToCartButton/index.js +1 -0
  15. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +18 -0
  16. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +26 -0
  17. package/dist/esnext/components/BuyNowButton/index.d.ts +1 -0
  18. package/dist/esnext/components/BuyNowButton/index.js +1 -0
  19. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +11 -0
  20. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +17 -0
  21. package/dist/esnext/components/CartCheckoutButton/index.d.ts +1 -0
  22. package/dist/esnext/components/CartCheckoutButton/index.js +1 -0
  23. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +14 -0
  24. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.js +29 -0
  25. package/dist/esnext/components/CartEstimatedCost/index.d.ts +1 -0
  26. package/dist/esnext/components/CartEstimatedCost/index.js +1 -0
  27. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +9 -0
  28. package/dist/esnext/components/CartLineImage/CartLineImage.client.js +11 -0
  29. package/dist/esnext/components/CartLineImage/index.d.ts +1 -0
  30. package/dist/esnext/components/CartLineImage/index.js +1 -0
  31. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +12 -0
  32. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +21 -0
  33. package/dist/esnext/components/CartLinePrice/index.d.ts +1 -0
  34. package/dist/esnext/components/CartLinePrice/index.js +1 -0
  35. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -0
  36. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +12 -0
  37. package/dist/esnext/components/CartLineProductTitle/index.d.ts +1 -0
  38. package/dist/esnext/components/CartLineProductTitle/index.js +1 -0
  39. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +11 -0
  40. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +8 -0
  41. package/dist/esnext/components/CartLineProvider/context.d.ts +26 -0
  42. package/dist/esnext/components/CartLineProvider/context.js +2 -0
  43. package/dist/esnext/components/CartLineProvider/index.d.ts +2 -0
  44. package/dist/esnext/components/CartLineProvider/index.js +2 -0
  45. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -0
  46. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +12 -0
  47. package/dist/esnext/components/CartLineQuantity/index.d.ts +1 -0
  48. package/dist/esnext/components/CartLineQuantity/index.js +1 -0
  49. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +14 -0
  50. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +24 -0
  51. package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
  52. package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +1 -0
  53. package/dist/esnext/components/CartLines/CartLines.d.ts +15 -0
  54. package/dist/esnext/components/CartLines/CartLines.js +17 -0
  55. package/dist/esnext/components/CartLines/index.d.ts +1 -0
  56. package/dist/esnext/components/CartLines/index.js +1 -0
  57. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +41 -0
  58. package/dist/esnext/components/CartProvider/CartProvider.client.js +523 -0
  59. package/dist/esnext/components/CartProvider/cart-queries.d.ts +10 -0
  60. package/dist/esnext/components/CartProvider/cart-queries.js +191 -0
  61. package/dist/esnext/components/CartProvider/constants.d.ts +2 -0
  62. package/dist/esnext/components/CartProvider/constants.js +2 -0
  63. package/dist/esnext/components/CartProvider/context.d.ts +2 -0
  64. package/dist/esnext/components/CartProvider/context.js +2 -0
  65. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +86 -0
  66. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.js +1 -0
  67. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +86 -0
  68. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +1 -0
  69. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +85 -0
  70. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.js +1 -0
  71. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +86 -0
  72. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +1 -0
  73. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +72 -0
  74. package/dist/esnext/components/CartProvider/graphql/CartFragment.js +1 -0
  75. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +86 -0
  76. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.js +1 -0
  77. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +86 -0
  78. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.js +1 -0
  79. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +86 -0
  80. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.js +1 -0
  81. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +86 -0
  82. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.js +1 -0
  83. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +81 -0
  84. package/dist/esnext/components/CartProvider/graphql/CartQuery.js +1 -0
  85. package/dist/esnext/components/CartProvider/hooks.client.d.ts +15 -0
  86. package/dist/esnext/components/CartProvider/hooks.client.js +62 -0
  87. package/dist/esnext/components/CartProvider/index.d.ts +4 -0
  88. package/dist/esnext/components/CartProvider/index.js +3 -0
  89. package/dist/esnext/components/CartProvider/types.d.ts +102 -0
  90. package/dist/esnext/components/CartProvider/types.js +1 -0
  91. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +9 -0
  92. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +19 -0
  93. package/dist/esnext/components/CartShopPayButton/index.d.ts +1 -0
  94. package/dist/esnext/components/CartShopPayButton/index.js +1 -0
  95. package/dist/esnext/components/DevTools.client.d.ts +1 -0
  96. package/dist/esnext/components/DevTools.client.js +129 -0
  97. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +21 -0
  98. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +14 -0
  99. package/dist/esnext/components/ExternalVideo/index.d.ts +1 -0
  100. package/dist/esnext/components/ExternalVideo/index.js +1 -0
  101. package/dist/esnext/components/Image/Image.d.ts +84 -0
  102. package/dist/esnext/components/Image/Image.js +59 -0
  103. package/dist/esnext/components/Image/index.d.ts +2 -0
  104. package/dist/esnext/components/Image/index.js +1 -0
  105. package/dist/esnext/components/Link/Link.client.d.ts +23 -0
  106. package/dist/esnext/components/Link/Link.client.js +135 -0
  107. package/dist/esnext/components/Link/index.d.ts +1 -0
  108. package/dist/esnext/components/Link/index.js +1 -0
  109. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
  110. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +5 -0
  111. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -0
  112. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.js +2 -0
  113. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +33 -0
  114. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +44 -0
  115. package/dist/esnext/components/LocalizationProvider/index.d.ts +2 -0
  116. package/dist/esnext/components/LocalizationProvider/index.js +2 -0
  117. package/dist/esnext/components/MediaFile/MediaFile.d.ts +19 -0
  118. package/dist/esnext/components/MediaFile/MediaFile.js +31 -0
  119. package/dist/esnext/components/MediaFile/index.d.ts +1 -0
  120. package/dist/esnext/components/MediaFile/index.js +1 -0
  121. package/dist/esnext/components/Metafield/Metafield.client.d.ts +21 -0
  122. package/dist/esnext/components/Metafield/Metafield.client.js +68 -0
  123. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +12 -0
  124. package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +48 -0
  125. package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +1 -0
  126. package/dist/esnext/components/Metafield/components/StarRating/index.js +1 -0
  127. package/dist/esnext/components/Metafield/components/index.d.ts +1 -0
  128. package/dist/esnext/components/Metafield/components/index.js +1 -0
  129. package/dist/esnext/components/Metafield/index.d.ts +2 -0
  130. package/dist/esnext/components/Metafield/index.js +1 -0
  131. package/dist/esnext/components/Metafield/types.d.ts +4 -0
  132. package/dist/esnext/components/Metafield/types.js +1 -0
  133. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  134. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +105 -0
  135. package/dist/esnext/components/ModelViewer/index.d.ts +1 -0
  136. package/dist/esnext/components/ModelViewer/index.js +1 -0
  137. package/dist/esnext/components/Money/Money.client.d.ts +25 -0
  138. package/dist/esnext/components/Money/Money.client.js +39 -0
  139. package/dist/esnext/components/Money/index.d.ts +1 -0
  140. package/dist/esnext/components/Money/index.js +1 -0
  141. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +15 -0
  142. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +56 -0
  143. package/dist/esnext/components/ProductPrice/index.d.ts +1 -0
  144. package/dist/esnext/components/ProductPrice/index.js +1 -0
  145. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +8 -0
  146. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +12 -0
  147. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +24 -0
  148. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +34 -0
  149. package/dist/esnext/components/ProductProvider/context.d.ts +29 -0
  150. package/dist/esnext/components/ProductProvider/context.js +3 -0
  151. package/dist/esnext/components/ProductProvider/index.d.ts +2 -0
  152. package/dist/esnext/components/ProductProvider/index.js +2 -0
  153. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +3 -0
  154. package/dist/esnext/components/Seo/CollectionSeo.client.js +15 -0
  155. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  156. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +18 -0
  157. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +4 -0
  158. package/dist/esnext/components/Seo/DescriptionSeo.client.js +10 -0
  159. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +2 -0
  160. package/dist/esnext/components/Seo/HomePageSeo.client.js +25 -0
  161. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +3 -0
  162. package/dist/esnext/components/Seo/ImageSeo.client.js +10 -0
  163. package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +3 -0
  164. package/dist/esnext/components/Seo/NoIndexSeo.client.js +10 -0
  165. package/dist/esnext/components/Seo/PageSeo.client.d.ts +3 -0
  166. package/dist/esnext/components/Seo/PageSeo.client.js +13 -0
  167. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +5 -0
  168. package/dist/esnext/components/Seo/ProductSeo.client.js +63 -0
  169. package/dist/esnext/components/Seo/Seo.client.d.ts +30 -0
  170. package/dist/esnext/components/Seo/Seo.client.js +31 -0
  171. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +3 -0
  172. package/dist/esnext/components/Seo/TitleSeo.client.js +10 -0
  173. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +2 -0
  174. package/dist/esnext/components/Seo/TwitterSeo.client.js +9 -0
  175. package/dist/esnext/components/Seo/index.d.ts +1 -0
  176. package/dist/esnext/components/Seo/index.js +1 -0
  177. package/dist/esnext/components/Seo/seo-types.d.ts +17 -0
  178. package/dist/esnext/components/Seo/seo-types.js +1 -0
  179. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +38 -0
  180. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +52 -0
  181. package/dist/esnext/components/ShopPayButton/index.d.ts +1 -0
  182. package/dist/esnext/components/ShopPayButton/index.js +1 -0
  183. package/dist/esnext/components/Video/Video.d.ts +14 -0
  184. package/dist/esnext/components/Video/Video.js +24 -0
  185. package/dist/esnext/components/Video/index.d.ts +1 -0
  186. package/dist/esnext/components/Video/index.js +1 -0
  187. package/dist/esnext/components/index.d.ts +28 -0
  188. package/dist/esnext/components/index.js +26 -0
  189. package/dist/esnext/components/types.d.ts +71 -0
  190. package/dist/esnext/components/types.js +10 -0
  191. package/dist/esnext/config.d.ts +3 -0
  192. package/dist/esnext/config.js +1 -0
  193. package/dist/esnext/constants.d.ts +7 -0
  194. package/dist/esnext/constants.js +7 -0
  195. package/dist/esnext/entry-client.d.ts +3 -0
  196. package/dist/esnext/entry-client.js +73 -0
  197. package/dist/esnext/entry-server.d.ts +35 -0
  198. package/dist/esnext/entry-server.js +529 -0
  199. package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +3 -0
  200. package/dist/esnext/foundation/Analytics/Analytics.client.js +28 -0
  201. package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +1 -0
  202. package/dist/esnext/foundation/Analytics/Analytics.server.js +40 -0
  203. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +25 -0
  204. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +97 -0
  205. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.d.ts +2 -0
  206. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +33 -0
  207. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  208. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +64 -0
  209. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +1 -0
  210. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.js +24 -0
  211. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  212. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +23 -0
  213. package/dist/esnext/foundation/Analytics/const.d.ts +9 -0
  214. package/dist/esnext/foundation/Analytics/const.js +9 -0
  215. package/dist/esnext/foundation/Analytics/hook.d.ts +1 -0
  216. package/dist/esnext/foundation/Analytics/hook.js +7 -0
  217. package/dist/esnext/foundation/Analytics/index.d.ts +2 -0
  218. package/dist/esnext/foundation/Analytics/index.js +2 -0
  219. package/dist/esnext/foundation/Analytics/types.d.ts +5 -0
  220. package/dist/esnext/foundation/Analytics/types.js +1 -0
  221. package/dist/esnext/foundation/Analytics/utils.d.ts +1 -0
  222. package/dist/esnext/foundation/Analytics/utils.js +8 -0
  223. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +4 -0
  224. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +8 -0
  225. package/dist/esnext/foundation/Cookie/Cookie.d.ts +48 -0
  226. package/dist/esnext/foundation/Cookie/Cookie.js +67 -0
  227. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +5 -0
  228. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +31 -0
  229. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  230. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +74 -0
  231. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +6 -0
  232. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +149 -0
  233. package/dist/esnext/foundation/Head/Head.client.d.ts +5 -0
  234. package/dist/esnext/foundation/Head/Head.client.js +10 -0
  235. package/dist/esnext/foundation/Head/index.d.ts +1 -0
  236. package/dist/esnext/foundation/Head/index.js +1 -0
  237. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +5 -0
  238. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +53 -0
  239. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  240. package/dist/esnext/foundation/Redirect/Redirect.client.js +15 -0
  241. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  242. package/dist/esnext/foundation/Route/Route.server.js +28 -0
  243. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +13 -0
  244. package/dist/esnext/foundation/Router/BrowserRouter.client.js +130 -0
  245. package/dist/esnext/foundation/Router/Router.server.d.ts +10 -0
  246. package/dist/esnext/foundation/Router/Router.server.js +8 -0
  247. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +40 -0
  248. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +67 -0
  249. package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +2 -0
  250. package/dist/esnext/foundation/ServerPropsProvider/index.js +1 -0
  251. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +23 -0
  252. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +128 -0
  253. package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +1 -0
  254. package/dist/esnext/foundation/ServerRequestProvider/index.js +1 -0
  255. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +30 -0
  256. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +59 -0
  257. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  258. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +8 -0
  259. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +16 -0
  260. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +58 -0
  261. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +1 -0
  262. package/dist/esnext/foundation/ShopifyProvider/index.js +1 -0
  263. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +13 -0
  264. package/dist/esnext/foundation/ShopifyProvider/types.js +1 -0
  265. package/dist/esnext/foundation/constants.d.ts +1 -0
  266. package/dist/esnext/foundation/constants.js +3 -0
  267. package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  268. package/dist/esnext/foundation/fetchSync/client/fetchSync.js +28 -0
  269. package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  270. package/dist/esnext/foundation/fetchSync/server/fetchSync.js +29 -0
  271. package/dist/esnext/foundation/fetchSync/types.d.ts +5 -0
  272. package/dist/esnext/foundation/fetchSync/types.js +1 -0
  273. package/dist/esnext/foundation/index.d.ts +3 -0
  274. package/dist/esnext/foundation/index.js +3 -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 +13 -0
  280. package/dist/esnext/foundation/useNavigate/useNavigate.js +14 -0
  281. package/dist/esnext/foundation/useQuery/hooks.d.ts +36 -0
  282. package/dist/esnext/foundation/useQuery/hooks.js +97 -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/useRouteParams/RouteParamsProvider.client.d.ts +9 -0
  286. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +7 -0
  287. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  288. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  289. package/dist/esnext/foundation/useServerProps/index.d.ts +1 -0
  290. package/dist/esnext/foundation/useServerProps/index.js +1 -0
  291. package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +21 -0
  292. package/dist/esnext/foundation/useServerProps/use-server-props.js +35 -0
  293. package/dist/esnext/foundation/useSession/useSession.d.ts +2 -0
  294. package/dist/esnext/foundation/useSession/useSession.js +8 -0
  295. package/dist/esnext/foundation/useShop/index.d.ts +1 -0
  296. package/dist/esnext/foundation/useShop/index.js +1 -0
  297. package/dist/esnext/foundation/useShop/use-shop.d.ts +6 -0
  298. package/dist/esnext/foundation/useShop/use-shop.js +14 -0
  299. package/dist/esnext/foundation/useUrl/index.d.ts +1 -0
  300. package/dist/esnext/foundation/useUrl/index.js +1 -0
  301. package/dist/esnext/foundation/useUrl/useUrl.d.ts +4 -0
  302. package/dist/esnext/foundation/useUrl/useUrl.js +28 -0
  303. package/dist/esnext/framework/CachingStrategy/index.d.ts +10 -0
  304. package/dist/esnext/framework/CachingStrategy/index.js +96 -0
  305. package/dist/esnext/framework/Hydration/Html.d.ts +11 -0
  306. package/dist/esnext/framework/Hydration/Html.js +86 -0
  307. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.d.ts +58 -0
  308. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.js +146 -0
  309. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.d.ts +26 -0
  310. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +42 -0
  311. package/dist/esnext/framework/Hydration/rsc.d.ts +8 -0
  312. package/dist/esnext/framework/Hydration/rsc.js +100 -0
  313. package/dist/esnext/framework/cache/in-memory.d.ts +12 -0
  314. package/dist/esnext/framework/cache/in-memory.js +52 -0
  315. package/dist/esnext/framework/cache-sub-request.d.ts +17 -0
  316. package/dist/esnext/framework/cache-sub-request.js +64 -0
  317. package/dist/esnext/framework/cache.d.ts +17 -0
  318. package/dist/esnext/framework/cache.js +127 -0
  319. package/dist/esnext/framework/config.d.ts +6 -0
  320. package/dist/esnext/framework/config.js +6 -0
  321. package/dist/esnext/framework/graphiql.d.ts +1 -0
  322. package/dist/esnext/framework/graphiql.js +38 -0
  323. package/dist/esnext/framework/middleware.d.ts +21 -0
  324. package/dist/esnext/framework/middleware.js +98 -0
  325. package/dist/esnext/framework/plugin.d.ts +4 -0
  326. package/dist/esnext/framework/plugin.js +28 -0
  327. package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  328. package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +25 -0
  329. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  330. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +98 -0
  331. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  332. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +35 -0
  333. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  334. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.js +37 -0
  335. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +3 -0
  336. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +96 -0
  337. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +11 -0
  338. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +110 -0
  339. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +1 -0
  340. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +35 -0
  341. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  342. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +70 -0
  343. package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.d.ts +3 -0
  344. package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.js +11 -0
  345. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.d.ts +3 -0
  346. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +16 -0
  347. package/dist/esnext/framework/runtime.d.ts +13 -0
  348. package/dist/esnext/framework/runtime.js +27 -0
  349. package/dist/esnext/hooks/index.d.ts +6 -0
  350. package/dist/esnext/hooks/index.js +6 -0
  351. package/dist/esnext/hooks/useCart/index.d.ts +1 -0
  352. package/dist/esnext/hooks/useCart/index.js +1 -0
  353. package/dist/esnext/hooks/useCart/useCart.d.ts +4 -0
  354. package/dist/esnext/hooks/useCart/useCart.js +12 -0
  355. package/dist/esnext/hooks/useCartLine/index.d.ts +1 -0
  356. package/dist/esnext/hooks/useCartLine/index.js +1 -0
  357. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +29 -0
  358. package/dist/esnext/hooks/useCartLine/useCartLine.js +12 -0
  359. package/dist/esnext/hooks/useCountry/index.d.ts +1 -0
  360. package/dist/esnext/hooks/useCountry/index.js +1 -0
  361. package/dist/esnext/hooks/useCountry/useCountry.d.ts +7 -0
  362. package/dist/esnext/hooks/useCountry/useCountry.js +17 -0
  363. package/dist/esnext/hooks/useLoadScript/index.d.ts +1 -0
  364. package/dist/esnext/hooks/useLoadScript/index.js +1 -0
  365. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  366. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +23 -0
  367. package/dist/esnext/hooks/useMeasurement/hooks.d.ts +9 -0
  368. package/dist/esnext/hooks/useMeasurement/hooks.js +13 -0
  369. package/dist/esnext/hooks/useMeasurement/index.d.ts +1 -0
  370. package/dist/esnext/hooks/useMeasurement/index.js +1 -0
  371. package/dist/esnext/hooks/useMoney/hooks.d.ts +54 -0
  372. package/dist/esnext/hooks/useMoney/hooks.js +66 -0
  373. package/dist/esnext/hooks/useMoney/index.d.ts +1 -0
  374. package/dist/esnext/hooks/useMoney/index.js +1 -0
  375. package/dist/esnext/hooks/useParsedMetafields/index.d.ts +1 -0
  376. package/dist/esnext/hooks/useParsedMetafields/index.js +1 -0
  377. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +21 -0
  378. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.js +21 -0
  379. package/dist/esnext/hooks/useProduct/index.d.ts +1 -0
  380. package/dist/esnext/hooks/useProduct/index.js +1 -0
  381. package/dist/esnext/hooks/useProduct/useProduct.d.ts +52 -0
  382. package/dist/esnext/hooks/useProduct/useProduct.js +43 -0
  383. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -0
  384. package/dist/esnext/hooks/useProductOptions/helpers.js +40 -0
  385. package/dist/esnext/hooks/useProductOptions/index.d.ts +2 -0
  386. package/dist/esnext/hooks/useProductOptions/index.js +2 -0
  387. package/dist/esnext/hooks/useProductOptions/types.d.ts +42 -0
  388. package/dist/esnext/hooks/useProductOptions/types.js +1 -0
  389. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +15 -0
  390. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +108 -0
  391. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +28 -0
  392. package/dist/esnext/hooks/useShopQuery/hooks.js +161 -0
  393. package/dist/esnext/hooks/useShopQuery/index.d.ts +1 -0
  394. package/dist/esnext/hooks/useShopQuery/index.js +1 -0
  395. package/dist/esnext/index.d.ts +27 -0
  396. package/dist/esnext/index.js +31 -0
  397. package/dist/esnext/node.d.ts +1 -0
  398. package/dist/esnext/node.js +1 -0
  399. package/dist/esnext/platforms/node.d.ts +9 -0
  400. package/dist/esnext/platforms/node.js +40 -0
  401. package/dist/esnext/platforms/worker-event.d.ts +1 -0
  402. package/dist/esnext/platforms/worker-event.js +3 -0
  403. package/dist/esnext/platforms/worker.d.ts +14 -0
  404. package/dist/esnext/platforms/worker.js +25 -0
  405. package/dist/esnext/storefront-api-types.d.ts +6405 -0
  406. package/dist/esnext/storefront-api-types.js +1763 -0
  407. package/dist/esnext/streaming.server.d.ts +24 -0
  408. package/dist/esnext/streaming.server.js +33 -0
  409. package/dist/esnext/types.d.ts +98 -0
  410. package/dist/esnext/types.js +1 -0
  411. package/dist/esnext/utilities/apiRoutes.d.ts +37 -0
  412. package/dist/esnext/utilities/apiRoutes.js +156 -0
  413. package/dist/esnext/utilities/bot-ua.d.ts +4 -0
  414. package/dist/esnext/utilities/bot-ua.js +61 -0
  415. package/dist/esnext/utilities/defer.d.ts +6 -0
  416. package/dist/esnext/utilities/defer.js +14 -0
  417. package/dist/esnext/utilities/devtools.d.ts +11 -0
  418. package/dist/esnext/utilities/devtools.js +11 -0
  419. package/dist/esnext/utilities/empty-hydrogen-config.d.ts +2 -0
  420. package/dist/esnext/utilities/empty-hydrogen-config.js +2 -0
  421. package/dist/esnext/utilities/error.d.ts +1 -0
  422. package/dist/esnext/utilities/error.js +6 -0
  423. package/dist/esnext/utilities/fetch.d.ts +9 -0
  424. package/dist/esnext/utilities/fetch.js +31 -0
  425. package/dist/esnext/utilities/findRoutePrefix.d.ts +1 -0
  426. package/dist/esnext/utilities/findRoutePrefix.js +17 -0
  427. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +6 -0
  428. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +11 -0
  429. package/dist/esnext/utilities/flattenConnection/index.d.ts +1 -0
  430. package/dist/esnext/utilities/flattenConnection/index.js +1 -0
  431. package/dist/esnext/utilities/graphql-tag.d.ts +1 -0
  432. package/dist/esnext/utilities/graphql-tag.js +6 -0
  433. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  434. package/dist/esnext/utilities/graphql-tracker.js +123 -0
  435. package/dist/esnext/utilities/hash.d.ts +2 -0
  436. package/dist/esnext/utilities/hash.js +7 -0
  437. package/dist/esnext/utilities/html-encoding.d.ts +2 -0
  438. package/dist/esnext/utilities/html-encoding.js +16 -0
  439. package/dist/esnext/utilities/image_size.d.ts +12 -0
  440. package/dist/esnext/utilities/image_size.js +62 -0
  441. package/dist/esnext/utilities/index.d.ts +12 -0
  442. package/dist/esnext/utilities/index.js +12 -0
  443. package/dist/esnext/utilities/isClient/index.d.ts +1 -0
  444. package/dist/esnext/utilities/isClient/index.js +1 -0
  445. package/dist/esnext/utilities/isClient/isClient.d.ts +4 -0
  446. package/dist/esnext/utilities/isClient/isClient.js +6 -0
  447. package/dist/esnext/utilities/isServer/index.d.ts +1 -0
  448. package/dist/esnext/utilities/isServer/index.js +1 -0
  449. package/dist/esnext/utilities/isServer/isServer.d.ts +4 -0
  450. package/dist/esnext/utilities/isServer/isServer.js +7 -0
  451. package/dist/esnext/utilities/load_script.d.ts +3 -0
  452. package/dist/esnext/utilities/load_script.js +23 -0
  453. package/dist/esnext/utilities/log/index.d.ts +4 -0
  454. package/dist/esnext/utilities/log/index.js +4 -0
  455. package/dist/esnext/utilities/log/log-cache-api-status.d.ts +1 -0
  456. package/dist/esnext/utilities/log/log-cache-api-status.js +13 -0
  457. package/dist/esnext/utilities/log/log-cache-header.d.ts +10 -0
  458. package/dist/esnext/utilities/log/log-cache-header.js +30 -0
  459. package/dist/esnext/utilities/log/log-query-timeline.d.ts +12 -0
  460. package/dist/esnext/utilities/log/log-query-timeline.js +83 -0
  461. package/dist/esnext/utilities/log/log.d.ts +22 -0
  462. package/dist/esnext/utilities/log/log.js +66 -0
  463. package/dist/esnext/utilities/log/utils.d.ts +3 -0
  464. package/dist/esnext/utilities/log/utils.js +16 -0
  465. package/dist/esnext/utilities/matchPath.d.ts +10 -0
  466. package/dist/esnext/utilities/matchPath.js +54 -0
  467. package/dist/esnext/utilities/measurement.d.ts +3 -0
  468. package/dist/esnext/utilities/measurement.js +98 -0
  469. package/dist/esnext/utilities/object.d.ts +5 -0
  470. package/dist/esnext/utilities/object.js +7 -0
  471. package/dist/esnext/utilities/parse.d.ts +1 -0
  472. package/dist/esnext/utilities/parse.js +9 -0
  473. package/dist/esnext/utilities/parseMetafieldValue/index.d.ts +1 -0
  474. package/dist/esnext/utilities/parseMetafieldValue/index.js +1 -0
  475. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +6 -0
  476. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.js +36 -0
  477. package/dist/esnext/utilities/storefrontApi.d.ts +4 -0
  478. package/dist/esnext/utilities/storefrontApi.js +22 -0
  479. package/dist/esnext/utilities/suspense.d.ts +12 -0
  480. package/dist/esnext/utilities/suspense.js +58 -0
  481. package/dist/esnext/utilities/template.d.ts +9 -0
  482. package/dist/esnext/utilities/template.js +23 -0
  483. package/dist/esnext/utilities/timing.d.ts +7 -0
  484. package/dist/esnext/utilities/timing.js +14 -0
  485. package/dist/esnext/utilities/video_parameters.d.ts +47 -0
  486. package/dist/esnext/utilities/video_parameters.js +22 -0
  487. package/dist/esnext/utilities/web-api-polyfill.d.ts +1 -0
  488. package/dist/esnext/utilities/web-api-polyfill.js +19 -0
  489. package/dist/esnext/version.d.ts +1 -0
  490. package/dist/esnext/version.js +1 -0
  491. package/dist/node/components/Image/Image.d.ts +84 -0
  492. package/dist/node/components/Image/Image.js +86 -0
  493. package/dist/node/components/Image/index.d.ts +2 -0
  494. package/dist/node/components/Image/index.js +5 -0
  495. package/dist/node/constants.d.ts +7 -0
  496. package/dist/node/constants.js +10 -0
  497. package/dist/node/entry-server.d.ts +35 -0
  498. package/dist/node/entry-server.js +556 -0
  499. package/dist/node/foundation/Analytics/Analytics.client.d.ts +3 -0
  500. package/dist/node/foundation/Analytics/Analytics.client.js +32 -0
  501. package/dist/node/foundation/Analytics/Analytics.server.d.ts +1 -0
  502. package/dist/node/foundation/Analytics/Analytics.server.js +70 -0
  503. package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +25 -0
  504. package/dist/node/foundation/Analytics/ClientAnalytics.js +100 -0
  505. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.d.ts +2 -0
  506. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +37 -0
  507. package/dist/node/foundation/Analytics/const.d.ts +9 -0
  508. package/dist/node/foundation/Analytics/const.js +12 -0
  509. package/dist/node/foundation/Analytics/hook.d.ts +1 -0
  510. package/dist/node/foundation/Analytics/hook.js +11 -0
  511. package/dist/node/foundation/Analytics/index.d.ts +2 -0
  512. package/dist/node/foundation/Analytics/index.js +7 -0
  513. package/dist/node/foundation/Analytics/types.d.ts +5 -0
  514. package/dist/node/foundation/Analytics/types.js +2 -0
  515. package/dist/node/foundation/Analytics/utils.d.ts +1 -0
  516. package/dist/node/foundation/Analytics/utils.js +12 -0
  517. package/dist/node/foundation/AnalyticsErrorBoundary.client.d.ts +4 -0
  518. package/dist/node/foundation/AnalyticsErrorBoundary.client.js +14 -0
  519. package/dist/node/foundation/Redirect/Redirect.client.d.ts +5 -0
  520. package/dist/node/foundation/Redirect/Redirect.client.js +18 -0
  521. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +13 -0
  522. package/dist/node/foundation/Router/BrowserRouter.client.js +159 -0
  523. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +40 -0
  524. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +92 -0
  525. package/dist/node/foundation/ServerPropsProvider/index.d.ts +2 -0
  526. package/dist/node/foundation/ServerPropsProvider/index.js +6 -0
  527. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +23 -0
  528. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +158 -0
  529. package/dist/node/foundation/ServerRequestProvider/index.d.ts +1 -0
  530. package/dist/node/foundation/ServerRequestProvider/index.js +17 -0
  531. package/dist/node/foundation/ShopifyProvider/types.d.ts +13 -0
  532. package/dist/node/foundation/ShopifyProvider/types.js +2 -0
  533. package/dist/node/foundation/session/session.d.ts +27 -0
  534. package/dist/node/foundation/session/session.js +43 -0
  535. package/dist/node/foundation/ssr-interop.d.ts +29 -0
  536. package/dist/node/foundation/ssr-interop.js +39 -0
  537. package/dist/node/foundation/useNavigate/useNavigate.d.ts +13 -0
  538. package/dist/node/foundation/useNavigate/useNavigate.js +18 -0
  539. package/dist/node/foundation/useServerProps/use-server-props.d.ts +21 -0
  540. package/dist/node/foundation/useServerProps/use-server-props.js +40 -0
  541. package/dist/node/framework/CachingStrategy/index.d.ts +10 -0
  542. package/dist/node/framework/CachingStrategy/index.js +108 -0
  543. package/dist/node/framework/Hydration/Html.d.ts +11 -0
  544. package/dist/node/framework/Hydration/Html.js +94 -0
  545. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +58 -0
  546. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +150 -0
  547. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +26 -0
  548. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +49 -0
  549. package/dist/node/framework/Hydration/rsc.d.ts +8 -0
  550. package/dist/node/framework/Hydration/rsc.js +103 -0
  551. package/dist/node/framework/cache/in-memory.d.ts +12 -0
  552. package/dist/node/framework/cache/in-memory.js +56 -0
  553. package/dist/node/framework/cache-sub-request.d.ts +17 -0
  554. package/dist/node/framework/cache-sub-request.js +95 -0
  555. package/dist/node/framework/cache.d.ts +17 -0
  556. package/dist/node/framework/cache.js +135 -0
  557. package/dist/node/framework/config.d.ts +6 -0
  558. package/dist/node/framework/config.js +11 -0
  559. package/dist/node/framework/graphiql.d.ts +1 -0
  560. package/dist/node/framework/graphiql.js +42 -0
  561. package/dist/node/framework/middleware.d.ts +21 -0
  562. package/dist/node/framework/middleware.js +125 -0
  563. package/dist/node/framework/plugin.d.ts +4 -0
  564. package/dist/node/framework/plugin.js +33 -0
  565. package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  566. package/dist/node/framework/plugins/vite-plugin-client-imports.js +28 -0
  567. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  568. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +104 -0
  569. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  570. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +40 -0
  571. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  572. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.js +39 -0
  573. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +3 -0
  574. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +98 -0
  575. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +11 -0
  576. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +116 -0
  577. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +1 -0
  578. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +41 -0
  579. package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  580. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +75 -0
  581. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.d.ts +3 -0
  582. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.js +16 -0
  583. package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +3 -0
  584. package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +18 -0
  585. package/dist/node/framework/runtime.d.ts +13 -0
  586. package/dist/node/framework/runtime.js +35 -0
  587. package/dist/node/storefront-api-types.d.ts +6405 -0
  588. package/dist/node/storefront-api-types.js +1766 -0
  589. package/dist/node/streaming.server.d.ts +24 -0
  590. package/dist/node/streaming.server.js +33 -0
  591. package/dist/node/types.d.ts +98 -0
  592. package/dist/node/types.js +2 -0
  593. package/dist/node/utilities/apiRoutes.d.ts +37 -0
  594. package/dist/node/utilities/apiRoutes.js +163 -0
  595. package/dist/node/utilities/bot-ua.d.ts +4 -0
  596. package/dist/node/utilities/bot-ua.js +65 -0
  597. package/dist/node/utilities/defer.d.ts +6 -0
  598. package/dist/node/utilities/defer.js +18 -0
  599. package/dist/node/utilities/error.d.ts +1 -0
  600. package/dist/node/utilities/error.js +10 -0
  601. package/dist/node/utilities/fetch.d.ts +9 -0
  602. package/dist/node/utilities/fetch.js +37 -0
  603. package/dist/node/utilities/findRoutePrefix.d.ts +1 -0
  604. package/dist/node/utilities/findRoutePrefix.js +21 -0
  605. package/dist/node/utilities/flattenConnection/flattenConnection.d.ts +6 -0
  606. package/dist/node/utilities/flattenConnection/flattenConnection.js +15 -0
  607. package/dist/node/utilities/flattenConnection/index.d.ts +1 -0
  608. package/dist/node/utilities/flattenConnection/index.js +5 -0
  609. package/dist/node/utilities/hash.d.ts +2 -0
  610. package/dist/node/utilities/hash.js +11 -0
  611. package/dist/node/utilities/html-encoding.d.ts +2 -0
  612. package/dist/node/utilities/html-encoding.js +21 -0
  613. package/dist/node/utilities/image_size.d.ts +12 -0
  614. package/dist/node/utilities/image_size.js +68 -0
  615. package/dist/node/utilities/index.d.ts +12 -0
  616. package/dist/node/utilities/index.js +34 -0
  617. package/dist/node/utilities/isClient/index.d.ts +1 -0
  618. package/dist/node/utilities/isClient/index.js +5 -0
  619. package/dist/node/utilities/isClient/isClient.d.ts +4 -0
  620. package/dist/node/utilities/isClient/isClient.js +10 -0
  621. package/dist/node/utilities/isServer/index.d.ts +1 -0
  622. package/dist/node/utilities/isServer/index.js +5 -0
  623. package/dist/node/utilities/isServer/isServer.d.ts +4 -0
  624. package/dist/node/utilities/isServer/isServer.js +11 -0
  625. package/dist/node/utilities/load_script.d.ts +3 -0
  626. package/dist/node/utilities/load_script.js +27 -0
  627. package/dist/node/utilities/log/index.d.ts +4 -0
  628. package/dist/node/utilities/log/index.js +18 -0
  629. package/dist/node/utilities/log/log-cache-api-status.d.ts +1 -0
  630. package/dist/node/utilities/log/log-cache-api-status.js +17 -0
  631. package/dist/node/utilities/log/log-cache-header.d.ts +10 -0
  632. package/dist/node/utilities/log/log-cache-header.js +35 -0
  633. package/dist/node/utilities/log/log-query-timeline.d.ts +12 -0
  634. package/dist/node/utilities/log/log-query-timeline.js +88 -0
  635. package/dist/node/utilities/log/log.d.ts +22 -0
  636. package/dist/node/utilities/log/log.js +74 -0
  637. package/dist/node/utilities/log/utils.d.ts +3 -0
  638. package/dist/node/utilities/log/utils.js +21 -0
  639. package/dist/node/utilities/matchPath.d.ts +10 -0
  640. package/dist/node/utilities/matchPath.js +58 -0
  641. package/dist/node/utilities/measurement.d.ts +3 -0
  642. package/dist/node/utilities/measurement.js +103 -0
  643. package/dist/node/utilities/parse.d.ts +1 -0
  644. package/dist/node/utilities/parse.js +13 -0
  645. package/dist/node/utilities/parseMetafieldValue/index.d.ts +1 -0
  646. package/dist/node/utilities/parseMetafieldValue/index.js +5 -0
  647. package/dist/node/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +6 -0
  648. package/dist/node/utilities/parseMetafieldValue/parseMetafieldValue.js +40 -0
  649. package/dist/node/utilities/storefrontApi.d.ts +4 -0
  650. package/dist/node/utilities/storefrontApi.js +26 -0
  651. package/dist/node/utilities/suspense.d.ts +12 -0
  652. package/dist/node/utilities/suspense.js +64 -0
  653. package/dist/node/utilities/template.d.ts +9 -0
  654. package/dist/node/utilities/template.js +27 -0
  655. package/dist/node/utilities/timing.d.ts +7 -0
  656. package/dist/node/utilities/timing.js +18 -0
  657. package/dist/node/utilities/video_parameters.d.ts +47 -0
  658. package/dist/node/utilities/video_parameters.js +27 -0
  659. package/dist/node/utilities/web-api-polyfill.d.ts +1 -0
  660. package/dist/node/utilities/web-api-polyfill.js +47 -0
  661. package/dist/node/version.d.ts +1 -0
  662. package/dist/node/version.js +4 -0
  663. package/entry-client.d.ts +1 -0
  664. package/entry-client.js +1 -0
  665. package/entry-server.d.ts +1 -0
  666. package/entry-server.js +1 -0
  667. package/middleware.d.ts +1 -0
  668. package/middleware.js +1 -0
  669. package/package.json +125 -0
  670. package/plugin.d.ts +1 -0
  671. package/plugin.js +1 -0
  672. package/vendor/react-server-dom-vite/LICENSE +21 -0
  673. package/vendor/react-server-dom-vite/README.md +5 -0
  674. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +356 -0
  675. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1753 -0
  676. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +46 -0
  677. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1716 -0
  678. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +44 -0
  679. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +613 -0
  680. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +19 -0
  681. package/vendor/react-server-dom-vite/esm/package.json +3 -0
  682. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +88 -0
  683. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +352 -0
  684. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1745 -0
  685. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +1708 -0
  686. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +603 -0
  687. package/vendor/react-server-dom-vite/index.js +7 -0
  688. package/vendor/react-server-dom-vite/package.json +67 -0
  689. package/vendor/react-server-dom-vite/plugin.js +3 -0
  690. package/vendor/react-server-dom-vite/writer.browser.server.js +7 -0
  691. package/vendor/react-server-dom-vite/writer.node.server.js +7 -0
  692. package/web-polyfills.js +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1643 @@
1
+ # Changelog
2
+
3
+ ## 0.0.0-experimental-20220526194818
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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:
8
+
9
+ ```jsx
10
+ <Seo type="noindex" data={{title: 'Login'}} />
11
+ ```
12
+
13
+ * [#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`.
14
+
15
+ Before:
16
+
17
+ ```js
18
+ import gql from 'graphql-tag';
19
+
20
+ // ...
21
+
22
+ useShopQuery({
23
+ query: gql`...`,
24
+ // ...
25
+ });
26
+ ```
27
+
28
+ After:
29
+
30
+ ```js
31
+ import {gql} from '@shopify/hydrogen';
32
+
33
+ // ...
34
+
35
+ useShopQuery({
36
+ query: gql`...`,
37
+ // ...
38
+ });
39
+ ```
40
+
41
+ - [#1340](https://github.com/Shopify/hydrogen/pull/1340) [`631832ec`](https://github.com/Shopify/hydrogen/commit/631832ecaef26b918e774515ada6b80668ec5e4e) Thanks [@jplhomer](https://github.com/jplhomer)! - The `response.send()` function has been removed. Use `export async function api()` to send custom responses instead.
42
+
43
+ ### Patch Changes
44
+
45
+ - [#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
46
+
47
+ * [#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.
48
+
49
+ - [#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.
50
+
51
+ * [#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
52
+
53
+ ## 0.21.0
54
+
55
+ ### Minor Changes
56
+
57
+ - [#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.
58
+
59
+ - `<UnitPrice/>` has been removed
60
+ - `<Money/>` has two new props: `measurement` and `measurementSeparator` which do the work that `UnitPrice` used to do
61
+ - The TypeScript types for `<Money/>` have been improved and should provide a better typed experience now
62
+
63
+ * [#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.
64
+
65
+ - [#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.
66
+
67
+ * [#1335](https://github.com/Shopify/hydrogen/pull/1335) [`0d90f92b`](https://github.com/Shopify/hydrogen/commit/0d90f92b448b0c4d99be3e5f5fa25d0b70a8315e) Thanks [@blittle](https://github.com/blittle)! - **Breaking Change**
68
+
69
+ The `<ProductMetafield />` component has been removed. Instead, directly use the `<Metafield>` component.
70
+
71
+ ### Patch Changes
72
+
73
+ - [#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.
74
+
75
+ * [#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`:
76
+
77
+ ```ts
78
+ import {CookieSessionStorage} from '@shopify/hydrogen';
79
+ import {defineConfig} from '@shopify/hydrogen/config';
80
+
81
+ export default defineConfig({
82
+ routes: import.meta.globEager('./src/routes/**/*.server.[jt](s|sx)'),
83
+ shopify: {
84
+ defaultLocale: 'en-us',
85
+ storeDomain: 'hydrogen-preview.myshopify.com',
86
+ storefrontToken: '3b580e70970c4528da70c98e097c2fa0',
87
+ storefrontApiVersion: '2022-07',
88
+ },
89
+ enableStreaming: (req) => req.headers.get('user-agent') !== 'custom bot',
90
+ });
91
+ ```
92
+
93
+ 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.
94
+
95
+ - [#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.
96
+
97
+ * [#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
98
+
99
+ - [#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.
100
+
101
+ To update an existing Hydrogen app:
102
+
103
+ ```bash
104
+ yarn add react@latest react-dom@latest
105
+ ```
106
+
107
+ ## 0.20.0
108
+
109
+ ### Minor Changes
110
+
111
+ - [#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.
112
+
113
+ Remove the `StyleTag` component that was needed before:
114
+
115
+ ```diff
116
+ export default function MyComponent() {
117
+ return (
118
+ <div>
119
+ - <myStyles.StyleTag />
120
+ <h1>Title</h1>
121
+ </div>
122
+ );
123
+ }
124
+ ```
125
+
126
+ Optionally, update your wildcard imports to default or named imports:
127
+
128
+ ```diff
129
+ -import * as myStyles from './my.module.css';
130
+ +import myStyles from './my.module.css';
131
+ // Or
132
+ +import {red, green, blue} from './my.module.css';
133
+ ```
134
+
135
+ * [#1271](https://github.com/Shopify/hydrogen/pull/1271) [`9d0359b8`](https://github.com/Shopify/hydrogen/commit/9d0359b87b0cfa04f12ffa9376e5b8ad72c560a3) Thanks [@frehner](https://github.com/frehner)! - ## `<Image/>`
136
+
137
+ The `<Image/>` component and related utility functions were reworked and the following changes apply:
138
+
139
+ - `useImageUrl` is no longer available; use `shopifyImageLoader` instead, which is available to run both server- and client-side.
140
+ - The TypeScript experience with `<Image/>` is improved; props will be validated better, and `loader` and `loaderOptions` will be better typed
141
+ - When using the `src` prop, `width` and `height` are now required
142
+ - When using the `data` prop, `data.width` and `data.height` or `width` and `height` props are required
143
+ - The `src` and `data` props are mutually exclusive
144
+ - The `loader` prop now receives a singular param as an object
145
+ - `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.
146
+ - The TypeScript type `ImageSizeOptions` is now named `ShopifyLoaderOptions`
147
+ - The TypeScript type `ImageLoaderOptions` is now named `ShopifyLoaderParams`
148
+ - The `priority` prop was removed; use the HTML-standard `loading` prop instead
149
+
150
+ ## `<Video/>`
151
+
152
+ - The `<Video/>` component's `options` props was renamed to `imagePreviewOptions` to add clarity as to what the options were for.
153
+ - `imagePreviewOptions` matches the (newly updated) shape of `<Image/>`'s `loaderOptions`
154
+
155
+ - [#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).
156
+
157
+ ### Patch Changes
158
+
159
+ - [#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.
160
+
161
+ * [#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)).
162
+
163
+ - [#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
164
+
165
+ ## 0.19.0
166
+
167
+ ### Minor Changes
168
+
169
+ - [#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:
170
+
171
+ 1. `useCountry()` hook now only returns the currently selected country. The `setCountry()` method has been removed.
172
+ 2. The `useCountry()` hook expects a `countryCode` and `countryName` to be a part of the user session.
173
+ 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.
174
+
175
+ ```diff
176
+ // src/routes/countries.server.jsx
177
+
178
+ -export async function api(request, {queryShop}) {
179
+ +export async function api(request, {queryShop, session}) {
180
+ + if (request.method === 'POST') {
181
+ + const {isoCode, name} = await request.json();
182
+ +
183
+ + await session.set('countryCode', isoCode);
184
+ + await session.set('countryName', name);
185
+ +
186
+ + return 'success';
187
+ + }
188
+
189
+ const {
190
+ data: {
191
+ localization: {availableCountries},
192
+ },
193
+ } = await queryShop({
194
+ query: QUERY,
195
+ });
196
+ return availableCountries.sort((a, b) => a.name.localeCompare(b.name));
197
+ }
198
+ ```
199
+
200
+ ```diff
201
+ // src/components/CountrySelector.client.jsx
202
+
203
+ export default function CountrySelector() {
204
+ const [listboxOpen, setListboxOpen] = useState(false);
205
+
206
+ - const [selectedCountry, setSelectedCountry] = useCountry();
207
+ + const [selectedCountry] = useCountry();
208
+
209
+ + const setSelectedCountry = useCallback(
210
+ + ({isoCode, name}) => {
211
+ + fetch(`/countries`, {
212
+ + body: JSON.stringify({isoCode, name}),
213
+ + method: 'POST',
214
+ + })
215
+ + .then(() => {
216
+ + window.location.reload();
217
+ + })
218
+ + .catch((error) => {
219
+ + console.error(error);
220
+ + });
221
+ + },
222
+ + [],
223
+ + );
224
+
225
+ return (
226
+ ...
227
+ );
228
+ }
229
+ ```
230
+
231
+ 4. Each server component page that depends on the selected country pulls it from the session with `useSession()`, rather than `serverProps`.
232
+
233
+ ```diff
234
+ // src/routes/products/[handle].server.jsx
235
+ + import { useSession } from '@shopify/hydrogen';
236
+
237
+ - export default function Product({country = {isoCode: 'US'}}) {
238
+ + export default function Product() {
239
+ const {handle} = useRouteParams();
240
+ + const {countryCode = 'US'} = useSession();
241
+ ...
242
+ }
243
+ ```
244
+
245
+ ### Patch Changes
246
+
247
+ - [#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
248
+
249
+ * [#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`.
250
+
251
+ - [#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
252
+
253
+ ## 0.18.0
254
+
255
+ ### Minor Changes
256
+
257
+ - [#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.
258
+
259
+ ## Introducing `hydrogen.config.js`
260
+
261
+ Hydrogen apps now expect a `hydrogen.config.js` in the root folder. This config file accepts Shopify storefront credentials, routes, session configuration, and more.
262
+
263
+ To migrate existing apps, you should create a `hydrogen.config.js` (or `hydrogen.config.ts`) file in your Hydrogen app:
264
+
265
+ ```js
266
+ import {defineConfig} from '@shopify/hydrogen/config';
267
+ import {
268
+ CookieSessionStorage,
269
+ PerformanceMetricsServerAnalyticsConnector,
270
+ } from '@shopify/hydrogen';
271
+
272
+ export default defineConfig({
273
+ routes: import.meta.globEager('./src/routes/**/*.server.[jt](s|sx)'),
274
+ shopify: {
275
+ storeDomain: 'YOUR_STORE.myshopify.com',
276
+ storefrontToken: 'YOUR_STOREFRONT_TOKEN',
277
+ storefrontApiVersion: '2022-07',
278
+ },
279
+ session: CookieSessionStorage('__session', {
280
+ path: '/',
281
+ httpOnly: true,
282
+ secure: process.env.NODE_ENV === 'production',
283
+ sameSite: 'strict',
284
+ maxAge: 60 * 60 * 24 * 30,
285
+ }),
286
+ serverAnalyticsConnectors: [PerformanceMetricsServerAnalyticsConnector],
287
+ });
288
+ ```
289
+
290
+ Then, update your `App.server.jsx` to remove previous arguments from `renderHydrogen()`:
291
+
292
+ ```diff
293
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
294
+
295
+ -function App({routes}) {
296
+ +function App() {
297
+ return (
298
+ <Suspense fallback={<LoadingFallback />}>
299
+ - <ShopifyProvider shopifyConfig={shopifyConfig}>
300
+ + <ShopifyProvider>
301
+ <CartProvider>
302
+ <DefaultSeo />
303
+ <Router>
304
+ - <FileRoutes routes={routes} />
305
+ + <FileRoutes />
306
+ <Route path="*" page={<NotFound />} />
307
+ </Router>
308
+ </CartProvider>
309
+ <PerformanceMetrics />
310
+ {process.env.LOCAL_DEV && <PerformanceMetricsDebug />}
311
+ </ShopifyProvider>
312
+ </Suspense>
313
+ );
314
+ }
315
+
316
+ -const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
317
+ -
318
+ -export default renderHydrogen(App, {
319
+ - routes,
320
+ - shopifyConfig,
321
+ - session: CookieSessionStorage('__session', {
322
+ - path: '/',
323
+ - httpOnly: true,
324
+ - secure: process.env.NODE_ENV === 'production',
325
+ - sameSite: 'strict',
326
+ - maxAge: 60 * 60 * 24 * 30,
327
+ - }),
328
+ - serverAnalyticsConnectors: [PerformanceMetricsServerAnalyticsConnector],
329
+ -});
330
+ +export default renderHydrogen(App);
331
+ ```
332
+
333
+ Next, update `vite.config.js` in your app to remove references to `shopifyConfig`:
334
+
335
+ ```diff
336
+ import {defineConfig} from 'vite';
337
+ import hydrogen from '@shopify/hydrogen/plugin';
338
+ -import shopifyConfig from './shopify.config';
339
+
340
+ // https://vitejs.dev/config/
341
+ export default defineConfig({
342
+ - plugins: [hydrogen(shopifyConfig)],
343
+ + plugins: [hydrogen()],
344
+ ```
345
+
346
+ Finally, delete `shopify.config.js` from your app.
347
+
348
+ [Read more about the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/framework/hydrogen-config)
349
+
350
+ * [#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
351
+
352
+ - [#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
353
+
354
+ ### Patch Changes
355
+
356
+ - [#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
357
+
358
+ * [#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`
359
+
360
+ `<Money />` now has two additional and optional props: `withoutMoney` and `withoutCurrency`.
361
+
362
+ - [#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
363
+
364
+ * [#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
365
+
366
+ ## 0.17.3
367
+
368
+ ### Patch Changes
369
+
370
+ - [#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
371
+
372
+ * [#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
373
+
374
+ ## 0.17.2
375
+
376
+ ### Patch Changes
377
+
378
+ - [#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
379
+
380
+ * [#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
381
+
382
+ - [#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
383
+
384
+ * [#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
385
+
386
+ - [#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
387
+
388
+ ## 0.17.1
389
+
390
+ ### Patch Changes
391
+
392
+ - [#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
393
+
394
+ * [#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
395
+
396
+ - [#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
397
+
398
+ ## 0.17.0
399
+
400
+ ### Minor Changes
401
+
402
+ - [#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:
403
+
404
+ ```diff
405
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
406
+ import {
407
+ Router,
408
+ Route,
409
+ FileRoutes,
410
+ ShopifyProvider,
411
+ + CookieSessionStorage,
412
+ } from '@shopify/hydrogen';
413
+ import {Suspense} from 'react';
414
+ import shopifyConfig from '../shopify.config';
415
+ import DefaultSeo from './components/DefaultSeo.server';
416
+ import NotFound from './components/NotFound.server';
417
+ import LoadingFallback from './components/LoadingFallback';
418
+ import CartProvider from './components/CartProvider.client';
419
+
420
+ function App({routes}) {
421
+ return (
422
+ <Suspense fallback={<LoadingFallback />}>
423
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
424
+ <CartProvider>
425
+ <DefaultSeo />
426
+ <Router>
427
+ <FileRoutes routes={routes} />
428
+ <Route path="*" page={<NotFound />} />
429
+ </Router>
430
+ </CartProvider>
431
+ </ShopifyProvider>
432
+ </Suspense>
433
+ );
434
+ }
435
+
436
+ const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
437
+
438
+ export default renderHydrogen(App, {
439
+ routes,
440
+ shopifyConfig,
441
+ + session: CookieSessionStorage('__session', {
442
+ + path: '/',
443
+ + httpOnly: true,
444
+ + secure: process.env.NODE_ENV === 'production',
445
+ + sameSite: 'strict',
446
+ + maxAge: 60 * 60 * 24 * 30,
447
+ + }),
448
+ });
449
+
450
+ ```
451
+
452
+ * [#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
453
+
454
+ **Breaking changes:**
455
+
456
+ 1. `useServerState()` is gone. Use `useServerProps()` instead
457
+ 2. `useServerProps()` is reset on each page navigation. Previously `useServerState()` was not.
458
+ 3. `useServerProps()` does not contain `pathname` and `search`. Use the [useNavigate](https://shopify.dev/api/hydrogen/hooks/framework/usenavigate) hook to programmatically navigate instead.
459
+
460
+ **Explanation:**
461
+
462
+ 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.
463
+
464
+ 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.
465
+
466
+ 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).
467
+
468
+ 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).
469
+
470
+ 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.
471
+
472
+ - [#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
473
+
474
+ ### Patch Changes
475
+
476
+ - [#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 $
477
+
478
+ * [#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.
479
+
480
+ - [#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.
481
+
482
+ ## 0.16.1
483
+
484
+ ### Patch Changes
485
+
486
+ - [#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.
487
+
488
+ ## 0.16.0
489
+
490
+ ### Patch Changes
491
+
492
+ - [#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.
493
+
494
+ Example:
495
+
496
+ ```jsx
497
+ import {useUrl} from '@shopify/hydrogen/client';
498
+
499
+ function MyClientComponent() {
500
+ const url = useUrl();
501
+
502
+ useEffect(() => {
503
+ // Record navigation, analytics, etc
504
+ }, [url]);
505
+ }
506
+ ```
507
+
508
+ * [#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
509
+
510
+ ## 0.15.0
511
+
512
+ ### Minor Changes
513
+
514
+ - [#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.
515
+
516
+ 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):
517
+
518
+ ```jsx
519
+ import {fetchSync, CacheMinutes} from '@shopify/hydrogen';
520
+ import {Suspense} from 'react';
521
+
522
+ export function MyServerComponent() {
523
+ return (
524
+ <Suspense fallback="Loading...">
525
+ <MyThings />
526
+ </Suspense>
527
+ );
528
+ }
529
+
530
+ function MyThings() {
531
+ const things = fetchSync('https://3p.api.com/things.json', {
532
+ preload: true,
533
+ cache: CacheMinutes(),
534
+ }).json();
535
+
536
+ return <h2>{things.title}</h2>;
537
+ }
538
+ ```
539
+
540
+ When using `fetchSync` in client components, you cannot provide options for caching and preloading. You must import `fetchSync` from `@shopify/hydrogen/client`:
541
+
542
+ ```jsx
543
+ import {fetchSync} from '@shopify/hydrogen/client';
544
+ import {Suspense} from 'react';
545
+
546
+ export function MyClientComponent() {
547
+ return (
548
+ <Suspense fallback="Loading...">
549
+ <MyThings />
550
+ </Suspense>
551
+ );
552
+ }
553
+
554
+ function MyThings() {
555
+ const things = fetchSync('https://3p.api.com/things.json').json();
556
+
557
+ return <h2>{things.title}</h2>;
558
+ }
559
+ ```
560
+
561
+ * [#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
562
+ and client side analytics instrumentations
563
+
564
+ - [Usage documentation](https://shopify.dev/custom-storefronts/hydrogen/framework/analytics)
565
+
566
+ ### Patch Changes
567
+
568
+ - [#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
569
+
570
+ * [#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.
571
+
572
+ ```jsx
573
+ // src/routes/my-page.server.jsx
574
+
575
+ export async function api(request) {
576
+ if (request.method === 'POST') {
577
+ // do some work here...
578
+ }
579
+
580
+ return new Request(request.url, {method: 'GET'});
581
+ }
582
+
583
+ export default function Page() {
584
+ return (
585
+ <form action="/my-page" method="POST">
586
+ ...
587
+ </form>
588
+ );
589
+ }
590
+ ```
591
+
592
+ 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.
593
+
594
+ - [#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
595
+
596
+ * [#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.
597
+
598
+ - [#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
599
+
600
+ * [#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.
601
+
602
+ - [#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
603
+
604
+ * [#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.
605
+
606
+ ## 0.14.0
607
+
608
+ ### Minor Changes
609
+
610
+ - [#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.
611
+
612
+ 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.
613
+
614
+ The `useShop` hook will now return the `languageCode` key, which is the first two characters of the existing `locale` key.
615
+
616
+ Both `locale` & `languageCode` values are also now capitalized to make it easier to pass into a GraphQL `@inContext` directive.
617
+
618
+ * [#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.
619
+
620
+ ### Patch Changes
621
+
622
+ - [#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).
623
+
624
+ * [#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
625
+
626
+ - [#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`
627
+
628
+ * [#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.
629
+
630
+ - [#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
631
+
632
+ ## 0.13.2
633
+
634
+ ### Patch Changes
635
+
636
+ - [#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
637
+
638
+ ## 0.13.1
639
+
640
+ ### Patch Changes
641
+
642
+ - [#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.
643
+
644
+ * [#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.
645
+
646
+ - [#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
647
+
648
+ * [#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.
649
+
650
+ - [#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.
651
+
652
+ ## 0.13.0
653
+
654
+ ### Minor Changes
655
+
656
+ - [#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:
657
+
658
+ - ExternalVideoFragment and ExternalVideoFragmentFragment
659
+ - Model3DFragment and Model3DFragmentFragment
660
+ - ImageFragment and ImageFragmentFragment
661
+ - MoneyFragment and MoneyFragmentFragment
662
+ - UnitPriceFragment and UnitPriceFragmentFragment
663
+ - VideoFragment and VideoFragmentFragment
664
+ - MetafieldFragment and MetafieldFragmentFragment
665
+ - Seo fragments and types:
666
+ - DefaultPageSeoFragment and DefaultPageSeoFragmentFragment
667
+ - HomeSeoFragment and HomeSeoFragmentFragment
668
+ - ProductSeoFragment and ProductSeoFragmentFragment
669
+ - CollectionSeoFragment and CollectionSeoFragmentFragment
670
+ - PageSeoFragment and PageSeoFragmentFragment
671
+ - MediaFile fragments and types:
672
+ - MediaFileFragment and MediaFileFragmentFragment
673
+ - MediaFileFragment_ExternalVideo_Fragment
674
+ - MediaFileFragment_MediaImage_Fragment
675
+ - MediaFileFragment_Model3d_Fragment
676
+ - MediaFileFragment_Video_Fragment
677
+ - ProductFragment and ProductFragmentFragment
678
+
679
+ 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.
680
+
681
+ * [#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.
682
+
683
+ 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.
684
+
685
+ Migratation steps:
686
+
687
+ Create an API route to retrieve available countries:
688
+
689
+ ```jsx
690
+ export async function api(request, {queryShop}) {
691
+ const {
692
+ data: {
693
+ localization: {availableCountries},
694
+ },
695
+ } = await queryShop({
696
+ query: QUERY,
697
+ });
698
+
699
+ return availableCountries.sort((a, b) => a.name.localeCompare(b.name));
700
+ }
701
+
702
+ const QUERY = `
703
+ query Localization {
704
+ localization {
705
+ availableCountries {
706
+ isoCode
707
+ name
708
+ currency {
709
+ isoCode
710
+ }
711
+ }
712
+ }
713
+ }
714
+ `;
715
+ ```
716
+
717
+ Then within your client code, query the API route with a `useEffect` hook:
718
+
719
+ ```jsx
720
+ const [countries, setCountries] = useState([]);
721
+
722
+ useEffect(() => {
723
+ fetch('/api/countries')
724
+ .then((resp) => resp.json())
725
+ .then((c) => setCountries(c))
726
+ .catch((e) => setError(e))
727
+ .finally(() => setLoading(false));
728
+ }, []);
729
+ ```
730
+
731
+ 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)
732
+
733
+ - [#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:
734
+
735
+ ```bash
736
+ yarn test
737
+ ```
738
+
739
+ Or in continuous-integration (CI) environments:
740
+
741
+ ```bash
742
+ yarn test:ci
743
+ ```
744
+
745
+ * [#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:
746
+
747
+ ```js
748
+ import * as styles from './styles.module.css';
749
+
750
+ export default MyComponent() {
751
+ return (
752
+ <div className={styles.wrapper}>
753
+ // A style is rendered inline
754
+ <styles.StyleTag />
755
+ <p>Hello</p>
756
+ </div>
757
+ );
758
+ }
759
+ ```
760
+
761
+ Explore an [example implementation of CSS Modules in GitHub](https://github.com/Shopify/hydrogen/tree/main/examples/css-modules).
762
+
763
+ - [#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
764
+
765
+ The `<Route>` component is available for routes not defined by the file system. The `<Route>` component must be used within the `<Router>` component.
766
+
767
+ ```jsx
768
+ // app.server.jsx
769
+
770
+ function App({routes, ...serverProps}) {
771
+ return (
772
+ <Suspense fallback={<LoadingFallback />}>
773
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
774
+ <CartProvider>
775
+ <DefaultSeo />
776
+ <Router serverProps={serverProps}>
777
+ <Route path="/custom" page={<CustomRoute />} />
778
+ </Router>
779
+ </CartProvider>
780
+ </ShopifyProvider>
781
+ </Suspense>
782
+ );
783
+ }
784
+
785
+ function CustomRoute() {
786
+ return <h1>Custom route</h1>;
787
+ }
788
+ ```
789
+
790
+ `<Route>` accepts two props:
791
+
792
+ | Property | Type | Required | Description |
793
+ | -------- | --------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
794
+ | `path` | `string` | Yes | The URL path where the route exists. The path can contain variables. For example, `/products/:handle`. |
795
+ | `page` | `A rendered Server Component reference` | Yes | A reference to a React Server Component that's rendered when the route is active. |
796
+
797
+ ## Changes to `<Router>`
798
+
799
+ 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:
800
+
801
+ ```diff
802
+ function App({routes, ...serverProps}) {
803
+ return (
804
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
805
+ <CartProvider>
806
+ <DefaultSeo />
807
+ - <Router
808
+ - fallback={<NotFound response={serverProps.response} />}
809
+ - serverProps={serverProps}
810
+ - >
811
+ + <Router>
812
+ <FileRoutes routes={routes} />
813
+ + <Route path="*" page={<NotFound />} />
814
+ </Router>
815
+ </CartProvider>
816
+ </ShopifyProvider>
817
+ );
818
+ }
819
+ ```
820
+
821
+ ## Changes to `<FileRoutes>`
822
+
823
+ The `<FileRoutes>` component now accepts two additional optional props:
824
+
825
+ | Property | Type | Required | Default Value | Description |
826
+ | ----------- | -------- | -------- | ------------- | ----------------------------------------------------------------------- |
827
+ | `basePath` | `string` | No | `"/"` | A path that's prepended to all file routes. |
828
+ | `dirPrefix` | `string` | No | `"./routes"` | The portion of the file route path that shouldn't be a part of the URL. |
829
+
830
+ You need to modify `dirPrefix` if you want to import routes from a location other than `src/routes`.
831
+
832
+ You can modify `basePath` if you want to prefix all file routes. For example, you can prefix all file routes with a locale:
833
+
834
+ ```jsx
835
+ <Router>
836
+ <FileRoutes basePath={`/${locale}`} routes={routes} />
837
+ <Route path="*" page={<NotFound />} />
838
+ </Router>
839
+ ```
840
+
841
+ ## New `useRouteParams()` hook
842
+
843
+ You can use the `useRouteParams()` hook to retrieve the parameters of an active route. The hook is available in both server and client components:
844
+
845
+ ```jsx
846
+ // products/[handle].server.jsx
847
+
848
+ import {useRouteParams} from '@shopify/hydrogen';
849
+
850
+ export default function Product() {
851
+ const {handle} = useRouteParams();
852
+ // ...
853
+ }
854
+ ```
855
+
856
+ ```jsx
857
+ // ProductDetails.client.jsx
858
+ import {useRouteParams} from '@shopify/hydrogen/client';
859
+
860
+ export default function ProductDetails() {
861
+ const {handle} = useRouteParams();
862
+ // ...
863
+ }
864
+ ```
865
+
866
+ * [#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.
867
+
868
+ Upgrade your project by replacing references to the `RawHtml` component to follow
869
+ [React's `dangerouslySetInnerHTML`](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml):
870
+
871
+ Change all `RawHtml` component
872
+
873
+ ```jsx
874
+ <RawHtml string="<p>Hello world</p>" />
875
+ ```
876
+
877
+ to jsx equivalent
878
+
879
+ ```jsx
880
+ <div dangerouslySetInnerHTML={{__html: '<p>Hello world</p>'}} />
881
+ ```
882
+
883
+ ### Patch Changes
884
+
885
+ - [#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.
886
+
887
+ * [#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
888
+
889
+ - [#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
890
+
891
+ * [#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:
892
+
893
+ ```diff
894
+ export default function Redirect({response}) {
895
+ - response.redirect('/products/snowboard');
896
+ - return <div>This page is redirected</div>;
897
+ + return response.redirect('/products/snowboard');
898
+ }
899
+ ```
900
+
901
+ This server component is rendered two ways:
902
+
903
+ 1. When an app directly loads the redirect route, the server will render a 300 redirect with the proper location header.
904
+ 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.
905
+
906
+ - [#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
907
+
908
+ * [#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`.
909
+
910
+ To upgrade your Hydrogen app, change the pinned version of `react` and `react-dom` in your `package.json` file to this version, or run:
911
+
912
+ ```bash
913
+ yarn add @shopify/hydrogen react@0.0.0-experimental-2bf7c02f0-20220314 react-dom@0.0.0-experimental-2bf7c02f0-20220314
914
+ ```
915
+
916
+ - [#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.
917
+
918
+ * [#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)
919
+
920
+ - [#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
921
+
922
+ * [#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
923
+
924
+ - [#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.
925
+
926
+ **Breaking change**: `fetchBuilder` no longer accepts a `Request` argument. Instead, it now accepts a `url: string` and `options: FetchInit`:
927
+
928
+ ```diff
929
+ -fetchBuilder(new Request('https://my.endpoint.com', {headers: {foo: 'bar'}}));
930
+ +fetchBuilder('https://my.endpoint.com', {headers: {foo: 'bar}});
931
+ ```
932
+
933
+ * [#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.
934
+
935
+ - [#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
936
+
937
+ ## 0.12.0
938
+
939
+ ### Minor Changes
940
+
941
+ - [`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.
942
+
943
+ * [#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`.
944
+ The migration diff are as follows:
945
+
946
+ ```diff
947
+ - import {ExternalVideoFragment} from '@shopify/hydrogen';
948
+ + import {ExternalVideoFragment} from '@shopify/hydrogen/fragments';
949
+ - import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen';
950
+ + import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen/fragments';
951
+ ```
952
+
953
+ ```diff
954
+ - import {ImageFragment} from '@shopify/hydrogen';
955
+ + import {ImageFragment} from '@shopify/hydrogen/fragments';
956
+ - import type {ImageFragmentFragment} from '@shopify/hydrogen';
957
+ + import type {ImageFragmentFragment} from '@shopify/hydrogen/fragments';
958
+ ```
959
+
960
+ ```diff
961
+ - import {MediaFileFragment} from '@shopify/hydrogen';
962
+ + import {MediaFileFragment} from '@shopify/hydrogen/fragments';
963
+ - import type {MediaFileFragmentFragment} from '@shopify/hydrogen';
964
+ + import type {MediaFileFragmentFragment} from '@shopify/hydrogen/fragments';
965
+ ```
966
+
967
+ ```diff
968
+ - import {MetafieldFragment} from '@shopify/hydrogen';
969
+ + import {MetafieldFragment} from '@shopify/hydrogen/fragments';
970
+ - import type {MetafieldFragmentFragment} from '@shopify/hydrogen';
971
+ + import type {MetafieldFragmentFragment} from '@shopify/hydrogen/fragments';
972
+ ```
973
+
974
+ ```diff
975
+ - import {Model3DFragment} from '@shopify/hydrogen';
976
+ + import {Model3DFragment} from '@shopify/hydrogen/fragments';
977
+ - import type {Model3DFragmentFragment} from '@shopify/hydrogen';
978
+ + import type {Model3DFragmentFragment} from '@shopify/hydrogen/fragments';
979
+ ```
980
+
981
+ ```diff
982
+ - import {MoneyFragment} from '@shopify/hydrogen';
983
+ + import {MoneyFragment} from '@shopify/hydrogen/fragments';
984
+ - import type {MoneyFragmentFragment} from '@shopify/hydrogen';
985
+ + import type {MoneyFragmentFragment} from '@shopify/hydrogen/fragments';
986
+ ```
987
+
988
+ ```diff
989
+ - import {ProductProviderFragment} from '@shopify/hydrogen';
990
+ + import {ProductProviderFragment} from '@shopify/hydrogen/fragments';
991
+ - import type {ProductProviderFragmentFragment} from '@shopify/hydrogen';
992
+ + import type {ProductProviderFragmentFragment} from '@shopify/hydrogen/fragments';
993
+ ```
994
+
995
+ ```diff
996
+ - import {UnitPriceFragment} from '@shopify/hydrogen';
997
+ + import {UnitPriceFragment} from '@shopify/hydrogen/fragments';
998
+ - import type {UnitPriceFragmentFragment} from '@shopify/hydrogen';
999
+ + import type {UnitPriceFragmentFragment} from '@shopify/hydrogen/fragments';
1000
+ ```
1001
+
1002
+ ```diff
1003
+ - import {VideoFragment} from '@shopify/hydrogen';
1004
+ + import {VideoFragment} from '@shopify/hydrogen/fragments';
1005
+ - import type {VideoFragmentFragment} from '@shopify/hydrogen';
1006
+ + import type {VideoFragmentFragment} from '@shopify/hydrogen/fragments';
1007
+ ```
1008
+
1009
+ - [#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.
1010
+
1011
+ * [#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.
1012
+
1013
+ 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.
1014
+
1015
+ - [#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:
1016
+
1017
+ ```jsx
1018
+ // my-api.server.js
1019
+
1020
+ export default function api(request, {queryShop}) {
1021
+ return await queryShop({
1022
+ query: `query ShopName { shop { name } }`,
1023
+ });
1024
+ }
1025
+ ```
1026
+
1027
+ `queryShop` accepts a single argument object with the following properties:
1028
+
1029
+ | Property | Type | Required |
1030
+ | ----------- | -------------------------------------- | -------- |
1031
+ | `query` | `string \| ASTNode` | Yes |
1032
+ | `variables` | `Record<string, any>` | No |
1033
+ | `locale` | `string` (defaults to `defaultLocale`) | No |
1034
+
1035
+ **Important**: In order to use `queryShop`, you should pass `shopifyConfig` to `renderHydrogen` inside `App.server.jsx`:
1036
+
1037
+ ```diff
1038
+ -export default renderHydrogen(App, {routes});
1039
+ +export default renderHydrogen(App, {shopifyConfig, routes});
1040
+ ```
1041
+
1042
+ * [#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.
1043
+
1044
+ Follow these steps to upgrade your `App.server.jsx` file:
1045
+
1046
+ 1. Rename the parameter `pages` to `routes` when calling `renderHydrogen`.
1047
+ 2. Rename the `DefaultRoutes` component to `FileRoutes`.
1048
+ 3. Add the new `Router` component as a parent of `FileRoutes` and pass `fallback` and `serverProps` props (previously in `DefaultRoutes`).
1049
+ 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)')`.
1050
+
1051
+ #### Full example of `App.server.jsx`
1052
+
1053
+ ```jsx
1054
+ import renderHydrogen from '@shopify/hydrogen/entry-server';
1055
+ import {Router, FileRoutes, ShopifyProvider} from '@shopify/hydrogen';
1056
+ import {Suspense} from 'react';
1057
+ import shopifyConfig from '../shopify.config';
1058
+ import DefaultSeo from './components/DefaultSeo.server';
1059
+ import NotFound from './components/NotFound.server';
1060
+ import LoadingFallback from './components/LoadingFallback';
1061
+ import CartProvider from './components/CartProvider.client';
1062
+
1063
+ function App({routes, ...serverProps}) {
1064
+ return (
1065
+ <Suspense fallback={<LoadingFallback />}>
1066
+ <ShopifyProvider shopifyConfig={shopifyConfig}>
1067
+ <CartProvider>
1068
+ <DefaultSeo />
1069
+ <Router fallback={<NotFound />} serverProps={serverProps}>
1070
+ <FileRoutes routes={routes} />
1071
+ </Router>
1072
+ </CartProvider>
1073
+ </ShopifyProvider>
1074
+ </Suspense>
1075
+ );
1076
+ }
1077
+
1078
+ const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)');
1079
+ export default renderHydrogen(App, {shopifyConfig, routes});
1080
+ ```
1081
+
1082
+ ### Patch Changes
1083
+
1084
+ - [#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.
1085
+
1086
+ * [#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
1087
+
1088
+ - [#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.
1089
+
1090
+ * [#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
1091
+
1092
+ - [#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.
1093
+ There is no longer an uncaught promise exception in the console.
1094
+
1095
+ * [#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.
1096
+
1097
+ - [#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.
1098
+
1099
+ * [#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
1100
+
1101
+ - [#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
1102
+
1103
+ * [#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
1104
+
1105
+ - MediaFileProps
1106
+ - VideoProps
1107
+ - ImageProps
1108
+ - ExternalVideoProps
1109
+ - RawHtmlProps
1110
+ - AddToCartButtonProps
1111
+ - ModelViewerProps
1112
+ - MoneyProps
1113
+ - BuyNowButtonProps
1114
+ - BuyNowButtonPropsWeControl
1115
+ - ShopPayButtonProps
1116
+
1117
+ Any Component props type should be typed instead with `React.ComponentProps<typeof MyComponent>`.
1118
+
1119
+ - [#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.
1120
+
1121
+ * [#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.
1122
+
1123
+ - [#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
1124
+
1125
+ * [#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
1126
+
1127
+ - [#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.
1128
+
1129
+ * [#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.
1130
+
1131
+ - [#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
1132
+
1133
+ * [#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.
1134
+ Extract part of the client bundle into separate modules that can be loaded in parallel.
1135
+
1136
+ ## 0.11.1
1137
+
1138
+ ### Patch Changes
1139
+
1140
+ - [#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
1141
+
1142
+ * [#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`.
1143
+
1144
+ - [#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`
1145
+
1146
+ * [#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`.
1147
+
1148
+ - [#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.
1149
+
1150
+ * [#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).
1151
+
1152
+ - [#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.
1153
+
1154
+ * [#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)
1155
+
1156
+ - [#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.
1157
+
1158
+ 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`.
1159
+
1160
+ * [#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
1161
+
1162
+ ## [0.11.0] - 2022-02-24
1163
+
1164
+ ### Added
1165
+
1166
+ - New React hook `useScriptLoader` is available to more easily load external scripts
1167
+ - Add `totalQuantity` to the returned object from `useCart()`
1168
+ - Export `ProductPrice` and `ProductMetafield` standalone components
1169
+ - Added `useUrl` hook that allows the consumer to get the current url in server or client component
1170
+ - Added logging option `showCacheApiStatus` and `cacheControlHeader` by @wizardlyhel in [#472](https://github.com/Shopify/hydrogen/pull/472)
1171
+ - Pass HYDROGEN_ASSET_BASE_URL into config to set base URL for compiled assets
1172
+ - Introduce Hydrogen the `<Link>` component and `useNavigate` hook for routing
1173
+ - Add a default virtual entry-client in `/@shopify/hydrogen/entry-client` that can be used in `index.html`
1174
+ - Enable early hydration when streaming
1175
+ - Add variantId prop to `<ProductMetafield />` component [#730](https://github.com/Shopify/hydrogen/pull/730)
1176
+ - Add query timing logging option `showQueryTiming` [#699](https://github.com/Shopify/hydrogen/pull/699)
1177
+ - Add variantId prop to `<ProductPrice />` component
1178
+ - Add `preload` option to `useQuery` and `useShopQuery` [#700](https://github.com/Shopify/hydrogen/pull/700)
1179
+
1180
+ ### Breaking Change
1181
+
1182
+ - `<Model3D>` has been renamed to `<ModelViewer>`
1183
+ - `<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 />`.
1184
+ - Merge `/src/entry-server.jsx` entry point into `App.server.jsx`
1185
+ - The following components had their prop name renamed. Refer to the documentation or [#627](https://github.com/Shopify/hydrogen/issues/627) for more details.
1186
+ - `<ExternalVideo />`: renamed video prop to data
1187
+ - `<Video />`: renamed video prop to data
1188
+ - `<Image>`: renamed image prop to data
1189
+ - `<MediaFile>`: renamed media prop to data
1190
+ - `<ModelViewer>`: renamed model prop to data
1191
+ - `<Metafield>`: renamed metafield prop to data
1192
+ - `<Money>`: renamed money prop to data
1193
+ - `<UnitPrice>`: renamed unitPrice prop to data, unitPriceMeasurement prop to measurement
1194
+ - `<ProductProvider>`: renamed product prop to data
1195
+ - `<CartProvider>`: renamed cart prop to data
1196
+ - Helmet component has been renamed to Head
1197
+ - Remove the `<SelectedVariantBuyNowButton />` component in favour of using `<BuyNowButton variantId={product.selectedVariant.id} />`
1198
+ - `<SelectedVariantAddToCartButton />` has been removed; the `<AddToCartButton />` will now use the selectedVariant by default.
1199
+ - Remove the `<SelectedVariantImage />` component in favour of using `<Image data={product.selectedVariant.image} />`
1200
+ - Remove the `<SelectedVariantMetafield />` component in favour of using `<ProductMetafield variantId={product.selectedVariant.id} />`
1201
+ - Remove the `<SelectedVariantShopPayButton />` component in favour of using `<ShopPayButton variantId={product.selectedVariant.id} />`
1202
+ - Remove the `<SelectedVariantPrice/>` and `<SelectedVariantUnitPrice/>` component in favour of using `<ProductPrice variantId={product.selectedVariant.id} />`
1203
+
1204
+ ### Changed
1205
+
1206
+ - Change `/react` RSC path to `/__rsc`
1207
+ - `<ShopifyProvider>` can again be used in server components
1208
+ - Use hashes as client component ids instead of absolute paths
1209
+ - Transition away from deprecated currency selector in favor of country selector
1210
+ - Simplify Helmet usage and make it compatible with RSC
1211
+ - 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)
1212
+ - Standardize cache control header into caching strategies by @wizardlyhel in [#629](https://github.com/Shopify/hydrogen/pull/629)
1213
+ - Target future release to use '2022-01' API Version
1214
+ - Correct Typescript issue where `as` was a default prop for all components when it should not be
1215
+ - Update types and docs for `useCart()` hook and `<CartProvider>`
1216
+ - Track page load performance
1217
+ - 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)
1218
+ - `<Money>` Use `useMoney()` for customization
1219
+ - `<CartLinePrice>` Use `useMoney()` for customization
1220
+ - `<ProductPrice>` Use `useMoney()` for customization
1221
+ - `<SelectedVariantPrice>` Use `useMoney()` for customization
1222
+ - `<Metafield>` Use `useParsedMetafields()` for customization
1223
+ - `<ProductMetafield>` Use `useParsedMetafields()` for customization
1224
+ - `<SelectedVariantMetafield>` Use `useParsedMetafields()` for customization
1225
+ - `<UnitPrice>` Use `useMoney()` for customization
1226
+ - `<CartLines>` Use `useCart()` for customization
1227
+ - `<Metafield>` now renders `ratings` as a `<span>` with text instead of stars; `multi_line_text_field` inside of a `<span>` instead of a `<div>`
1228
+ - Use `featureImage` instead of images(first:1) on product query
1229
+ - Update `react-helmet-async` to 1.2.3 and remove our custom types
1230
+
1231
+ ### Fixed
1232
+
1233
+ - Fix index routes. See [#562](https://github.com/Shopify/hydrogen/issues/562)
1234
+ - Fix missing server state on SSR pass
1235
+ - Fix mobile navigation in example that scrolls the body underneath when shown by @Francismori7 in [#582](https://github.com/Shopify/hydrogen/pull/582)
1236
+ - Add charset to content type in HTML responses
1237
+ - Fix header shift when cart is opened by @Francismori7 in [#600](https://github.com/Shopify/hydrogen/pull/600)
1238
+ - Fix bug where search param is not being pass along during RSC streaming call [#623](https://github.com/Shopify/hydrogen/pull/623)
1239
+ - Allow custom entry-client filenames
1240
+ - Clear browser fetch cache by @wizardlyhel in [#591](https://github.com/Shopify/hydrogen/pull/591)
1241
+ - Cannot redefine property error when updating client components
1242
+ - `ShopPayButton` supports quantities greater than 1. Also fixed issues with IDs in Storefront API version 2022-01
1243
+ - Render error in `Gallery.client.jsx` component when product resource has an external video or no images.
1244
+ - Ensure youtube external videos are embed compatible urls
1245
+ - Prevent client components from being cached during development
1246
+ - Backticks in HTML break RSC hydration.
1247
+
1248
+ ### Removed
1249
+
1250
+ - <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.
1251
+
1252
+ _Migration_
1253
+
1254
+ The functionality provided by these components can be replicated using the `useCartLine()` hook instead.
1255
+
1256
+ _Example_
1257
+
1258
+ ```tsx
1259
+ // Before
1260
+ function SomeComponent() {
1261
+ return (
1262
+ <>
1263
+ <CartLineSelectedOptions as="ul" className="text-xs space-y-1">
1264
+ {({name, value}) => (
1265
+ <>
1266
+ {name}: {value}
1267
+ </>
1268
+ )}
1269
+ </CartLineSelectedOptions>
1270
+ <CartLineAttributes as="ul" className="text-sm space-y-1">
1271
+ {({key, value}) => (
1272
+ <>
1273
+ {key}: {value}
1274
+ </>
1275
+ )}
1276
+ </CartLineAttributes>
1277
+ </>
1278
+ );
1279
+ }
1280
+
1281
+ // After
1282
+ function SomeComponent() {
1283
+ const {merchandise} = useCartLine();
1284
+
1285
+ return (
1286
+ <>
1287
+ <ul className="text-xs space-y-1">
1288
+ {merchandise.selectedOptions.map(({name, value}) => (
1289
+ <li key={name}>
1290
+ {name}: {value}
1291
+ </li>
1292
+ ))}
1293
+ </ul>
1294
+ </>
1295
+ );
1296
+ }
1297
+ ```
1298
+
1299
+ - Remove `fetch` workaround
1300
+ - Remove the following hooks. (All the same functionality can be retrieved through the `useCart()` hook)
1301
+ - `useCartAttributesUpdateCallback`
1302
+ - `useCartBuyerIdentityUpdateCallback`
1303
+ - `useCartCheckoutUrl`
1304
+ - `useCartCreateCallback`
1305
+ - `useCartDiscountCodesUpdateCallback`
1306
+ - `useCartLinesAddCallback`
1307
+ - `useCartLinesRemoveCallback`
1308
+ - `useCartLinesTotalQuantity`
1309
+ - `useCartLinesUpdateCallback`
1310
+ - `useCartNoteUpdateCallback`
1311
+ - Remove React Router on the client
1312
+ - Remove `handleEvent` in favor of `handleRequest`
1313
+ - Remove `assetHandler` parameter in the new `handleRequest`
1314
+ - `<SelectedVariantAddToCartButton />` has been removed; the `<AddToCartButton />` will now use the selectedVariant by default.
1315
+ - Remove the `<SelectedVariantImage />` component in favour of using `<Image data={product.selectedVariant.image} />`
1316
+ - Remove the `<SelectedVariantMetafield />` component in favour of using `<ProductMetafield variantId={product.selectedVariant.id} />`
1317
+ - Remove the `<SelectedVariantBuyNowButton />` component in favour of using `<BuyNowButton variantId={product.selectedVariant.id} />`
1318
+ - Remove the `<SelectedVariantShopPayButton />` component in favour of using `<ShopPayButton variantId={product.selectedVariant.id} />`
1319
+
1320
+ ## [0.10.1] - 2022-01-26
1321
+
1322
+ ### Fixed
1323
+
1324
+ - Hot reload for newly added page files
1325
+
1326
+ ## [0.10.0] - 2022-01-25
1327
+
1328
+ ### Changed
1329
+
1330
+ - Warn instead of error when a page server component is missing valid exports
1331
+ - Adopt upstream version of React Server Components. See [#498](https://github.com/Shopify/hydrogen/pull/498) for breaking changes
1332
+ - Bump to latest version of React experimental to include [upstream context bugfix](https://github.com/facebook/react/issues/23089)
1333
+ - Improve API routes by allowing [strings and JS objects](https://github.com/Shopify/hydrogen/issues/476) to be returned.
1334
+
1335
+ ### Breaking Change
1336
+
1337
+ - The 'locale' option in shopify.config.js had been renamed to 'defaultLocale'
1338
+ - Rename `graphqlApiVersion` to `storefrontApiVersion` in `shopify.config.js`
1339
+
1340
+ ### Fixed
1341
+
1342
+ - Make sure that API routes [hot reload properly](https://github.com/Shopify/hydrogen/issues/497)
1343
+
1344
+ ## [0.9.1] - 2022-01-20
1345
+
1346
+ ### Changed
1347
+
1348
+ - Transitive dependency bump.
1349
+
1350
+ ## [0.9.0] - 2022-01-20
1351
+
1352
+ ### Added
1353
+
1354
+ - API routes 🎉
1355
+
1356
+ ### Changed
1357
+
1358
+ - Move to undici instead of node-fetch
1359
+
1360
+ ## [0.8.3] - 2022-01-13
1361
+
1362
+ ### Added
1363
+
1364
+ - Add optional `locale` param to `useShopQuery` to be used as `Accept-Language` in the store Storefront API query
1365
+ - Optional purge query cache per build
1366
+
1367
+ ### Fixed
1368
+
1369
+ - Replace log abbreviations with full text.
1370
+
1371
+ ## [0.8.2] - 2022-01-07
1372
+
1373
+ ### Changed
1374
+
1375
+ - Warn when requests take longer than 3000ms instead of erroring
1376
+ - `useQuery` returns an error if the query's fetch was unsuccessful
1377
+ - `useShopQuery` will give error hints to look at `shopify.config.js` when the Storefront API responds with a 403
1378
+
1379
+ ### Fixed
1380
+
1381
+ - Load logger only once.
1382
+ - Do not attempt to decode product IDs, as they are no longer base64-encoded in `unstable`
1383
+
1384
+ ## [0.8.1] - 2022-01-04
1385
+
1386
+ ### Added
1387
+
1388
+ - Detect bot user agents and give bots a non-streamed response.
1389
+ - Add global `Oxygen.env` for server-only environment variables.
1390
+ - Logging abstraction with default timing information
1391
+
1392
+ ### Changed
1393
+
1394
+ - Upgrade to latest React 18 experimental version
1395
+
1396
+ ### Fixed
1397
+
1398
+ - Cart decrease button removes at zero quantity
1399
+
1400
+ ## [0.8.0] - 2021-12-07
1401
+
1402
+ ### Fixed
1403
+
1404
+ - Export `CartLineSelectedOptions` properly
1405
+ - Fix suspense utility function
1406
+
1407
+ ## [0.7.1] - 2021-12-02
1408
+
1409
+ ### Changed
1410
+
1411
+ - Allow `useShopQuery` to be skippable if no query is passed
1412
+ - Remove usage of `react-query` (Not a breaking change)
1413
+
1414
+ ### Fixed
1415
+
1416
+ - Avoid repeating the same identifier for default and named exports
1417
+ - Remove sourcemap warnings
1418
+
1419
+ ## [0.7.0] - 2021-11-22
1420
+
1421
+ ### Added
1422
+
1423
+ - Add file reference metafield support
1424
+ - Allow custom Model3D poster
1425
+ - Support synchronous server redirects
1426
+
1427
+ ### Fixed
1428
+
1429
+ - Binding of waitUntil in playground/server-components-worker
1430
+ - Default to `retry: false` in `useQuery`
1431
+ - Warn and ignore reserved properties in server state
1432
+ - Run graphiql middleware before vite, fixing graphiql
1433
+
1434
+ ## [0.6.4] - 2021-11-11
1435
+
1436
+ ### Fixed
1437
+
1438
+ - Let Vite handle public assets in development
1439
+ - New lines in hydration request break JSON.parse
1440
+ - Normalize POSIX separators to support windows [#201](https://github.com/Shopify/hydrogen/pull/201)
1441
+ - Scroll to top on app first load
1442
+ - Update variantID to variantId [#78](https://github.com/Shopify/hydrogen/pull/78)
1443
+
1444
+ ## [0.6.3] - 2021-11-10
1445
+
1446
+ ### Fixed
1447
+
1448
+ - Add trailing slash to user components glob
1449
+
1450
+ ## [0.6.2] - 2021-11-10
1451
+
1452
+ ### Fixed
1453
+
1454
+ - Remove CartProvider from BuyNowButton
1455
+ - Reading property of null for component props
1456
+ - Transform deeply-imported client components
1457
+ - Duplicated files and contexts in browser
1458
+
1459
+ ## [0.6.1] - 2021-11-08
1460
+
1461
+ ### Changed
1462
+
1463
+ - Transitive dependency bump.
1464
+
1465
+ ### Fixed
1466
+
1467
+ - Do not set headers after they are sent to client
1468
+
1469
+ ## [0.6.0] - 2021-11-05
1470
+
1471
+ ### Changed
1472
+
1473
+ - Disable the quantity adjust button when the cart is not idle
1474
+ - Use country server state in cart for the inContext directive
1475
+ - Use Image url field instead of deprecated originalSrc field
1476
+ - Switch to unstable API
1477
+
1478
+ ### Fixed
1479
+
1480
+ - Update interaction prompt and interaction promp style attributes for Model3d
1481
+ - Make sure all errors show an error dialog when hydrogen is in dev mode
1482
+ - MediaFile component warning on non-Model3D types
1483
+ - Remove console logs for caching
1484
+ - Lowercased SVG tags in RSC
1485
+ - Make the URL search property available via hooks
1486
+
1487
+ ## 0.5.8 - 2021-11-04
1488
+
1489
+ ### Fixed
1490
+
1491
+ - Ensure delayed callback is fired for cache purposes in Workers runtimes.
1492
+
1493
+ ## 0.5.3 - 2021-11-02
1494
+
1495
+ ### Changed
1496
+
1497
+ - No updates. Transitive dependency bump.
1498
+
1499
+ ## 0.5.2 - 2021-11-02
1500
+
1501
+ ### Changed
1502
+
1503
+ - No updates. Transitive dependency bump.
1504
+
1505
+ ## 0.5.1 - 2021-11-02
1506
+
1507
+ ### Changed
1508
+
1509
+ - No updates. Transitive dependency bump.
1510
+
1511
+ ## 0.5.0 - 2021-11-01
1512
+
1513
+ ### Fixed
1514
+
1515
+ - Update the ServerStateProvider context
1516
+ - Add tabIndex to ShopPayButton
1517
+ - Update LocalizationProvider query, context, and exports
1518
+
1519
+ ## 0.4.3 - 2021-10-29
1520
+
1521
+ ### Added
1522
+
1523
+ - Introduct full-page and sub-request caching API.
1524
+
1525
+ ## 0.4.2 - 2021-10-29
1526
+
1527
+ ### Changed
1528
+
1529
+ - Update Model3D props and add binding to model-viewer events
1530
+
1531
+ ### Fixed
1532
+
1533
+ - Add `passthoughProps.disabled` to `AddToCartButton`
1534
+ - Do not show undefined currency symbol in production
1535
+
1536
+ ## 0.4.0 - 2021-10-27
1537
+
1538
+ ### Added
1539
+
1540
+ - Add external image support to Image component
1541
+
1542
+ ### Changed
1543
+
1544
+ - Make `CartProvider` a client-only concern. [#631](https://github.com/Shopify/hydrogen/pull/631)
1545
+ - Use `Accept: application/hydrogen` as a header when making `fetch` calls against a Hydrogen page. Useful for Custom Responses.
1546
+
1547
+ ### Fixed
1548
+
1549
+ - Lock model-viewer.js version to 1.8
1550
+ - Use the Intl.NumberFormat parts for determining the amount value returned by the useMoney hook
1551
+ - Optimize React related dependencies at server start to avoid page reloads
1552
+ - Do not throw when `storeDomain` contains protocol.
1553
+
1554
+ ## 0.3.0 - 2021-10-20
1555
+
1556
+ ### Added
1557
+
1558
+ - Export utilities in client bundle
1559
+
1560
+ ### Fixed
1561
+
1562
+ - `parseCookies` will split only on first =
1563
+ - Make BuyNowButton a client component since it uses useEffect
1564
+ - Preserve original aspect ratio for product images
1565
+ - Invoke CartProvider callbacks before performing the GraphQL mutations
1566
+ - Fix the accessible label in the AddToCartButton component when an item is added to cart
1567
+ - Cart fetch to return stringified error
1568
+
1569
+ ### Removed
1570
+
1571
+ - Remove sourcemap warnings
1572
+
1573
+ ## 0.2.1 - 2021-10-12
1574
+
1575
+ ### Fixed
1576
+
1577
+ - Demo Store template GalleryPreview unique key warning
1578
+ - Mitigation for upcoming breaking minor Vite update
1579
+
1580
+ ## 0.2.0 - 2021-10-08
1581
+
1582
+ ### Added
1583
+
1584
+ - Added support for images and collections in the ProductProvider component
1585
+ - Added more GraphQL fragments for building block components (Metafield, UnitPrice) and updated exports of these fragments
1586
+
1587
+ ### Breaking Change
1588
+
1589
+ - `useQuery` now behaves exactly like [react-query's hook of the same name](https://react-query.tanstack.com/reference/useQuery#_top)
1590
+
1591
+ ### Fixed
1592
+
1593
+ - Handle products with selling plans
1594
+
1595
+ ## 0.1.2 - 2021-09-30
1596
+
1597
+ ### Fixed
1598
+
1599
+ - SSR issue when running Vite 2.6
1600
+ - Occasional `ProductProviderFragment` error when booting Hydrogen dev server [#571](https://github.com/Shopify/hydrogen/issues/571)
1601
+
1602
+ ## 0.1.1 - 2021-09-24
1603
+
1604
+ ### Added
1605
+
1606
+ - New GraphQL fragments for Variants, SellingPlans, and SellingPlanGroups
1607
+
1608
+ ### Changed
1609
+
1610
+ - Updated types for the `useProductOptions` hook
1611
+
1612
+ ### Fixed
1613
+
1614
+ - `Dynamic require of "stream" is not supported` error in browser logs
1615
+
1616
+ ## 0.1.0 - 2021-09-23
1617
+
1618
+ ### Changed
1619
+
1620
+ - No updates. Transitive dependency bump.
1621
+
1622
+ ## 1.0.0-alpha.22 - 2021-09-22
1623
+
1624
+ ### Changed
1625
+
1626
+ - No updates. Transitive dependency bump.
1627
+
1628
+ [0.6.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.0
1629
+ [0.6.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.1
1630
+ [0.6.2]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.2
1631
+ [0.6.3]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.3
1632
+ [0.6.4]: https://github.com/Shopify/hydrogen/releases/tag/v0.6.4
1633
+ [0.7.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.7.0
1634
+ [0.7.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.7.1
1635
+ [0.8.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.0
1636
+ [0.8.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.1
1637
+ [0.8.2]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.2
1638
+ [0.8.3]: https://github.com/Shopify/hydrogen/releases/tag/v0.8.3
1639
+ [0.9.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.9.0
1640
+ [0.9.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.9.1
1641
+ [0.10.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.0
1642
+ [0.10.1]: https://github.com/Shopify/hydrogen/releases/tag/v0.10.1
1643
+ [0.11.0]: https://github.com/Shopify/hydrogen/releases/tag/v0.11.0