@shopify/hydrogen 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (524) hide show
  1. package/CHANGELOG.md +304 -0
  2. package/dist/esnext/client.d.ts +1 -0
  3. package/dist/esnext/client.js +1 -0
  4. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +5 -5
  5. package/dist/esnext/components/CartLines/{CartLines.d.ts → CartLines.client.d.ts} +0 -0
  6. package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +0 -0
  7. package/dist/esnext/components/CartLines/index.d.ts +1 -1
  8. package/dist/esnext/components/CartLines/index.js +1 -1
  9. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +7 -4
  10. package/dist/esnext/components/CartProvider/CartProvider.client.js +22 -12
  11. package/dist/esnext/components/DevTools.client.js +1 -1
  12. package/dist/esnext/components/Image/Image.d.ts +11 -3
  13. package/dist/esnext/components/Image/Image.js +64 -13
  14. package/dist/esnext/components/Link/Link.client.d.ts +2 -0
  15. package/dist/esnext/components/Link/Link.client.js +7 -4
  16. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +1 -1
  17. package/dist/esnext/components/MediaFile/MediaFile.js +3 -2
  18. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  19. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +140 -0
  20. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
  21. package/dist/esnext/components/{ProductProvider → ProductOptionsProvider}/context.js +0 -1
  22. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
  23. package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
  24. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -2
  25. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +10 -12
  26. package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +3 -0
  27. package/dist/esnext/components/Seo/NoIndexSeo.client.js +10 -0
  28. package/dist/esnext/components/Seo/Seo.client.d.ts +4 -0
  29. package/dist/esnext/components/Seo/Seo.client.js +3 -0
  30. package/dist/esnext/components/index.d.ts +1 -1
  31. package/dist/esnext/components/index.js +1 -1
  32. package/dist/esnext/config.d.ts +3 -3
  33. package/dist/esnext/entry-client.js +106 -9
  34. package/dist/esnext/entry-server.d.ts +3 -16
  35. package/dist/esnext/entry-server.js +281 -331
  36. package/dist/esnext/foundation/Analytics/Analytics.client.js +16 -14
  37. package/dist/esnext/foundation/Analytics/Analytics.server.js +27 -20
  38. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  39. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +17 -15
  40. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
  41. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +2 -2
  42. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.server.d.ts +1 -0
  43. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/{PerformanceMetrics.server.js → ServerAnalyticsConnector.server.js} +7 -6
  44. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.d.ts +1 -0
  45. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.js +19 -0
  46. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
  47. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +190 -0
  48. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
  49. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +24 -0
  50. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +28 -0
  51. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +51 -0
  52. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
  53. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
  54. package/dist/esnext/foundation/Analytics/hook.js +4 -2
  55. package/dist/esnext/foundation/Analytics/index.d.ts +0 -1
  56. package/dist/esnext/foundation/Analytics/index.js +0 -1
  57. package/dist/esnext/foundation/Analytics/utils.d.ts +2 -0
  58. package/dist/esnext/foundation/Analytics/utils.js +21 -0
  59. package/dist/{node/framework → esnext/foundation/Cache}/cache-sub-request.d.ts +1 -1
  60. package/dist/esnext/{framework → foundation/Cache}/cache-sub-request.js +3 -3
  61. package/dist/esnext/{framework → foundation/Cache}/cache.d.ts +1 -1
  62. package/dist/esnext/{framework → foundation/Cache}/cache.js +3 -3
  63. package/dist/{node/framework/CachingStrategy → esnext/foundation/Cache/strategies}/index.d.ts +1 -1
  64. package/dist/esnext/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +0 -0
  65. package/dist/esnext/foundation/Cookie/Cookie.d.ts +3 -3
  66. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +5 -10
  67. package/dist/{node/framework/Hydration → esnext/foundation/Html}/Html.d.ts +3 -1
  68. package/dist/esnext/{framework/Hydration → foundation/Html}/Html.js +15 -2
  69. package/dist/{node/framework/Hydration/ServerComponentRequest.server.d.ts → esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +9 -5
  70. package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +1 -1
  71. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +23 -0
  72. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +46 -0
  73. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +2 -1
  74. package/dist/esnext/foundation/Router/BrowserRouter.client.js +17 -10
  75. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  76. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -3
  77. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +4 -4
  78. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +2 -2
  79. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +1 -1
  80. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +1 -1
  81. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +1 -1
  82. package/dist/esnext/foundation/index.d.ts +1 -1
  83. package/dist/esnext/foundation/index.js +1 -1
  84. package/dist/esnext/foundation/runtime.d.ts +2 -0
  85. package/dist/esnext/foundation/runtime.js +6 -0
  86. package/dist/esnext/foundation/session/session.d.ts +3 -3
  87. package/dist/esnext/foundation/ssr-interop.d.ts +2 -2
  88. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +2 -0
  89. package/dist/esnext/foundation/useNavigate/useNavigate.js +11 -4
  90. package/dist/esnext/foundation/useQuery/hooks.js +9 -6
  91. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +2 -1
  92. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +1 -1
  93. package/dist/esnext/framework/Hydration/rsc.js +4 -2
  94. package/dist/esnext/framework/middleware.js +1 -15
  95. package/dist/esnext/framework/plugin.js +4 -0
  96. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +1 -1
  97. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +6 -3
  98. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +7 -48
  99. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +5 -18
  100. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  101. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
  102. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +7 -0
  103. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +99 -0
  104. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +4 -4
  105. package/dist/esnext/framework/viteception.d.ts +4 -0
  106. package/dist/esnext/framework/viteception.js +15 -0
  107. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +2 -2
  108. package/dist/esnext/hooks/useProductOptions/types.d.ts +16 -14
  109. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -15
  110. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +8 -107
  111. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +1 -2
  112. package/dist/esnext/hooks/useShopQuery/hooks.js +12 -7
  113. package/dist/esnext/index.d.ts +30 -16
  114. package/dist/esnext/index.js +30 -20
  115. package/dist/esnext/storefront-api-types.d.ts +1 -1
  116. package/dist/esnext/streaming.server.d.ts +3 -2
  117. package/dist/esnext/streaming.server.js +0 -4
  118. package/dist/esnext/types.d.ts +43 -27
  119. package/dist/esnext/utilities/apiRoutes.d.ts +5 -6
  120. package/dist/esnext/utilities/apiRoutes.js +2 -8
  121. package/dist/esnext/utilities/fetch.d.ts +1 -2
  122. package/dist/esnext/utilities/fetch.js +1 -3
  123. package/dist/esnext/utilities/graphql-tag.d.ts +1 -0
  124. package/dist/esnext/utilities/graphql-tag.js +6 -0
  125. package/dist/esnext/utilities/graphql-tracker.d.ts +1 -1
  126. package/dist/esnext/utilities/graphql-tracker.js +4 -0
  127. package/dist/esnext/utilities/html-encoding.d.ts +0 -1
  128. package/dist/esnext/utilities/html-encoding.js +0 -8
  129. package/dist/esnext/utilities/index.d.ts +2 -2
  130. package/dist/esnext/utilities/index.js +2 -2
  131. package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
  132. package/dist/esnext/utilities/isBrowser/index.js +1 -0
  133. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
  134. package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
  135. package/dist/esnext/utilities/isServer/isServer.js +2 -2
  136. package/dist/esnext/utilities/log/index.d.ts +1 -1
  137. package/dist/esnext/utilities/log/index.js +1 -1
  138. package/dist/esnext/utilities/log/log-cache-header.d.ts +4 -4
  139. package/dist/esnext/utilities/log/log-query-timeline.d.ts +3 -3
  140. package/dist/esnext/utilities/log/log.d.ts +17 -11
  141. package/dist/esnext/utilities/log/log.js +29 -20
  142. package/dist/esnext/version.d.ts +1 -1
  143. package/dist/esnext/version.js +1 -1
  144. package/dist/node/client.d.ts +16 -0
  145. package/dist/node/client.js +43 -0
  146. package/dist/node/components/AddToCartButton/AddToCartButton.client.d.ts +23 -0
  147. package/dist/node/components/AddToCartButton/AddToCartButton.client.js +74 -0
  148. package/dist/node/components/AddToCartButton/index.d.ts +1 -0
  149. package/dist/node/components/AddToCartButton/index.js +5 -0
  150. package/dist/node/components/BuyNowButton/BuyNowButton.client.d.ts +18 -0
  151. package/dist/node/components/BuyNowButton/BuyNowButton.client.js +53 -0
  152. package/dist/node/components/BuyNowButton/index.d.ts +1 -0
  153. package/dist/node/components/BuyNowButton/index.js +5 -0
  154. package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +11 -0
  155. package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.js +44 -0
  156. package/dist/node/components/CartCheckoutButton/index.d.ts +1 -0
  157. package/dist/node/components/CartCheckoutButton/index.js +5 -0
  158. package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +14 -0
  159. package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.js +36 -0
  160. package/dist/node/components/CartEstimatedCost/index.d.ts +1 -0
  161. package/dist/node/components/CartEstimatedCost/index.js +5 -0
  162. package/dist/node/components/CartLineImage/CartLineImage.client.d.ts +9 -0
  163. package/dist/node/components/CartLineImage/CartLineImage.client.js +18 -0
  164. package/dist/node/components/CartLineImage/index.d.ts +1 -0
  165. package/dist/node/components/CartLineImage/index.js +5 -0
  166. package/dist/node/components/CartLinePrice/CartLinePrice.client.d.ts +12 -0
  167. package/dist/node/components/CartLinePrice/CartLinePrice.client.js +28 -0
  168. package/dist/node/components/CartLinePrice/index.d.ts +1 -0
  169. package/dist/node/components/CartLinePrice/index.js +5 -0
  170. package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -0
  171. package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.js +19 -0
  172. package/dist/node/components/CartLineProductTitle/index.d.ts +1 -0
  173. package/dist/node/components/CartLineProductTitle/index.js +5 -0
  174. package/dist/node/components/CartLineProvider/CartLineProvider.client.d.ts +11 -0
  175. package/dist/node/components/CartLineProvider/CartLineProvider.client.js +15 -0
  176. package/dist/node/components/CartLineProvider/context.d.ts +26 -0
  177. package/dist/node/components/CartLineProvider/context.js +5 -0
  178. package/dist/node/components/CartLineProvider/index.d.ts +2 -0
  179. package/dist/node/components/CartLineProvider/index.js +7 -0
  180. package/dist/node/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -0
  181. package/dist/node/components/CartLineQuantity/CartLineQuantity.client.js +19 -0
  182. package/dist/node/components/CartLineQuantity/index.d.ts +1 -0
  183. package/dist/node/components/CartLineQuantity/index.js +5 -0
  184. package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +14 -0
  185. package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +31 -0
  186. package/dist/node/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
  187. package/dist/node/components/CartLineQuantityAdjustButton/index.js +5 -0
  188. package/dist/node/components/CartLines/CartLines.client.d.ts +15 -0
  189. package/dist/node/components/CartLines/CartLines.client.js +44 -0
  190. package/dist/node/components/CartLines/index.d.ts +1 -0
  191. package/dist/node/components/CartLines/index.js +5 -0
  192. package/dist/node/components/CartProvider/CartProvider.client.d.ts +41 -0
  193. package/dist/node/components/CartProvider/CartProvider.client.js +550 -0
  194. package/dist/node/components/CartProvider/cart-queries.d.ts +10 -0
  195. package/dist/node/components/CartProvider/cart-queries.js +203 -0
  196. package/dist/node/components/CartProvider/constants.d.ts +2 -0
  197. package/dist/node/components/CartProvider/constants.js +5 -0
  198. package/dist/node/components/CartProvider/context.d.ts +2 -0
  199. package/dist/node/components/CartProvider/context.js +5 -0
  200. package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +86 -0
  201. package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.js +2 -0
  202. package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +86 -0
  203. package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +2 -0
  204. package/dist/node/components/CartProvider/graphql/CartCreateMutation.d.ts +85 -0
  205. package/dist/node/components/CartProvider/graphql/CartCreateMutation.js +2 -0
  206. package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +86 -0
  207. package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +2 -0
  208. package/dist/node/components/CartProvider/graphql/CartFragment.d.ts +72 -0
  209. package/dist/node/components/CartProvider/graphql/CartFragment.js +2 -0
  210. package/dist/node/components/CartProvider/graphql/CartLineAddMutation.d.ts +86 -0
  211. package/dist/node/components/CartProvider/graphql/CartLineAddMutation.js +2 -0
  212. package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +86 -0
  213. package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.js +2 -0
  214. package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +86 -0
  215. package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.js +2 -0
  216. package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +86 -0
  217. package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.js +2 -0
  218. package/dist/node/components/CartProvider/graphql/CartQuery.d.ts +81 -0
  219. package/dist/node/components/CartProvider/graphql/CartQuery.js +2 -0
  220. package/dist/node/components/CartProvider/hooks.client.d.ts +15 -0
  221. package/dist/node/components/CartProvider/hooks.client.js +90 -0
  222. package/dist/node/components/CartProvider/index.d.ts +4 -0
  223. package/dist/node/components/CartProvider/index.js +10 -0
  224. package/dist/node/components/CartProvider/types.d.ts +102 -0
  225. package/dist/node/components/CartProvider/types.js +2 -0
  226. package/dist/node/components/CartShopPayButton/CartShopPayButton.client.d.ts +9 -0
  227. package/dist/node/components/CartShopPayButton/CartShopPayButton.client.js +46 -0
  228. package/dist/node/components/CartShopPayButton/index.d.ts +1 -0
  229. package/dist/node/components/CartShopPayButton/index.js +5 -0
  230. package/dist/node/components/ExternalVideo/ExternalVideo.d.ts +21 -0
  231. package/dist/node/components/ExternalVideo/ExternalVideo.js +21 -0
  232. package/dist/node/components/ExternalVideo/index.d.ts +1 -0
  233. package/dist/node/components/ExternalVideo/index.js +5 -0
  234. package/dist/node/components/Image/Image.d.ts +11 -3
  235. package/dist/node/components/Image/Image.js +63 -12
  236. package/dist/node/components/Link/Link.client.d.ts +25 -0
  237. package/dist/node/components/Link/Link.client.js +165 -0
  238. package/dist/node/components/Link/index.d.ts +1 -0
  239. package/dist/node/components/Link/index.js +5 -0
  240. package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
  241. package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.js +11 -0
  242. package/dist/node/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -0
  243. package/dist/node/components/LocalizationProvider/LocalizationContext.client.js +5 -0
  244. package/dist/node/components/LocalizationProvider/LocalizationProvider.server.d.ts +33 -0
  245. package/dist/node/components/LocalizationProvider/LocalizationProvider.server.js +51 -0
  246. package/dist/node/components/MediaFile/MediaFile.d.ts +19 -0
  247. package/dist/node/components/MediaFile/MediaFile.js +39 -0
  248. package/dist/node/components/MediaFile/index.d.ts +1 -0
  249. package/dist/node/components/MediaFile/index.js +5 -0
  250. package/dist/node/components/Metafield/Metafield.client.d.ts +21 -0
  251. package/dist/node/components/Metafield/Metafield.client.js +75 -0
  252. package/dist/node/components/Metafield/index.d.ts +2 -0
  253. package/dist/node/components/Metafield/index.js +5 -0
  254. package/dist/node/components/Metafield/types.d.ts +4 -0
  255. package/dist/node/components/Metafield/types.js +2 -0
  256. package/dist/node/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  257. package/dist/node/components/ModelViewer/ModelViewer.client.js +132 -0
  258. package/dist/node/components/ModelViewer/index.d.ts +1 -0
  259. package/dist/node/components/ModelViewer/index.js +5 -0
  260. package/dist/node/components/Money/Money.client.d.ts +25 -0
  261. package/dist/node/components/Money/Money.client.js +46 -0
  262. package/dist/node/components/Money/index.d.ts +1 -0
  263. package/dist/node/components/Money/index.js +5 -0
  264. package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  265. package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.js +167 -0
  266. package/dist/node/components/ProductOptionsProvider/context.d.ts +2 -0
  267. package/dist/node/components/ProductOptionsProvider/context.js +5 -0
  268. package/dist/node/components/ProductOptionsProvider/index.d.ts +2 -0
  269. package/dist/node/components/ProductOptionsProvider/index.js +7 -0
  270. package/dist/node/components/ProductPrice/ProductPrice.client.d.ts +18 -0
  271. package/dist/node/components/ProductPrice/ProductPrice.client.js +61 -0
  272. package/dist/node/components/ProductPrice/index.d.ts +1 -0
  273. package/dist/node/components/ProductPrice/index.js +5 -0
  274. package/dist/node/components/Seo/CollectionSeo.client.d.ts +3 -0
  275. package/dist/node/components/Seo/CollectionSeo.client.js +22 -0
  276. package/dist/node/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  277. package/dist/node/components/Seo/DefaultPageSeo.client.js +25 -0
  278. package/dist/node/components/Seo/DescriptionSeo.client.d.ts +4 -0
  279. package/dist/node/components/Seo/DescriptionSeo.client.js +17 -0
  280. package/dist/node/components/Seo/HomePageSeo.client.d.ts +2 -0
  281. package/dist/node/components/Seo/HomePageSeo.client.js +32 -0
  282. package/dist/node/components/Seo/ImageSeo.client.d.ts +3 -0
  283. package/dist/node/components/Seo/ImageSeo.client.js +17 -0
  284. package/dist/node/components/Seo/NoIndexSeo.client.d.ts +3 -0
  285. package/dist/node/components/Seo/NoIndexSeo.client.js +17 -0
  286. package/dist/node/components/Seo/PageSeo.client.d.ts +3 -0
  287. package/dist/node/components/Seo/PageSeo.client.js +20 -0
  288. package/dist/node/components/Seo/ProductSeo.client.d.ts +5 -0
  289. package/dist/node/components/Seo/ProductSeo.client.js +70 -0
  290. package/dist/node/components/Seo/Seo.client.d.ts +30 -0
  291. package/dist/node/components/Seo/Seo.client.js +38 -0
  292. package/dist/node/components/Seo/TitleSeo.client.d.ts +3 -0
  293. package/dist/node/components/Seo/TitleSeo.client.js +17 -0
  294. package/dist/node/components/Seo/TwitterSeo.client.d.ts +2 -0
  295. package/dist/node/components/Seo/TwitterSeo.client.js +16 -0
  296. package/dist/node/components/Seo/index.d.ts +1 -0
  297. package/dist/node/components/Seo/index.js +5 -0
  298. package/dist/node/components/Seo/seo-types.d.ts +17 -0
  299. package/dist/node/components/Seo/seo-types.js +2 -0
  300. package/dist/node/components/ShopPayButton/ShopPayButton.client.d.ts +38 -0
  301. package/dist/node/components/ShopPayButton/ShopPayButton.client.js +60 -0
  302. package/dist/node/components/ShopPayButton/index.d.ts +1 -0
  303. package/dist/node/components/ShopPayButton/index.js +5 -0
  304. package/dist/node/components/Video/Video.d.ts +14 -0
  305. package/dist/node/components/Video/Video.js +31 -0
  306. package/dist/node/components/Video/index.d.ts +1 -0
  307. package/dist/node/components/Video/index.js +5 -0
  308. package/dist/node/components/index.d.ts +28 -0
  309. package/dist/node/components/index.js +59 -0
  310. package/dist/node/components/types.d.ts +71 -0
  311. package/dist/node/components/types.js +11 -0
  312. package/dist/node/entry-server.d.ts +3 -16
  313. package/dist/node/entry-server.js +280 -330
  314. package/dist/node/foundation/Analytics/Analytics.client.js +19 -17
  315. package/dist/node/foundation/Analytics/Analytics.server.js +27 -20
  316. package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  317. package/dist/node/foundation/Analytics/ClientAnalytics.js +16 -14
  318. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
  319. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  320. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +68 -0
  321. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  322. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +27 -0
  323. package/dist/node/foundation/Analytics/hook.js +4 -2
  324. package/dist/node/foundation/Analytics/index.d.ts +0 -1
  325. package/dist/node/foundation/Analytics/index.js +1 -3
  326. package/dist/node/foundation/Analytics/utils.d.ts +2 -0
  327. package/dist/node/foundation/Analytics/utils.js +24 -1
  328. package/dist/{esnext/framework → node/foundation/Cache}/cache-sub-request.d.ts +1 -1
  329. package/dist/node/{framework → foundation/Cache}/cache-sub-request.js +4 -4
  330. package/dist/node/{framework → foundation/Cache}/cache.d.ts +1 -1
  331. package/dist/node/{framework → foundation/Cache}/cache.js +5 -5
  332. package/dist/{esnext/framework/CachingStrategy → node/foundation/Cache/strategies}/index.d.ts +1 -1
  333. package/dist/node/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +0 -0
  334. package/dist/node/foundation/Head/Head.client.d.ts +5 -0
  335. package/dist/node/foundation/Head/Head.client.js +17 -0
  336. package/dist/node/foundation/Head/index.d.ts +1 -0
  337. package/dist/node/foundation/Head/index.js +5 -0
  338. package/dist/{esnext/framework/Hydration → node/foundation/Html}/Html.d.ts +3 -1
  339. package/dist/node/{framework/Hydration → foundation/Html}/Html.js +15 -2
  340. package/dist/{esnext/framework/Hydration/ServerComponentRequest.server.d.ts → node/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +9 -5
  341. package/dist/node/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +3 -3
  342. package/dist/node/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +23 -0
  343. package/dist/node/foundation/HydrogenResponse/HydrogenResponse.server.js +53 -0
  344. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +2 -1
  345. package/dist/node/foundation/Router/BrowserRouter.client.js +17 -10
  346. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  347. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -3
  348. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +4 -4
  349. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +2 -2
  350. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  351. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.js +35 -0
  352. package/dist/node/foundation/ShopifyProvider/index.d.ts +1 -0
  353. package/dist/node/foundation/ShopifyProvider/index.js +5 -0
  354. package/dist/node/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  355. package/dist/node/foundation/fetchSync/client/fetchSync.js +33 -0
  356. package/dist/node/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  357. package/dist/node/foundation/fetchSync/server/fetchSync.js +33 -0
  358. package/dist/node/foundation/fetchSync/types.d.ts +5 -0
  359. package/dist/node/foundation/fetchSync/types.js +2 -0
  360. package/dist/node/foundation/index.d.ts +3 -0
  361. package/dist/node/foundation/index.js +10 -0
  362. package/dist/node/foundation/runtime.d.ts +2 -0
  363. package/dist/node/foundation/runtime.js +11 -0
  364. package/dist/node/foundation/session/session.d.ts +3 -3
  365. package/dist/node/foundation/ssr-interop.d.ts +2 -2
  366. package/dist/node/foundation/useNavigate/useNavigate.d.ts +2 -0
  367. package/dist/node/foundation/useNavigate/useNavigate.js +11 -4
  368. package/dist/node/foundation/useQuery/hooks.d.ts +36 -0
  369. package/dist/node/foundation/useQuery/hooks.js +104 -0
  370. package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.d.ts +10 -0
  371. package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.js +34 -0
  372. package/dist/node/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  373. package/dist/node/foundation/useRouteParams/useRouteParams.js +13 -0
  374. package/dist/node/foundation/useServerProps/index.d.ts +1 -0
  375. package/dist/node/foundation/useServerProps/index.js +5 -0
  376. package/dist/node/foundation/useSession/useSession.d.ts +2 -0
  377. package/dist/node/foundation/useSession/useSession.js +12 -0
  378. package/dist/node/foundation/useShop/index.d.ts +1 -0
  379. package/dist/node/foundation/useShop/index.js +5 -0
  380. package/dist/node/foundation/useShop/use-shop.d.ts +6 -0
  381. package/dist/node/foundation/useShop/use-shop.js +18 -0
  382. package/dist/node/foundation/useUrl/index.d.ts +1 -0
  383. package/dist/node/foundation/useUrl/index.js +5 -0
  384. package/dist/node/foundation/useUrl/useUrl.d.ts +4 -0
  385. package/dist/node/foundation/useUrl/useUrl.js +32 -0
  386. package/dist/node/framework/Hydration/rsc.js +4 -2
  387. package/dist/node/framework/middleware.js +1 -15
  388. package/dist/node/framework/plugin.js +4 -0
  389. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +1 -1
  390. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +6 -3
  391. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +6 -47
  392. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +5 -18
  393. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  394. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
  395. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +7 -0
  396. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +105 -0
  397. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +4 -4
  398. package/dist/node/framework/viteception.d.ts +4 -0
  399. package/dist/node/framework/viteception.js +19 -0
  400. package/dist/node/hooks/index.d.ts +6 -0
  401. package/dist/node/hooks/index.js +28 -0
  402. package/dist/node/hooks/useCart/index.d.ts +1 -0
  403. package/dist/node/hooks/useCart/index.js +5 -0
  404. package/dist/node/hooks/useCart/useCart.d.ts +4 -0
  405. package/dist/node/hooks/useCart/useCart.js +19 -0
  406. package/dist/node/hooks/useCartLine/index.d.ts +1 -0
  407. package/dist/node/hooks/useCartLine/index.js +5 -0
  408. package/dist/node/hooks/useCartLine/useCartLine.d.ts +29 -0
  409. package/dist/node/hooks/useCartLine/useCartLine.js +16 -0
  410. package/dist/node/hooks/useCountry/index.d.ts +1 -0
  411. package/dist/node/hooks/useCountry/index.js +5 -0
  412. package/dist/node/hooks/useCountry/useCountry.d.ts +7 -0
  413. package/dist/node/hooks/useCountry/useCountry.js +21 -0
  414. package/dist/node/hooks/useLoadScript/index.d.ts +1 -0
  415. package/dist/node/hooks/useLoadScript/index.js +5 -0
  416. package/dist/node/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  417. package/dist/node/hooks/useLoadScript/useLoadScript.client.js +27 -0
  418. package/dist/node/hooks/useMeasurement/hooks.d.ts +9 -0
  419. package/dist/node/hooks/useMeasurement/hooks.js +17 -0
  420. package/dist/node/hooks/useMeasurement/index.d.ts +1 -0
  421. package/dist/node/hooks/useMeasurement/index.js +5 -0
  422. package/dist/node/hooks/useMoney/hooks.d.ts +54 -0
  423. package/dist/node/hooks/useMoney/hooks.js +70 -0
  424. package/dist/node/hooks/useMoney/index.d.ts +1 -0
  425. package/dist/node/hooks/useMoney/index.js +5 -0
  426. package/dist/node/hooks/useParsedMetafields/index.d.ts +1 -0
  427. package/dist/node/hooks/useParsedMetafields/index.js +5 -0
  428. package/dist/node/hooks/useParsedMetafields/useParsedMetafields.d.ts +21 -0
  429. package/dist/node/hooks/useParsedMetafields/useParsedMetafields.js +25 -0
  430. package/dist/node/hooks/useProductOptions/helpers.d.ts +6 -0
  431. package/dist/node/hooks/useProductOptions/helpers.js +46 -0
  432. package/dist/node/hooks/useProductOptions/index.d.ts +2 -0
  433. package/dist/node/hooks/useProductOptions/index.js +20 -0
  434. package/dist/node/hooks/useProductOptions/types.d.ts +44 -0
  435. package/dist/node/hooks/useProductOptions/types.js +2 -0
  436. package/dist/node/hooks/useProductOptions/useProductOptions.client.d.ts +1 -0
  437. package/dist/node/hooks/useProductOptions/useProductOptions.client.js +13 -0
  438. package/dist/node/hooks/useShopQuery/hooks.d.ts +28 -0
  439. package/dist/node/hooks/useShopQuery/hooks.js +171 -0
  440. package/dist/node/hooks/useShopQuery/index.d.ts +1 -0
  441. package/dist/node/hooks/useShopQuery/index.js +5 -0
  442. package/dist/node/storefront-api-types.d.ts +1 -1
  443. package/dist/node/streaming.server.d.ts +3 -2
  444. package/dist/node/streaming.server.js +1 -6
  445. package/dist/node/types.d.ts +43 -27
  446. package/dist/node/utilities/apiRoutes.d.ts +5 -6
  447. package/dist/node/utilities/apiRoutes.js +2 -8
  448. package/dist/node/utilities/devtools.d.ts +11 -0
  449. package/dist/node/utilities/devtools.js +15 -0
  450. package/dist/node/utilities/fetch.d.ts +1 -2
  451. package/dist/node/utilities/fetch.js +1 -3
  452. package/dist/node/utilities/graphql-tag.d.ts +1 -0
  453. package/dist/node/utilities/graphql-tag.js +10 -0
  454. package/dist/node/utilities/graphql-tracker.d.ts +17 -0
  455. package/dist/node/utilities/graphql-tracker.js +130 -0
  456. package/dist/node/utilities/html-encoding.d.ts +0 -1
  457. package/dist/node/utilities/html-encoding.js +1 -10
  458. package/dist/node/utilities/index.d.ts +2 -2
  459. package/dist/node/utilities/index.js +3 -4
  460. package/dist/node/utilities/isBrowser/index.d.ts +1 -0
  461. package/dist/node/utilities/isBrowser/index.js +5 -0
  462. package/dist/node/utilities/isBrowser/isBrowser.d.ts +4 -0
  463. package/dist/node/utilities/isBrowser/isBrowser.js +10 -0
  464. package/dist/node/utilities/isServer/isServer.js +2 -2
  465. package/dist/node/utilities/log/index.d.ts +1 -1
  466. package/dist/node/utilities/log/index.js +1 -3
  467. package/dist/node/utilities/log/log-cache-header.d.ts +4 -4
  468. package/dist/node/utilities/log/log-query-timeline.d.ts +3 -3
  469. package/dist/node/utilities/log/log.d.ts +17 -11
  470. package/dist/node/utilities/log/log.js +30 -23
  471. package/dist/node/version.d.ts +1 -1
  472. package/dist/node/version.js +1 -1
  473. package/package.json +6 -3
  474. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +219 -51
  475. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +77 -59
  476. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +30 -30
  477. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +199 -70
  478. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +38 -35
  479. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +9 -8
  480. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +3 -3
  481. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -7
  482. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +220 -52
  483. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +77 -59
  484. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +199 -70
  485. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +9 -8
  486. package/vendor/react-server-dom-vite/package.json +1 -1
  487. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +0 -8
  488. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +0 -12
  489. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -24
  490. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -34
  491. package/dist/esnext/components/ProductProvider/context.d.ts +0 -29
  492. package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
  493. package/dist/esnext/components/ProductProvider/index.js +0 -2
  494. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +0 -1
  495. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.d.ts +0 -35
  496. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +0 -61
  497. package/dist/esnext/framework/config.d.ts +0 -6
  498. package/dist/esnext/framework/config.js +0 -6
  499. package/dist/esnext/framework/runtime.d.ts +0 -13
  500. package/dist/esnext/framework/runtime.js +0 -27
  501. package/dist/esnext/hooks/useProduct/index.d.ts +0 -1
  502. package/dist/esnext/hooks/useProduct/index.js +0 -1
  503. package/dist/esnext/hooks/useProduct/useProduct.d.ts +0 -52
  504. package/dist/esnext/hooks/useProduct/useProduct.js +0 -43
  505. package/dist/esnext/utilities/findRoutePrefix.d.ts +0 -1
  506. package/dist/esnext/utilities/findRoutePrefix.js +0 -17
  507. package/dist/esnext/utilities/isClient/index.d.ts +0 -1
  508. package/dist/esnext/utilities/isClient/index.js +0 -1
  509. package/dist/esnext/utilities/isClient/isClient.d.ts +0 -4
  510. package/dist/esnext/utilities/isClient/isClient.js +0 -6
  511. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +0 -35
  512. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +0 -68
  513. package/dist/node/framework/config.d.ts +0 -6
  514. package/dist/node/framework/config.js +0 -11
  515. package/dist/node/framework/runtime.d.ts +0 -13
  516. package/dist/node/framework/runtime.js +0 -35
  517. package/dist/node/utilities/defer.d.ts +0 -6
  518. package/dist/node/utilities/defer.js +0 -18
  519. package/dist/node/utilities/findRoutePrefix.d.ts +0 -1
  520. package/dist/node/utilities/findRoutePrefix.js +0 -21
  521. package/dist/node/utilities/isClient/index.d.ts +0 -1
  522. package/dist/node/utilities/isClient/index.js +0 -5
  523. package/dist/node/utilities/isClient/isClient.d.ts +0 -4
  524. package/dist/node/utilities/isClient/isClient.js +0 -10
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useQuery = void 0;
4
+ const log_1 = require("../../utilities/log");
5
+ const cache_sub_request_1 = require("../Cache/cache-sub-request");
6
+ const ServerRequestProvider_1 = require("../ServerRequestProvider");
7
+ const strategies_1 = require("../Cache/strategies");
8
+ /**
9
+ * The `useQuery` hook executes an asynchronous operation like `fetch` in a way that
10
+ * supports [Suspense](https://reactjs.org/docs/concurrent-mode-suspense.html). You can use this
11
+ * hook to call any third-party APIs from a server component.
12
+ *
13
+ * \> Note:
14
+ * \> If you're making a simple fetch call on the server, then we recommend using the [`fetchSync`](https://shopify.dev/api/hydrogen/hooks/global/fetchsync) hook instead.
15
+ */
16
+ function useQuery(
17
+ /** A string or array to uniquely identify the current query. */
18
+ key,
19
+ /** An asynchronous query function like `fetch` which returns data. */
20
+ queryFn,
21
+ /** The options to manage the cache behavior of the sub-request. */
22
+ queryOptions) {
23
+ const request = (0, ServerRequestProvider_1.useServerRequest)();
24
+ const withCacheIdKey = [
25
+ '__QUERY_CACHE_ID__',
26
+ ...(typeof key === 'string' ? [key] : key),
27
+ ];
28
+ const fetcher = cachedQueryFnBuilder(withCacheIdKey, queryFn, queryOptions);
29
+ (0, log_1.collectQueryTimings)(request, withCacheIdKey, 'requested');
30
+ if (queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.preload) {
31
+ request.savePreloadQuery({
32
+ preload: queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.preload,
33
+ key: withCacheIdKey,
34
+ fetcher,
35
+ });
36
+ }
37
+ return (0, ServerRequestProvider_1.useRequestCacheData)(withCacheIdKey, fetcher);
38
+ }
39
+ exports.useQuery = useQuery;
40
+ function cachedQueryFnBuilder(key, queryFn, queryOptions) {
41
+ var _a;
42
+ const resolvedQueryOptions = {
43
+ ...(queryOptions !== null && queryOptions !== void 0 ? queryOptions : {}),
44
+ };
45
+ const shouldCacheResponse = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.shouldCacheResponse) !== null && _a !== void 0 ? _a : (() => true);
46
+ /**
47
+ * Attempt to read the query from cache. If it doesn't exist or if it's stale, regenerate it.
48
+ */
49
+ async function useCachedQueryFn() {
50
+ var _a, _b, _c, _d;
51
+ // Call this hook before running any async stuff
52
+ // to prevent losing the current React cycle.
53
+ const request = (0, ServerRequestProvider_1.useServerRequest)();
54
+ const log = (0, log_1.getLoggerWithContext)(request);
55
+ const cacheResponse = await (0, cache_sub_request_1.getItemFromCache)(key);
56
+ async function generateNewOutput() {
57
+ return await queryFn();
58
+ }
59
+ if (cacheResponse) {
60
+ const [output, response] = cacheResponse;
61
+ (0, log_1.collectQueryCacheControlHeaders)(request, key, response.headers.get('cache-control'));
62
+ /**
63
+ * Important: Do this async
64
+ */
65
+ if ((0, cache_sub_request_1.isStale)(key, response)) {
66
+ const lockKey = ['lock', ...(typeof key === 'string' ? [key] : key)];
67
+ // Run revalidation asynchronously
68
+ const revalidatingPromise = (0, cache_sub_request_1.getItemFromCache)(lockKey).then(async (lockExists) => {
69
+ if (lockExists)
70
+ return;
71
+ await (0, cache_sub_request_1.setItemInCache)(lockKey, true, (0, strategies_1.CacheSeconds)({
72
+ maxAge: 10,
73
+ }));
74
+ try {
75
+ const output = await generateNewOutput();
76
+ if (shouldCacheResponse(output)) {
77
+ await (0, cache_sub_request_1.setItemInCache)(key, output, resolvedQueryOptions === null || resolvedQueryOptions === void 0 ? void 0 : resolvedQueryOptions.cache);
78
+ }
79
+ }
80
+ catch (e) {
81
+ log.error(`Error generating async response: ${e.message}`);
82
+ }
83
+ finally {
84
+ await (0, cache_sub_request_1.deleteItemFromCache)(lockKey);
85
+ }
86
+ });
87
+ // Asynchronously wait for it in workers
88
+ (_b = (_a = request.ctx.runtime) === null || _a === void 0 ? void 0 : _a.waitUntil) === null || _b === void 0 ? void 0 : _b.call(_a, revalidatingPromise);
89
+ }
90
+ return output;
91
+ }
92
+ const newOutput = await generateNewOutput();
93
+ /**
94
+ * Important: Do this async
95
+ */
96
+ if (shouldCacheResponse(newOutput)) {
97
+ const setItemInCachePromise = (0, cache_sub_request_1.setItemInCache)(key, newOutput, resolvedQueryOptions === null || resolvedQueryOptions === void 0 ? void 0 : resolvedQueryOptions.cache);
98
+ (_d = (_c = request.ctx.runtime) === null || _c === void 0 ? void 0 : _c.waitUntil) === null || _d === void 0 ? void 0 : _d.call(_c, setItemInCachePromise);
99
+ }
100
+ (0, log_1.collectQueryCacheControlHeaders)(request, key, (0, cache_sub_request_1.generateSubRequestCacheControlHeader)(resolvedQueryOptions === null || resolvedQueryOptions === void 0 ? void 0 : resolvedQueryOptions.cache));
101
+ return newOutput;
102
+ }
103
+ return useCachedQueryFn;
104
+ }
@@ -0,0 +1,10 @@
1
+ import React, { FC, ReactNode } from 'react';
2
+ declare type RouteParamsContextValue = {
3
+ routeParams: Record<string, string>;
4
+ };
5
+ export declare const RouteParamsContext: React.Context<RouteParamsContextValue>;
6
+ export declare const RouteParamsProvider: FC<{
7
+ routeParams: Record<string, string>;
8
+ children: ReactNode;
9
+ }>;
10
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.RouteParamsProvider = exports.RouteParamsContext = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ exports.RouteParamsContext = (0, react_1.createContext)({
29
+ routeParams: {},
30
+ });
31
+ const RouteParamsProvider = ({ children, routeParams }) => {
32
+ return (react_1.default.createElement(exports.RouteParamsContext.Provider, { value: { routeParams } }, children));
33
+ };
34
+ exports.RouteParamsProvider = RouteParamsProvider;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The `useRouteParams` hook retrieves the parameters of an active route. The hook is available in both server and client components.
3
+ */
4
+ export declare function useRouteParams(): Record<string, string>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRouteParams = void 0;
4
+ const ssr_interop_1 = require("../ssr-interop");
5
+ const RouteParamsProvider_client_1 = require("./RouteParamsProvider.client");
6
+ /**
7
+ * The `useRouteParams` hook retrieves the parameters of an active route. The hook is available in both server and client components.
8
+ */
9
+ function useRouteParams() {
10
+ const router = (0, ssr_interop_1.useEnvContext)((req) => req.ctx.router, RouteParamsProvider_client_1.RouteParamsContext);
11
+ return router.routeParams;
12
+ }
13
+ exports.useRouteParams = useRouteParams;
@@ -0,0 +1 @@
1
+ export { useServerProps } from './use-server-props';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useServerProps = void 0;
4
+ var use_server_props_1 = require("./use-server-props");
5
+ Object.defineProperty(exports, "useServerProps", { enumerable: true, get: function () { return use_server_props_1.useServerProps; } });
@@ -0,0 +1,2 @@
1
+ /** The `useSession` hook reads session data in server components. */
2
+ export declare const useSession: () => Record<string, string>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSession = void 0;
4
+ const ServerRequestProvider_1 = require("../ServerRequestProvider");
5
+ /** The `useSession` hook reads session data in server components. */
6
+ const useSession = function () {
7
+ var _a;
8
+ const request = (0, ServerRequestProvider_1.useServerRequest)();
9
+ const session = ((_a = request.ctx.session) === null || _a === void 0 ? void 0 : _a.get()) || {};
10
+ return session;
11
+ };
12
+ exports.useSession = useSession;
@@ -0,0 +1 @@
1
+ export { useShop } from './use-shop';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useShop = void 0;
4
+ var use_shop_1 = require("./use-shop");
5
+ Object.defineProperty(exports, "useShop", { enumerable: true, get: function () { return use_shop_1.useShop; } });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The `useShop` hook provides access to values within
3
+ * [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/framework/hydrogen-config).
4
+ * The `useShop` hook must be a descendent of a `ShopifyProvider` component.
5
+ */
6
+ export declare function useShop(): import("../ShopifyProvider/types").ShopifyContextValue;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useShop = void 0;
4
+ const ShopifyProvider_1 = require("../ShopifyProvider");
5
+ const ssr_interop_1 = require("../ssr-interop");
6
+ /**
7
+ * The `useShop` hook provides access to values within
8
+ * [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/framework/hydrogen-config).
9
+ * The `useShop` hook must be a descendent of a `ShopifyProvider` component.
10
+ */
11
+ function useShop() {
12
+ const config = (0, ssr_interop_1.useEnvContext)((req) => req.ctx.shopifyConfig, ShopifyProvider_1.ShopifyContext);
13
+ if (!config) {
14
+ throw new Error('No Shopify Context found');
15
+ }
16
+ return config;
17
+ }
18
+ exports.useShop = useShop;
@@ -0,0 +1 @@
1
+ export { useUrl } from './useUrl';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useUrl = void 0;
4
+ var useUrl_1 = require("./useUrl");
5
+ Object.defineProperty(exports, "useUrl", { enumerable: true, get: function () { return useUrl_1.useUrl; } });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The `useUrl` hook retrieves the current URL in a server or client component.
3
+ */
4
+ export declare function useUrl(): URL;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useUrl = void 0;
4
+ const react_1 = require("react");
5
+ const constants_1 = require("../../constants");
6
+ const parse_1 = require("../../utilities/parse");
7
+ const BrowserRouter_client_1 = require("../Router/BrowserRouter.client");
8
+ const ssr_interop_1 = require("../ssr-interop");
9
+ /**
10
+ * The `useUrl` hook retrieves the current URL in a server or client component.
11
+ */
12
+ function useUrl() {
13
+ var _a, _b;
14
+ if (ssr_interop_1.META_ENV_SSR) {
15
+ const serverUrl = new URL((0, ssr_interop_1.useEnvContext)((req) => req.url) // eslint-disable-line react-hooks/rules-of-hooks
16
+ );
17
+ if (serverUrl.pathname === constants_1.RSC_PATHNAME) {
18
+ const state = (0, parse_1.parseJSON)(serverUrl.searchParams.get('state') || '{}');
19
+ const parsedUrl = `${serverUrl.origin}${(_a = state.pathname) !== null && _a !== void 0 ? _a : ''}${(_b = state.search) !== null && _b !== void 0 ? _b : ''}`;
20
+ return new URL(parsedUrl);
21
+ }
22
+ return new URL(serverUrl);
23
+ }
24
+ /**
25
+ * We return a `URL` object instead of passing through `location` because
26
+ * the URL object contains important info like hostname, etc.
27
+ */
28
+ const location = (0, BrowserRouter_client_1.useLocation)(); // eslint-disable-line react-hooks/rules-of-hooks
29
+ // eslint-disable-next-line react-hooks/rules-of-hooks
30
+ return (0, react_1.useMemo)(() => new URL(window.location.href), [location]); // eslint-disable-line react-hooks/exhaustive-deps
31
+ }
32
+ exports.useUrl = useUrl;
@@ -4,16 +4,17 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.useRefresh = exports.useServerResponse = void 0;
6
6
  const react_server_dom_vite_1 = require("@shopify/hydrogen/vendor/react-server-dom-vite");
7
+ const client_1 = require("../../client");
7
8
  const constants_1 = require("../../constants");
8
- const utilities_1 = require("../../utilities");
9
9
  let rscReader;
10
10
  // Hydrate an SSR response from <meta> tags placed in the DOM.
11
11
  const flightChunks = [];
12
12
  const FLIGHT_ATTRIBUTE = 'data-flight';
13
13
  function addElementToFlightChunks(el) {
14
+ // We don't need to decode, because `.getAttribute` already decodes
14
15
  const chunk = el.getAttribute(FLIGHT_ATTRIBUTE);
15
16
  if (chunk) {
16
- flightChunks.push((0, utilities_1.htmlDecode)(chunk));
17
+ flightChunks.push(chunk);
17
18
  }
18
19
  }
19
20
  // Get initial payload
@@ -89,6 +90,7 @@ function useServerResponse(state) {
89
90
  /* @ts-ignore */
90
91
  window.BOOMR.plugins.Hydrogen.trackSubPageLoadPerformance();
91
92
  }
93
+ client_1.ClientAnalytics.resetPageAnalyticsData();
92
94
  // Request a new flight response.
93
95
  response = (0, react_server_dom_vite_1.createFromFetch)(fetch(`${constants_1.RSC_PATHNAME}?state=` + encodeURIComponent(key)));
94
96
  }
@@ -75,26 +75,12 @@ function hydrogenMiddleware({ dev, cache, indexTemplate, getServerEntrypoint, de
75
75
  }
76
76
  }
77
77
  entrypointError = null;
78
- const eventResponse = await handleRequest(request, {
78
+ await handleRequest(request, {
79
79
  dev,
80
80
  cache,
81
81
  indexTemplate,
82
82
  streamableResponse: response,
83
83
  });
84
- /**
85
- * If a `Response` was returned, that means it was not streamed.
86
- * Convert the response into a proper Node.js response.
87
- */
88
- if (eventResponse) {
89
- eventResponse.headers.forEach((value, key) => {
90
- response.setHeader(key, value);
91
- });
92
- response.statusCode = eventResponse.status;
93
- if (eventResponse.body) {
94
- response.write(eventResponse.body);
95
- }
96
- response.end();
97
- }
98
84
  }
99
85
  catch (e) {
100
86
  if (dev && devServer)
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const vite_plugin_hydrogen_config_1 = __importDefault(require("./plugins/vite-plugin-hydrogen-config"));
7
7
  const vite_plugin_hydrogen_middleware_1 = __importDefault(require("./plugins/vite-plugin-hydrogen-middleware"));
8
8
  const vite_plugin_hydrogen_client_middleware_1 = __importDefault(require("./plugins/vite-plugin-hydrogen-client-middleware"));
9
+ const vite_plugin_hydrogen_virtual_files_1 = __importDefault(require("./plugins/vite-plugin-hydrogen-virtual-files"));
9
10
  const vite_plugin_platform_entry_1 = __importDefault(require("./plugins/vite-plugin-platform-entry"));
10
11
  const vite_plugin_hydrogen_rsc_1 = __importDefault(require("./plugins/vite-plugin-hydrogen-rsc"));
11
12
  const vite_plugin_ssr_interop_1 = __importDefault(require("./plugins/vite-plugin-ssr-interop"));
@@ -15,6 +16,7 @@ const vite_plugin_inspect_1 = __importDefault(require("vite-plugin-inspect"));
15
16
  const plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
16
17
  const vite_plugin_css_modules_rsc_1 = __importDefault(require("./plugins/vite-plugin-css-modules-rsc"));
17
18
  const vite_plugin_client_imports_1 = __importDefault(require("./plugins/vite-plugin-client-imports"));
19
+ const vite_plugin_hydrogen_suppress_warnings_1 = __importDefault(require("./plugins/vite-plugin-hydrogen-suppress-warnings"));
18
20
  exports.default = (pluginOptions = {}) => {
19
21
  return [
20
22
  process.env.VITE_INSPECT && (0, vite_plugin_inspect_1.default)(),
@@ -22,12 +24,14 @@ exports.default = (pluginOptions = {}) => {
22
24
  (0, vite_plugin_hydrogen_client_middleware_1.default)(),
23
25
  (0, vite_plugin_client_imports_1.default)(),
24
26
  (0, vite_plugin_hydrogen_middleware_1.default)(pluginOptions),
27
+ (0, vite_plugin_hydrogen_virtual_files_1.default)(pluginOptions),
25
28
  (0, plugin_react_1.default)(),
26
29
  (0, vite_plugin_hydration_auto_import_1.default)(),
27
30
  (0, vite_plugin_ssr_interop_1.default)(),
28
31
  (0, vite_plugin_css_modules_rsc_1.default)(),
29
32
  (0, vite_plugin_hydrogen_rsc_1.default)(),
30
33
  (0, vite_plugin_platform_entry_1.default)(),
34
+ (0, vite_plugin_hydrogen_suppress_warnings_1.default)(),
31
35
  pluginOptions.purgeQueryCacheOnBuild && (0, vite_plugin_purge_query_cache_1.default)(),
32
36
  ];
33
37
  };
@@ -1,9 +1,9 @@
1
1
  import { type Plugin } from 'vite';
2
- declare const _default: () => Plugin;
3
2
  /**
4
3
  * This dev server middleware prevents Vite from applying immutable cache control headers to client
5
4
  * components. These client components are part of the user's local source, but since they are
6
5
  * referenced via import globs in the `react-dom-server-vite` NPM package, Vite assumes they
7
6
  * are 3P deps that can be cached. This middleware responds to the requests early with `no-cache`.
8
7
  */
8
+ declare const _default: () => Plugin;
9
9
  export default _default;
@@ -14,7 +14,7 @@ exports.default = () => {
14
14
  format: 'es',
15
15
  };
16
16
  }
17
- if (!process.env.LOCAL_DEV) {
17
+ if (process.env.NODE_ENV !== 'development') {
18
18
  /**
19
19
  * Ofuscate production asset name - To prevent ad blocker logics that blocks
20
20
  * certain files due to how it is named.
@@ -84,11 +84,14 @@ exports.default = () => {
84
84
  'react-server-dom-vite/client-proxy',
85
85
  // https://github.com/vitejs/vite/issues/6215
86
86
  'react/jsx-runtime',
87
+ // https://github.com/nfriedly/set-cookie-parser/issues/50
88
+ 'set-cookie-parser',
87
89
  ],
88
90
  },
89
91
  define: {
90
- __DEV__: env.mode !== 'production',
91
- __WORKER__: isWorker,
92
+ __HYDROGEN_DEV__: env.mode !== 'production',
93
+ __HYDROGEN_WORKER__: isWorker,
94
+ __HYDROGEN_TEST__: false, // Used in unit tests
92
95
  },
93
96
  envPrefix: ['VITE_', 'PUBLIC_'],
94
97
  base: process.env.HYDROGEN_ASSET_BASE_URL,
@@ -10,16 +10,11 @@ const path_1 = __importDefault(require("path"));
10
10
  const fs_1 = require("fs");
11
11
  const middleware_1 = require("../middleware");
12
12
  const in_memory_1 = require("../cache/in-memory");
13
+ const vite_plugin_hydrogen_virtual_files_1 = require("./vite-plugin-hydrogen-virtual-files");
13
14
  exports.HYDROGEN_DEFAULT_SERVER_ENTRY = process.env.HYDROGEN_SERVER_ENTRY || '/src/App.server';
14
- const virtualModuleId = 'virtual:hydrogen-config';
15
- const virtualProxyModuleId = virtualModuleId + ':proxy';
16
15
  exports.default = (pluginOptions) => {
17
- let config;
18
16
  return {
19
- name: 'vite-plugin-hydrogen-middleware',
20
- configResolved(_config) {
21
- config = _config;
22
- },
17
+ name: 'hydrogen:middleware',
23
18
  /**
24
19
  * By adding a middleware to the Vite dev server, we can handle SSR without needing
25
20
  * a custom node script. It works by handling any requests for `text/html` documents,
@@ -39,7 +34,7 @@ exports.default = (pluginOptions) => {
39
34
  dev: true,
40
35
  getShopifyConfig: async (incomingMessage) => {
41
36
  var _a;
42
- const { default: hydrogenConfig } = await server.ssrLoadModule('virtual:hydrogen-config:proxy');
37
+ const { default: hydrogenConfig } = await server.ssrLoadModule(vite_plugin_hydrogen_virtual_files_1.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID);
43
38
  // @ts-ignore
44
39
  const { address = 'localhost', port = '3000' } = ((_a = server.httpServer) === null || _a === void 0 ? void 0 : _a.address()) || {};
45
40
  const url = new URL(`http://${address}:${port}${incomingMessage.url}`);
@@ -47,11 +42,10 @@ exports.default = (pluginOptions) => {
47
42
  headers: incomingMessage.headers,
48
43
  });
49
44
  // @ts-expect-error Manually set `normalizedUrl` which a developer expects to be available
50
- // via `ServerComponentRequest` during production runtime.
45
+ // via `HydrogenRequest` during production runtime.
51
46
  request.normalizedUrl = request.url;
52
- return typeof hydrogenConfig.shopify === 'function'
53
- ? hydrogenConfig.shopify(request)
54
- : hydrogenConfig.shopify;
47
+ const { shopify } = hydrogenConfig;
48
+ return typeof shopify === 'function' ? shopify(request) : shopify;
55
49
  },
56
50
  }));
57
51
  server.middlewares.use(body_parser_1.default.raw({ type: '*/*' }));
@@ -65,26 +59,6 @@ exports.default = (pluginOptions) => {
65
59
  : undefined,
66
60
  }));
67
61
  },
68
- async resolveId(source, importer) {
69
- if (source === virtualModuleId) {
70
- const configPath = await findHydrogenConfigPath(config.root, pluginOptions.configPath);
71
- return this.resolve(configPath, importer, {
72
- skipSelf: true,
73
- });
74
- }
75
- if (source === virtualProxyModuleId) {
76
- // Virtual modules convention
77
- // https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
78
- return '\0' + virtualProxyModuleId;
79
- }
80
- },
81
- async load(id) {
82
- if (id === '\0' + virtualProxyModuleId) {
83
- // Likely due to a bug in Vite, but the config cannot be loaded
84
- // directly using ssrLoadModule. It needs to be proxied as follows:
85
- return `import hc from 'virtual:hydrogen-config'; export default hc;`;
86
- }
87
- },
88
62
  };
89
63
  };
90
64
  async function polyfillOxygenEnv(config) {
@@ -99,18 +73,3 @@ async function polyfillOxygenEnv(config) {
99
73
  }
100
74
  globalThis.Oxygen = { env };
101
75
  }
102
- async function findHydrogenConfigPath(root, userProvidedPath) {
103
- let configPath = userProvidedPath;
104
- if (!configPath) {
105
- // Find the config file in the project root
106
- const files = await fs_1.promises.readdir(root);
107
- configPath = files.find((file) => /^hydrogen\.config\.[jt]s$/.test(file));
108
- }
109
- if (configPath) {
110
- configPath = (0, vite_1.normalizePath)(configPath);
111
- if (!configPath.startsWith('/'))
112
- configPath = path_1.default.resolve(root, configPath);
113
- }
114
- return (configPath ||
115
- require.resolve('@shopify/hydrogen/dist/esnext/utilities/empty-hydrogen-config.js'));
116
- }
@@ -6,9 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // @ts-ignore
7
7
  const plugin_1 = __importDefault(require("@shopify/hydrogen/vendor/react-server-dom-vite/plugin"));
8
8
  const vite_plugin_hydrogen_middleware_1 = require("./vite-plugin-hydrogen-middleware");
9
- const vite_1 = require("vite");
9
+ const vite_plugin_hydrogen_virtual_files_1 = require("./vite-plugin-hydrogen-virtual-files");
10
10
  function default_1() {
11
11
  return (0, plugin_1.default)({
12
+ serverBuildEntries: [
13
+ vite_plugin_hydrogen_middleware_1.HYDROGEN_DEFAULT_SERVER_ENTRY,
14
+ vite_plugin_hydrogen_virtual_files_1.VIRTUAL_PROXY_HYDROGEN_ROUTES_ID,
15
+ ],
12
16
  isServerComponentImporterAllowed(importer, source) {
13
17
  return (
14
18
  // Always allow the entry server (e.g. App.server.jsx) to be imported
@@ -19,23 +23,6 @@ function default_1() {
19
23
  // TODO: revisit this when RSC splits into two bundles
20
24
  /\.test\.[tj]sx?$/.test(importer));
21
25
  },
22
- async findClientComponentsForClientBuild() {
23
- // In client build, we create a local server to discover client compoents.
24
- const server = await (0, vite_1.createServer)({
25
- clearScreen: false,
26
- server: { middlewareMode: 'ssr' },
27
- });
28
- await Promise.all([
29
- // Load server entry to discover client components early
30
- server.ssrLoadModule(vite_plugin_hydrogen_middleware_1.HYDROGEN_DEFAULT_SERVER_ENTRY),
31
- // Route globs are placed in hydrogen.config.js and need to
32
- // be loaded to discover client components in routes
33
- server.ssrLoadModule('virtual:hydrogen-config:proxy'),
34
- ]);
35
- await server.close();
36
- // At this point, the server has loaded all the components in the module graph
37
- return plugin_1.default.findClientComponentsFromServer(server);
38
- },
39
26
  });
40
27
  }
41
28
  exports.default = default_1;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from 'vite';
2
+ declare const _default: () => Plugin;
3
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = () => {
4
+ return {
5
+ name: 'hydrogen:suppress-warnings',
6
+ configResolved(config) {
7
+ // TODO: Fix the actual issues that cause these warnings
8
+ const filterOut = (msg) => msg.startsWith("@shopify/hydrogen doesn't appear to be written in CJS") ||
9
+ (msg.includes('missing source files') &&
10
+ ['kolorist'].some((lib) => msg.includes(lib)));
11
+ for (const method of ['warn', 'warnOnce']) {
12
+ const original = config.logger[method];
13
+ config.logger[method] = (msg, ...args) => {
14
+ if (filterOut(msg))
15
+ return;
16
+ return original(msg, ...args);
17
+ };
18
+ }
19
+ },
20
+ };
21
+ };
@@ -0,0 +1,7 @@
1
+ import { Plugin } from 'vite';
2
+ import type { HydrogenVitePluginOptions } from '../../types';
3
+ export declare const HYDROGEN_DEFAULT_SERVER_ENTRY: string;
4
+ export declare const VIRTUAL_PROXY_HYDROGEN_CONFIG_ID: string;
5
+ export declare const VIRTUAL_PROXY_HYDROGEN_ROUTES_ID: string;
6
+ declare const _default: (pluginOptions: HydrogenVitePluginOptions) => Plugin;
7
+ export default _default;