@shopify/hydrogen 0.22.1 → 0.25.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 (445) hide show
  1. package/CHANGELOG.md +378 -0
  2. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +2 -5
  3. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +18 -17
  4. package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +14 -0
  5. package/dist/esnext/components/BaseButton/BaseButton.client.js +15 -0
  6. package/dist/esnext/components/BaseButton/index.d.ts +1 -0
  7. package/dist/esnext/components/BaseButton/index.js +1 -0
  8. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +2 -5
  9. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +5 -4
  10. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.js +4 -4
  11. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +5 -8
  12. package/dist/esnext/components/CartLineProvider/context.d.ts +10 -0
  13. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +4 -5
  14. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +16 -14
  15. package/dist/esnext/components/CartLines/{CartLines.d.ts → CartLines.client.d.ts} +0 -0
  16. package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +1 -1
  17. package/dist/esnext/components/CartLines/index.d.ts +1 -1
  18. package/dist/esnext/components/CartLines/index.js +1 -1
  19. package/dist/esnext/components/CartProvider/CartProvider.client.js +31 -38
  20. package/dist/esnext/components/CartProvider/cart-queries.d.ts +1 -1
  21. package/dist/esnext/components/CartProvider/cart-queries.js +11 -0
  22. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +11 -1
  23. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +11 -1
  24. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +11 -1
  25. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +11 -1
  26. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +11 -1
  27. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +11 -1
  28. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +11 -1
  29. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +11 -1
  30. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +11 -1
  31. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +11 -1
  32. package/dist/esnext/components/CartProvider/hooks.client.js +5 -8
  33. package/dist/esnext/components/CartProvider/types.d.ts +2 -0
  34. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +1 -1
  35. package/dist/esnext/components/Image/Image.d.ts +21 -0
  36. package/dist/esnext/components/Image/Image.js +88 -14
  37. package/dist/esnext/components/Link/Link.client.d.ts +2 -0
  38. package/dist/esnext/components/Link/Link.client.js +8 -5
  39. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +2 -2
  40. package/dist/esnext/components/Metafield/Metafield.client.d.ts +6 -10
  41. package/dist/esnext/components/Metafield/Metafield.client.js +67 -31
  42. package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +1 -1
  43. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +2 -3
  44. package/dist/esnext/components/Money/Money.client.js +1 -1
  45. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  46. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +133 -0
  47. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
  48. package/dist/esnext/components/{ProductProvider → ProductOptionsProvider}/context.js +0 -1
  49. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
  50. package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
  51. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -2
  52. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +10 -12
  53. package/dist/esnext/components/Seo/CollectionSeo.client.js +2 -3
  54. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +3 -3
  55. package/dist/esnext/components/Seo/NoIndexSeo.client.js +2 -2
  56. package/dist/esnext/components/Seo/PageSeo.client.js +2 -3
  57. package/dist/esnext/components/Seo/ProductSeo.client.js +9 -10
  58. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +2 -3
  59. package/dist/esnext/components/Video/Video.js +2 -3
  60. package/dist/esnext/components/index.d.ts +1 -1
  61. package/dist/esnext/components/index.js +1 -1
  62. package/dist/esnext/config.d.ts +4 -0
  63. package/dist/esnext/config.js +4 -0
  64. package/dist/esnext/constants.d.ts +2 -0
  65. package/dist/esnext/constants.js +2 -0
  66. package/dist/esnext/entry-client.js +107 -21
  67. package/dist/esnext/entry-server.d.ts +2 -31
  68. package/dist/esnext/entry-server.js +400 -335
  69. package/dist/esnext/foundation/Analytics/Analytics.client.js +15 -13
  70. package/dist/esnext/foundation/Analytics/Analytics.server.js +27 -20
  71. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  72. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +16 -14
  73. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +4 -0
  74. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +36 -0
  75. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +3 -0
  76. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +27 -0
  77. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +3 -0
  78. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +21 -0
  79. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
  80. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +190 -0
  81. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
  82. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +23 -0
  83. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +28 -0
  84. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +51 -0
  85. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
  86. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
  87. package/dist/esnext/foundation/Analytics/hook.js +4 -2
  88. package/dist/esnext/foundation/Analytics/utils.d.ts +2 -0
  89. package/dist/esnext/foundation/Analytics/utils.js +21 -0
  90. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +2 -0
  91. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +23 -0
  92. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.d.ts +1 -0
  93. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.js +3 -0
  94. package/dist/{node/framework → esnext/foundation/Cache}/cache-sub-request.d.ts +1 -1
  95. package/dist/esnext/{framework → foundation/Cache}/cache-sub-request.js +4 -4
  96. package/dist/esnext/{framework → foundation/Cache}/cache.d.ts +1 -1
  97. package/dist/esnext/{framework → foundation/Cache}/cache.js +4 -4
  98. package/dist/esnext/foundation/Cache/strategies/index.d.ts +7 -0
  99. package/dist/esnext/foundation/Cache/strategies/index.js +54 -0
  100. package/dist/esnext/foundation/Cookie/Cookie.d.ts +3 -3
  101. package/dist/esnext/foundation/Cookie/Cookie.js +5 -0
  102. package/dist/esnext/foundation/DevTools/DevTools.client.d.ts +3 -0
  103. package/dist/esnext/foundation/DevTools/DevTools.client.js +17 -0
  104. package/dist/esnext/foundation/DevTools/DevTools.server.d.ts +1 -0
  105. package/dist/esnext/foundation/DevTools/DevTools.server.js +14 -0
  106. package/dist/esnext/foundation/DevTools/components/GraphQL.client.d.ts +1 -0
  107. package/dist/esnext/foundation/DevTools/components/GraphQL.client.js +25 -0
  108. package/dist/esnext/foundation/DevTools/components/Heading.d.ts +5 -0
  109. package/dist/esnext/foundation/DevTools/components/Heading.js +12 -0
  110. package/dist/esnext/foundation/DevTools/components/Interface.client.d.ts +11 -0
  111. package/dist/esnext/foundation/DevTools/components/Interface.client.js +47 -0
  112. package/dist/esnext/foundation/DevTools/components/Panels.d.ts +8 -0
  113. package/dist/esnext/foundation/DevTools/components/Panels.js +60 -0
  114. package/dist/esnext/foundation/DevTools/components/Performance.client.d.ts +14 -0
  115. package/dist/esnext/foundation/DevTools/components/Performance.client.js +26 -0
  116. package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +7 -0
  117. package/dist/esnext/foundation/DevTools/components/Settings.client.js +20 -0
  118. package/dist/esnext/foundation/DevTools/components/Table.d.ts +9 -0
  119. package/dist/esnext/foundation/DevTools/components/Table.js +7 -0
  120. package/dist/esnext/foundation/DevTools/components/icons.d.ts +2 -0
  121. package/dist/esnext/foundation/DevTools/components/icons.js +13 -0
  122. package/dist/esnext/foundation/DevTools/components/index.d.ts +2 -0
  123. package/dist/esnext/foundation/DevTools/components/index.js +2 -0
  124. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +4 -4
  125. package/dist/{node/framework/Hydration → esnext/foundation/Html}/Html.d.ts +3 -1
  126. package/dist/esnext/{framework/Hydration → foundation/Html}/Html.js +15 -5
  127. package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.d.ts → foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +14 -4
  128. package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +70 -12
  129. package/dist/esnext/{framework/Hydration/ServerComponentResponse.server.d.ts → foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +6 -11
  130. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +48 -0
  131. package/dist/esnext/foundation/Router/BrowserRouter.client.js +15 -9
  132. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  133. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
  134. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +5 -6
  135. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +19 -24
  136. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +1 -1
  137. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +1 -1
  138. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +4 -5
  139. package/dist/esnext/foundation/fetchSync/server/fetchSync.js +1 -1
  140. package/dist/esnext/foundation/index.d.ts +1 -1
  141. package/dist/esnext/foundation/index.js +1 -1
  142. package/dist/esnext/foundation/runtime.d.ts +2 -0
  143. package/dist/esnext/foundation/runtime.js +6 -0
  144. package/dist/esnext/foundation/session/session.d.ts +3 -3
  145. package/dist/esnext/foundation/ssr-interop.d.ts +2 -2
  146. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +2 -0
  147. package/dist/esnext/foundation/useNavigate/useNavigate.js +10 -4
  148. package/dist/esnext/foundation/useQuery/hooks.d.ts +1 -0
  149. package/dist/esnext/foundation/useQuery/hooks.js +29 -18
  150. package/dist/esnext/foundation/useRequestContext/index.d.ts +15 -0
  151. package/dist/esnext/foundation/useRequestContext/index.js +23 -0
  152. package/dist/esnext/foundation/useServerProps/use-server-props.js +2 -2
  153. package/dist/esnext/foundation/useSession/useSession.js +1 -2
  154. package/dist/esnext/foundation/useUrl/useUrl.js +1 -2
  155. package/dist/esnext/framework/cache/in-memory.js +3 -3
  156. package/dist/esnext/framework/middleware.d.ts +1 -1
  157. package/dist/esnext/framework/middleware.js +3 -4
  158. package/dist/esnext/framework/plugin.d.ts +7 -3
  159. package/dist/esnext/framework/plugin.js +4 -1
  160. package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +1 -1
  161. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +70 -64
  162. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +1 -1
  163. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +3 -4
  164. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +5 -13
  165. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  166. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
  167. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +1 -1
  168. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +6 -4
  169. package/dist/esnext/framework/types.d.ts +5 -0
  170. package/dist/esnext/framework/types.js +1 -0
  171. package/dist/esnext/hooks/index.d.ts +0 -1
  172. package/dist/esnext/hooks/index.js +0 -1
  173. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +10 -0
  174. package/dist/esnext/hooks/useMoney/hooks.js +53 -39
  175. package/dist/esnext/hooks/useProductOptions/helpers.js +6 -10
  176. package/dist/esnext/hooks/useProductOptions/types.d.ts +17 -15
  177. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -15
  178. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +8 -107
  179. package/dist/esnext/hooks/useShopQuery/hooks.js +30 -18
  180. package/dist/esnext/index.d.ts +7 -5
  181. package/dist/esnext/index.js +5 -5
  182. package/dist/esnext/shared-types.d.ts +26 -0
  183. package/dist/esnext/shared-types.js +4 -0
  184. package/dist/esnext/storefront-api-types.d.ts +37 -443
  185. package/dist/esnext/streaming.server.d.ts +9 -19
  186. package/dist/esnext/streaming.server.js +2 -11
  187. package/dist/esnext/types.d.ts +40 -40
  188. package/dist/esnext/types.js +1 -1
  189. package/dist/esnext/utilities/apiRoutes.d.ts +8 -4
  190. package/dist/esnext/utilities/apiRoutes.js +6 -4
  191. package/dist/esnext/utilities/devtools.d.ts +1 -1
  192. package/dist/esnext/utilities/devtools.js +3 -3
  193. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +1 -0
  194. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +13 -6
  195. package/dist/esnext/utilities/graphql-tracker.js +7 -9
  196. package/dist/esnext/utilities/hash.d.ts +2 -2
  197. package/dist/esnext/utilities/hash.js +29 -6
  198. package/dist/esnext/utilities/image_size.d.ts +24 -3
  199. package/dist/esnext/utilities/image_size.js +53 -31
  200. package/dist/esnext/utilities/index.d.ts +2 -2
  201. package/dist/esnext/utilities/index.js +2 -2
  202. package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
  203. package/dist/esnext/utilities/isBrowser/index.js +1 -0
  204. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
  205. package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
  206. package/dist/esnext/utilities/isServer/isServer.js +2 -2
  207. package/dist/esnext/utilities/load_script.js +1 -1
  208. package/dist/esnext/utilities/log/index.d.ts +1 -1
  209. package/dist/esnext/utilities/log/index.js +1 -1
  210. package/dist/esnext/utilities/log/log-cache-api-status.js +3 -2
  211. package/dist/esnext/utilities/log/log-cache-header.d.ts +4 -4
  212. package/dist/esnext/utilities/log/log-query-timeline.d.ts +3 -3
  213. package/dist/esnext/utilities/log/log-query-timeline.js +29 -10
  214. package/dist/esnext/utilities/log/log.d.ts +17 -11
  215. package/dist/esnext/utilities/log/log.js +28 -20
  216. package/dist/esnext/utilities/log/utils.js +1 -6
  217. package/dist/esnext/utilities/parseMetafield/index.d.ts +1 -0
  218. package/dist/esnext/utilities/parseMetafield/index.js +1 -0
  219. package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +15 -0
  220. package/dist/esnext/utilities/{parseMetafieldValue/parseMetafieldValue.js → parseMetafield/parseMetafield.js} +28 -2
  221. package/dist/esnext/utilities/storefrontApi.js +9 -5
  222. package/dist/esnext/utilities/template.js +1 -2
  223. package/dist/esnext/utilities/web-api-polyfill.js +6 -0
  224. package/dist/esnext/version.d.ts +1 -1
  225. package/dist/esnext/version.js +1 -1
  226. package/dist/node/framework/cache/in-memory.js +3 -3
  227. package/dist/node/framework/middleware.d.ts +1 -1
  228. package/dist/node/framework/middleware.js +3 -4
  229. package/dist/node/framework/plugin.d.ts +4 -3
  230. package/dist/node/framework/plugin.js +5 -2
  231. package/dist/node/framework/plugins/vite-plugin-client-imports.js +1 -1
  232. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +70 -64
  233. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +1 -1
  234. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +3 -4
  235. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +6 -14
  236. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  237. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
  238. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +1 -1
  239. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +6 -4
  240. package/dist/node/framework/types.d.ts +5 -0
  241. package/dist/node/{foundation/Analytics → framework}/types.js +0 -0
  242. package/dist/node/shared-types.d.ts +26 -0
  243. package/dist/node/shared-types.js +5 -0
  244. package/dist/node/utilities/web-api-polyfill.js +6 -0
  245. package/package.json +34 -26
  246. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +275 -60
  247. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +119 -64
  248. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +33 -32
  249. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +241 -75
  250. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +38 -35
  251. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +9 -8
  252. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +3 -3
  253. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -9
  254. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +276 -61
  255. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +119 -64
  256. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +241 -75
  257. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +9 -8
  258. package/vendor/react-server-dom-vite/package.json +1 -1
  259. package/client.d.ts +0 -1
  260. package/client.js +0 -1
  261. package/config.d.ts +0 -1
  262. package/config.js +0 -1
  263. package/dist/esnext/components/DevTools.client.d.ts +0 -1
  264. package/dist/esnext/components/DevTools.client.js +0 -129
  265. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +0 -8
  266. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +0 -12
  267. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -24
  268. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -34
  269. package/dist/esnext/components/ProductProvider/context.d.ts +0 -29
  270. package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
  271. package/dist/esnext/components/ProductProvider/index.js +0 -2
  272. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.d.ts +0 -2
  273. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +0 -33
  274. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +0 -1
  275. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.js +0 -24
  276. package/dist/esnext/framework/CachingStrategy/index.d.ts +0 -10
  277. package/dist/esnext/framework/CachingStrategy/index.js +0 -96
  278. package/dist/esnext/framework/Hydration/Html.d.ts +0 -11
  279. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +0 -42
  280. package/dist/esnext/framework/Hydration/rsc.d.ts +0 -8
  281. package/dist/esnext/framework/Hydration/rsc.js +0 -100
  282. package/dist/esnext/framework/cache-sub-request.d.ts +0 -17
  283. package/dist/esnext/framework/config.d.ts +0 -6
  284. package/dist/esnext/framework/config.js +0 -6
  285. package/dist/esnext/framework/runtime.d.ts +0 -13
  286. package/dist/esnext/framework/runtime.js +0 -27
  287. package/dist/esnext/hooks/useParsedMetafields/index.d.ts +0 -1
  288. package/dist/esnext/hooks/useParsedMetafields/index.js +0 -1
  289. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +0 -21
  290. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.js +0 -21
  291. package/dist/esnext/hooks/useProduct/index.d.ts +0 -1
  292. package/dist/esnext/hooks/useProduct/index.js +0 -1
  293. package/dist/esnext/hooks/useProduct/useProduct.d.ts +0 -52
  294. package/dist/esnext/hooks/useProduct/useProduct.js +0 -43
  295. package/dist/esnext/utilities/isClient/index.d.ts +0 -1
  296. package/dist/esnext/utilities/isClient/index.js +0 -1
  297. package/dist/esnext/utilities/isClient/isClient.d.ts +0 -4
  298. package/dist/esnext/utilities/isClient/isClient.js +0 -6
  299. package/dist/esnext/utilities/parseMetafieldValue/index.d.ts +0 -1
  300. package/dist/esnext/utilities/parseMetafieldValue/index.js +0 -1
  301. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +0 -6
  302. package/dist/node/components/Image/Image.d.ts +0 -84
  303. package/dist/node/components/Image/Image.js +0 -89
  304. package/dist/node/components/Image/index.d.ts +0 -2
  305. package/dist/node/components/Image/index.js +0 -5
  306. package/dist/node/constants.d.ts +0 -7
  307. package/dist/node/constants.js +0 -10
  308. package/dist/node/entry-server.d.ts +0 -35
  309. package/dist/node/entry-server.js +0 -571
  310. package/dist/node/foundation/Analytics/Analytics.client.d.ts +0 -3
  311. package/dist/node/foundation/Analytics/Analytics.client.js +0 -32
  312. package/dist/node/foundation/Analytics/Analytics.server.d.ts +0 -1
  313. package/dist/node/foundation/Analytics/Analytics.server.js +0 -70
  314. package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +0 -25
  315. package/dist/node/foundation/Analytics/ClientAnalytics.js +0 -100
  316. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.d.ts +0 -2
  317. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +0 -37
  318. package/dist/node/foundation/Analytics/const.d.ts +0 -9
  319. package/dist/node/foundation/Analytics/const.js +0 -12
  320. package/dist/node/foundation/Analytics/hook.d.ts +0 -1
  321. package/dist/node/foundation/Analytics/hook.js +0 -11
  322. package/dist/node/foundation/Analytics/types.d.ts +0 -5
  323. package/dist/node/foundation/Analytics/utils.d.ts +0 -1
  324. package/dist/node/foundation/Analytics/utils.js +0 -12
  325. package/dist/node/foundation/AnalyticsErrorBoundary.client.d.ts +0 -4
  326. package/dist/node/foundation/AnalyticsErrorBoundary.client.js +0 -14
  327. package/dist/node/foundation/Redirect/Redirect.client.d.ts +0 -5
  328. package/dist/node/foundation/Redirect/Redirect.client.js +0 -18
  329. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +0 -14
  330. package/dist/node/foundation/Router/BrowserRouter.client.js +0 -159
  331. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +0 -40
  332. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +0 -90
  333. package/dist/node/foundation/ServerPropsProvider/index.d.ts +0 -2
  334. package/dist/node/foundation/ServerPropsProvider/index.js +0 -6
  335. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +0 -23
  336. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +0 -158
  337. package/dist/node/foundation/ServerRequestProvider/index.d.ts +0 -1
  338. package/dist/node/foundation/ServerRequestProvider/index.js +0 -17
  339. package/dist/node/foundation/ShopifyProvider/types.d.ts +0 -13
  340. package/dist/node/foundation/ShopifyProvider/types.js +0 -2
  341. package/dist/node/foundation/session/session.d.ts +0 -27
  342. package/dist/node/foundation/session/session.js +0 -43
  343. package/dist/node/foundation/ssr-interop.d.ts +0 -29
  344. package/dist/node/foundation/ssr-interop.js +0 -39
  345. package/dist/node/foundation/useNavigate/useNavigate.d.ts +0 -13
  346. package/dist/node/foundation/useNavigate/useNavigate.js +0 -18
  347. package/dist/node/foundation/useServerProps/use-server-props.d.ts +0 -21
  348. package/dist/node/foundation/useServerProps/use-server-props.js +0 -40
  349. package/dist/node/framework/CachingStrategy/index.d.ts +0 -10
  350. package/dist/node/framework/CachingStrategy/index.js +0 -108
  351. package/dist/node/framework/Hydration/Html.js +0 -94
  352. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +0 -58
  353. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +0 -150
  354. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +0 -26
  355. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +0 -49
  356. package/dist/node/framework/Hydration/rsc.d.ts +0 -8
  357. package/dist/node/framework/Hydration/rsc.js +0 -103
  358. package/dist/node/framework/cache-sub-request.js +0 -95
  359. package/dist/node/framework/cache.d.ts +0 -17
  360. package/dist/node/framework/cache.js +0 -135
  361. package/dist/node/framework/config.d.ts +0 -6
  362. package/dist/node/framework/config.js +0 -11
  363. package/dist/node/framework/runtime.d.ts +0 -13
  364. package/dist/node/framework/runtime.js +0 -35
  365. package/dist/node/storefront-api-types.d.ts +0 -6405
  366. package/dist/node/storefront-api-types.js +0 -1766
  367. package/dist/node/streaming.server.d.ts +0 -26
  368. package/dist/node/streaming.server.js +0 -33
  369. package/dist/node/types.d.ts +0 -105
  370. package/dist/node/types.js +0 -2
  371. package/dist/node/utilities/apiRoutes.d.ts +0 -37
  372. package/dist/node/utilities/apiRoutes.js +0 -157
  373. package/dist/node/utilities/bot-ua.d.ts +0 -4
  374. package/dist/node/utilities/bot-ua.js +0 -65
  375. package/dist/node/utilities/defer.d.ts +0 -6
  376. package/dist/node/utilities/defer.js +0 -18
  377. package/dist/node/utilities/error.d.ts +0 -1
  378. package/dist/node/utilities/error.js +0 -10
  379. package/dist/node/utilities/fetch.d.ts +0 -9
  380. package/dist/node/utilities/fetch.js +0 -37
  381. package/dist/node/utilities/flattenConnection/flattenConnection.d.ts +0 -6
  382. package/dist/node/utilities/flattenConnection/flattenConnection.js +0 -15
  383. package/dist/node/utilities/flattenConnection/index.d.ts +0 -1
  384. package/dist/node/utilities/flattenConnection/index.js +0 -5
  385. package/dist/node/utilities/hash.d.ts +0 -2
  386. package/dist/node/utilities/hash.js +0 -11
  387. package/dist/node/utilities/html-encoding.d.ts +0 -1
  388. package/dist/node/utilities/html-encoding.js +0 -12
  389. package/dist/node/utilities/image_size.d.ts +0 -12
  390. package/dist/node/utilities/image_size.js +0 -68
  391. package/dist/node/utilities/index.d.ts +0 -12
  392. package/dist/node/utilities/index.js +0 -33
  393. package/dist/node/utilities/isClient/index.d.ts +0 -1
  394. package/dist/node/utilities/isClient/index.js +0 -5
  395. package/dist/node/utilities/isClient/isClient.d.ts +0 -4
  396. package/dist/node/utilities/isClient/isClient.js +0 -10
  397. package/dist/node/utilities/isServer/index.d.ts +0 -1
  398. package/dist/node/utilities/isServer/index.js +0 -5
  399. package/dist/node/utilities/isServer/isServer.d.ts +0 -4
  400. package/dist/node/utilities/isServer/isServer.js +0 -11
  401. package/dist/node/utilities/load_script.d.ts +0 -3
  402. package/dist/node/utilities/load_script.js +0 -27
  403. package/dist/node/utilities/log/index.d.ts +0 -4
  404. package/dist/node/utilities/log/index.js +0 -18
  405. package/dist/node/utilities/log/log-cache-api-status.d.ts +0 -1
  406. package/dist/node/utilities/log/log-cache-api-status.js +0 -17
  407. package/dist/node/utilities/log/log-cache-header.d.ts +0 -10
  408. package/dist/node/utilities/log/log-cache-header.js +0 -35
  409. package/dist/node/utilities/log/log-query-timeline.d.ts +0 -12
  410. package/dist/node/utilities/log/log-query-timeline.js +0 -88
  411. package/dist/node/utilities/log/log.d.ts +0 -22
  412. package/dist/node/utilities/log/log.js +0 -74
  413. package/dist/node/utilities/log/utils.d.ts +0 -3
  414. package/dist/node/utilities/log/utils.js +0 -21
  415. package/dist/node/utilities/matchPath.d.ts +0 -10
  416. package/dist/node/utilities/matchPath.js +0 -58
  417. package/dist/node/utilities/measurement.d.ts +0 -3
  418. package/dist/node/utilities/measurement.js +0 -103
  419. package/dist/node/utilities/parse.d.ts +0 -1
  420. package/dist/node/utilities/parse.js +0 -13
  421. package/dist/node/utilities/parseMetafieldValue/index.d.ts +0 -1
  422. package/dist/node/utilities/parseMetafieldValue/index.js +0 -5
  423. package/dist/node/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +0 -6
  424. package/dist/node/utilities/parseMetafieldValue/parseMetafieldValue.js +0 -40
  425. package/dist/node/utilities/storefrontApi.d.ts +0 -4
  426. package/dist/node/utilities/storefrontApi.js +0 -26
  427. package/dist/node/utilities/suspense.d.ts +0 -12
  428. package/dist/node/utilities/suspense.js +0 -64
  429. package/dist/node/utilities/template.d.ts +0 -9
  430. package/dist/node/utilities/template.js +0 -27
  431. package/dist/node/utilities/timing.d.ts +0 -7
  432. package/dist/node/utilities/timing.js +0 -18
  433. package/dist/node/utilities/video_parameters.d.ts +0 -47
  434. package/dist/node/utilities/video_parameters.js +0 -27
  435. package/dist/node/version.d.ts +0 -1
  436. package/dist/node/version.js +0 -4
  437. package/entry-client.d.ts +0 -1
  438. package/entry-client.js +0 -1
  439. package/entry-server.d.ts +0 -1
  440. package/entry-server.js +0 -1
  441. package/middleware.d.ts +0 -1
  442. package/middleware.js +0 -1
  443. package/plugin.d.ts +0 -1
  444. package/plugin.js +0 -1
  445. package/web-polyfills.js +0 -1
@@ -15,6 +15,9 @@ if (process.env.NODE_ENV !== "production") {
15
15
  'use strict';
16
16
 
17
17
  var React = require('react');
18
+ var util = require('util');
19
+
20
+ var assign = Object.assign;
18
21
 
19
22
  var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
20
23
 
@@ -67,31 +70,144 @@ function flushBuffered(destination) {
67
70
  destination.flush();
68
71
  }
69
72
  }
73
+ var VIEW_SIZE = 2048;
74
+ var currentView = null;
75
+ var writtenBytes = 0;
76
+ var destinationHasCapacity = true;
70
77
  function beginWriting(destination) {
71
- // Older Node streams like http.createServer don't have this.
72
- if (typeof destination.cork === 'function') {
73
- destination.cork();
78
+ currentView = new Uint8Array(VIEW_SIZE);
79
+ writtenBytes = 0;
80
+ destinationHasCapacity = true;
81
+ }
82
+
83
+ function writeStringChunk(destination, stringChunk) {
84
+ if (stringChunk.length === 0) {
85
+ return;
86
+ } // maximum possible view needed to encode entire string
87
+
88
+
89
+ if (stringChunk.length * 3 > VIEW_SIZE) {
90
+ if (writtenBytes > 0) {
91
+ writeToDestination(destination, currentView.subarray(0, writtenBytes));
92
+ currentView = new Uint8Array(VIEW_SIZE);
93
+ writtenBytes = 0;
94
+ }
95
+
96
+ writeToDestination(destination, textEncoder.encode(stringChunk));
97
+ return;
98
+ }
99
+
100
+ var target = currentView;
101
+
102
+ if (writtenBytes > 0) {
103
+ target = currentView.subarray(writtenBytes);
104
+ }
105
+
106
+ var _textEncoder$encodeIn = textEncoder.encodeInto(stringChunk, target),
107
+ read = _textEncoder$encodeIn.read,
108
+ written = _textEncoder$encodeIn.written;
109
+
110
+ writtenBytes += written;
111
+
112
+ if (read < stringChunk.length) {
113
+ writeToDestination(destination, currentView);
114
+ currentView = new Uint8Array(VIEW_SIZE);
115
+ writtenBytes = textEncoder.encodeInto(stringChunk.slice(read), currentView).written;
116
+ }
117
+
118
+ if (writtenBytes === VIEW_SIZE) {
119
+ writeToDestination(destination, currentView);
120
+ currentView = new Uint8Array(VIEW_SIZE);
121
+ writtenBytes = 0;
122
+ }
123
+ }
124
+
125
+ function writeViewChunk(destination, chunk) {
126
+ if (chunk.byteLength === 0) {
127
+ return;
128
+ }
129
+
130
+ if (chunk.byteLength > VIEW_SIZE) {
131
+ // this chunk may overflow a single view which implies it was not
132
+ // one that is cached by the streaming renderer. We will enqueu
133
+ // it directly and expect it is not re-used
134
+ if (writtenBytes > 0) {
135
+ writeToDestination(destination, currentView.subarray(0, writtenBytes));
136
+ currentView = new Uint8Array(VIEW_SIZE);
137
+ writtenBytes = 0;
138
+ }
139
+
140
+ writeToDestination(destination, chunk);
141
+ return;
142
+ }
143
+
144
+ var bytesToWrite = chunk;
145
+ var allowableBytes = currentView.length - writtenBytes;
146
+
147
+ if (allowableBytes < bytesToWrite.byteLength) {
148
+ // this chunk would overflow the current view. We enqueue a full view
149
+ // and start a new view with the remaining chunk
150
+ if (allowableBytes === 0) {
151
+ // the current view is already full, send it
152
+ writeToDestination(destination, currentView);
153
+ } else {
154
+ // fill up the current view and apply the remaining chunk bytes
155
+ // to a new view.
156
+ currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes);
157
+ writtenBytes += allowableBytes;
158
+ writeToDestination(destination, currentView);
159
+ bytesToWrite = bytesToWrite.subarray(allowableBytes);
160
+ }
161
+
162
+ currentView = new Uint8Array(VIEW_SIZE);
163
+ writtenBytes = 0;
164
+ }
165
+
166
+ currentView.set(bytesToWrite, writtenBytes);
167
+ writtenBytes += bytesToWrite.byteLength;
168
+
169
+ if (writtenBytes === VIEW_SIZE) {
170
+ writeToDestination(destination, currentView);
171
+ currentView = new Uint8Array(VIEW_SIZE);
172
+ writtenBytes = 0;
74
173
  }
75
174
  }
76
- function writeChunkAndReturn(destination, chunk) {
77
- var nodeBuffer = chunk; // close enough
78
175
 
79
- return destination.write(nodeBuffer);
176
+ function writeChunk(destination, chunk) {
177
+ if (typeof chunk === 'string') {
178
+ writeStringChunk(destination, chunk);
179
+ } else {
180
+ writeViewChunk(destination, chunk);
181
+ }
182
+ }
183
+
184
+ function writeToDestination(destination, view) {
185
+ var currentHasCapacity = destination.write(view);
186
+ destinationHasCapacity = destinationHasCapacity && currentHasCapacity;
187
+ }
188
+
189
+ function writeChunkAndReturn(destination, chunk) {
190
+ writeChunk(destination, chunk);
191
+ return destinationHasCapacity;
80
192
  }
81
193
  function completeWriting(destination) {
82
- // Older Node streams like http.createServer don't have this.
83
- if (typeof destination.uncork === 'function') {
84
- destination.uncork();
194
+ if (currentView && writtenBytes > 0) {
195
+ destination.write(currentView.subarray(0, writtenBytes));
85
196
  }
197
+
198
+ currentView = null;
199
+ writtenBytes = 0;
200
+ destinationHasCapacity = true;
86
201
  }
87
202
  function close(destination) {
88
203
  destination.end();
89
204
  }
205
+ var textEncoder = new util.TextEncoder();
90
206
  function stringToChunk(content) {
91
207
  return content;
92
208
  }
93
209
  function stringToPrecomputedChunk(content) {
94
- return Buffer.from(content, 'utf8');
210
+ return textEncoder.encode(content);
95
211
  }
96
212
  function closeWithError(destination, error) {
97
213
  // $FlowFixMe: This is an Error object or the destination accepts other types.
@@ -136,13 +252,15 @@ function processSymbolChunk(request, id, name) {
136
252
  // eslint-disable-next-line no-unused-vars
137
253
  var MODULE_TAG = Symbol.for('react.module.reference');
138
254
  function getModuleKey(reference) {
255
+ if (typeof reference === 'string') reference = globalThis.__STRING_REFERENCE_INDEX[reference];
139
256
  return reference.filepath + '#' + reference.name;
140
257
  }
141
- function getModuleReference(reference) {
142
- if (typeof reference === 'string') return globalThis.__STRING_REFERENCE_INDEX[reference];
143
- return reference && reference.$$typeof === MODULE_TAG ? reference : undefined;
258
+ function isModuleReference(reference) {
259
+ if (typeof reference === 'string') return !!globalThis.__STRING_REFERENCE_INDEX[reference];
260
+ return reference.$$typeof === MODULE_TAG;
144
261
  }
145
262
  function resolveModuleMetaData(config, moduleReference) {
263
+ if (typeof moduleReference === 'string') moduleReference = globalThis.__STRING_REFERENCE_INDEX[moduleReference];
146
264
  return {
147
265
  id: moduleReference.filepath,
148
266
  name: moduleReference.name
@@ -458,7 +576,7 @@ var startInlineScript = stringToPrecomputedChunk('<script>');
458
576
  var endInlineScript = stringToPrecomputedChunk('</script>');
459
577
  var startScriptSrc = stringToPrecomputedChunk('<script src="');
460
578
  var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
461
- var endAsyncScript = stringToPrecomputedChunk('" async=""></script>'); // Allows us to keep track of what we've already written so we can refer back to it.
579
+ var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
462
580
 
463
581
  var textSeparator = stringToPrecomputedChunk('<!-- -->');
464
582
 
@@ -493,6 +611,12 @@ var startPendingSuspenseBoundary1 = stringToPrecomputedChunk('<!--$?--><template
493
611
  var startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
494
612
  var startClientRenderedSuspenseBoundary = stringToPrecomputedChunk('<!--$!-->');
495
613
  var endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
614
+ var clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk('<template');
615
+ var clientRenderedSuspenseBoundaryErrorAttrInterstitial = stringToPrecomputedChunk('"');
616
+ var clientRenderedSuspenseBoundaryError1A = stringToPrecomputedChunk(' data-dgst="');
617
+ var clientRenderedSuspenseBoundaryError1B = stringToPrecomputedChunk(' data-msg="');
618
+ var clientRenderedSuspenseBoundaryError1C = stringToPrecomputedChunk(' data-stck="');
619
+ var clientRenderedSuspenseBoundaryError2 = stringToPrecomputedChunk('></template>');
496
620
  var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="');
497
621
  var startSegmentHTML2 = stringToPrecomputedChunk('">');
498
622
  var endSegmentHTML = stringToPrecomputedChunk('</div>');
@@ -522,7 +646,7 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
522
646
  // const SUSPENSE_PENDING_START_DATA = '$?';
523
647
  // const SUSPENSE_FALLBACK_START_DATA = '$!';
524
648
  //
525
- // function clientRenderBoundary(suspenseBoundaryID) {
649
+ // function clientRenderBoundary(suspenseBoundaryID, errorDigest, errorMsg, errorComponentStack) {
526
650
  // // Find the fallback's first element.
527
651
  // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
528
652
  // if (!suspenseIdNode) {
@@ -534,6 +658,11 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
534
658
  // const suspenseNode = suspenseIdNode.previousSibling;
535
659
  // // Tag it to be client rendered.
536
660
  // suspenseNode.data = SUSPENSE_FALLBACK_START_DATA;
661
+ // // assign error metadata to first sibling
662
+ // let dataset = suspenseIdNode.dataset;
663
+ // if (errorDigest) dataset.dgst = errorDigest;
664
+ // if (errorMsg) dataset.msg = errorMsg;
665
+ // if (errorComponentStack) dataset.stck = errorComponentStack;
537
666
  // // Tell React to retry it if the parent already hydrated.
538
667
  // if (suspenseNode._reactRetry) {
539
668
  // suspenseNode._reactRetry();
@@ -617,7 +746,7 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
617
746
 
618
747
  var completeSegmentFunction = 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}';
619
748
  var completeBoundaryFunction = 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}';
620
- var clientRenderFunction = 'function $RX(a){if(a=document.getElementById(a))a=a.previousSibling,a.data="$!",a._reactRetry&&a._reactRetry()}';
749
+ var clientRenderFunction = 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())}';
621
750
  var completeSegmentScript1Full = stringToPrecomputedChunk(completeSegmentFunction + ';$RS("');
622
751
  var completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("');
623
752
  var completeSegmentScript2 = stringToPrecomputedChunk('","');
@@ -628,7 +757,9 @@ var completeBoundaryScript2 = stringToPrecomputedChunk('","');
628
757
  var completeBoundaryScript3 = stringToPrecomputedChunk('")</script>');
629
758
  var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX("');
630
759
  var clientRenderScript1Partial = stringToPrecomputedChunk('$RX("');
631
- var clientRenderScript2 = stringToPrecomputedChunk('")</script>');
760
+ var clientRenderScript1A = stringToPrecomputedChunk('"');
761
+ var clientRenderScript2 = stringToPrecomputedChunk(')</script>');
762
+ var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');
632
763
 
633
764
  var rendererSigil;
634
765
 
@@ -820,6 +951,14 @@ function readContext(context) {
820
951
  return value;
821
952
  }
822
953
 
954
+ var currentRequest = null;
955
+ function prepareToUseHooksForRequest(request) {
956
+ currentRequest = request;
957
+ }
958
+ function resetHooksForRequest() {
959
+ currentRequest = null;
960
+ }
961
+
823
962
  function readContext$1(context) {
824
963
  {
825
964
  if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
@@ -868,7 +1007,7 @@ var Dispatcher = {
868
1007
  useLayoutEffect: unsupportedHook,
869
1008
  useImperativeHandle: unsupportedHook,
870
1009
  useEffect: unsupportedHook,
871
- useId: unsupportedHook,
1010
+ useId: useId,
872
1011
  useMutableSource: unsupportedHook,
873
1012
  useSyncExternalStore: unsupportedHook,
874
1013
  useCacheRefresh: function () {
@@ -895,6 +1034,16 @@ function getCurrentCache() {
895
1034
  return currentCache;
896
1035
  }
897
1036
 
1037
+ function useId() {
1038
+ if (currentRequest === null) {
1039
+ throw new Error('useId can only be used while React is rendering');
1040
+ }
1041
+
1042
+ var id = currentRequest.identifierCount++; // use 'S' for Flight components to distinguish from 'R' and 'r' in Fizz/Client
1043
+
1044
+ return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
1045
+ }
1046
+
898
1047
  var ContextRegistry = ReactSharedInternals.ContextRegistry;
899
1048
  function getOrCreateServerContext(globalName) {
900
1049
  if (!ContextRegistry[globalName]) {
@@ -913,7 +1062,7 @@ function defaultErrorHandler(error) {
913
1062
  var OPEN = 0;
914
1063
  var CLOSING = 1;
915
1064
  var CLOSED = 2;
916
- function createRequest(model, bundlerConfig, onError, context) {
1065
+ function createRequest(model, bundlerConfig, onError, context, identifierPrefix) {
917
1066
  var pingedSegments = [];
918
1067
  var request = {
919
1068
  status: OPEN,
@@ -930,6 +1079,8 @@ function createRequest(model, bundlerConfig, onError, context) {
930
1079
  writtenSymbols: new Map(),
931
1080
  writtenModules: new Map(),
932
1081
  writtenProviders: new Map(),
1082
+ identifierPrefix: identifierPrefix || '',
1083
+ identifierCount: 1,
933
1084
  onError: onError === undefined ? defaultErrorHandler : onError,
934
1085
  toJSON: function (key, value) {
935
1086
  return resolveModelToJSON(request, this, key, value);
@@ -956,13 +1107,13 @@ function attemptResolveElement(type, key, ref, props) {
956
1107
  throw new Error('Refs cannot be used in server components, nor passed to client components.');
957
1108
  }
958
1109
 
959
- if (getModuleReference(type)) {
960
- // This is a reference to a client component.
961
- return [REACT_ELEMENT_TYPE, type, key, props];
962
- }
963
-
964
1110
  if (typeof type === 'function') {
965
- // This is a server-side component.
1111
+ if (isModuleReference(type)) {
1112
+ // This is a reference to a client component.
1113
+ return [REACT_ELEMENT_TYPE, type, key, props];
1114
+ } // This is a server-side component.
1115
+
1116
+
966
1117
  return type(props);
967
1118
  } else if (typeof type === 'string') {
968
1119
  // This is a host element. E.g. HTML.
@@ -980,6 +1131,11 @@ function attemptResolveElement(type, key, ref, props) {
980
1131
 
981
1132
  return [REACT_ELEMENT_TYPE, type, key, props];
982
1133
  } else if (type != null && typeof type === 'object') {
1134
+ if (isModuleReference(type)) {
1135
+ // This is a reference to a client component.
1136
+ return [REACT_ELEMENT_TYPE, type, key, props];
1137
+ }
1138
+
983
1139
  switch (type.$$typeof) {
984
1140
  case REACT_LAZY_TYPE:
985
1141
  {
@@ -1306,59 +1462,56 @@ function resolveModelToJSON(request, parent, key, value) {
1306
1462
  }
1307
1463
  }
1308
1464
 
1309
- if (value === null) {
1310
- return null;
1465
+ if (value == null) {
1466
+ return value;
1311
1467
  }
1312
1468
 
1313
- var moduleReference = getModuleReference(value);
1314
-
1315
- if (moduleReference) {
1316
- var moduleKey = getModuleKey(moduleReference);
1317
- var writtenModules = request.writtenModules;
1318
- var existingId = writtenModules.get(moduleKey);
1319
-
1320
- if (existingId !== undefined) {
1321
- if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1322
- // If we're encoding the "type" of an element, we can refer
1323
- // to that by a lazy reference instead of directly since React
1324
- // knows how to deal with lazy values. This lets us suspend
1325
- // on this component rather than its parent until the code has
1326
- // loaded.
1327
- return serializeByRefID(existingId);
1328
- }
1329
-
1330
- return serializeByValueID(existingId);
1331
- }
1469
+ if (typeof value === 'object' || isModuleReference(value)) {
1470
+ if (isModuleReference(value)) {
1471
+ var moduleReference = value;
1472
+ var moduleKey = getModuleKey(moduleReference);
1473
+ var writtenModules = request.writtenModules;
1474
+ var existingId = writtenModules.get(moduleKey);
1475
+
1476
+ if (existingId !== undefined) {
1477
+ if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1478
+ // If we're encoding the "type" of an element, we can refer
1479
+ // to that by a lazy reference instead of directly since React
1480
+ // knows how to deal with lazy values. This lets us suspend
1481
+ // on this component rather than its parent until the code has
1482
+ // loaded.
1483
+ return serializeByRefID(existingId);
1484
+ }
1332
1485
 
1333
- try {
1334
- var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
1335
- request.pendingChunks++;
1336
- var moduleId = request.nextChunkId++;
1337
- emitModuleChunk(request, moduleId, moduleMetaData);
1338
- writtenModules.set(moduleKey, moduleId);
1339
-
1340
- if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1341
- // If we're encoding the "type" of an element, we can refer
1342
- // to that by a lazy reference instead of directly since React
1343
- // knows how to deal with lazy values. This lets us suspend
1344
- // on this component rather than its parent until the code has
1345
- // loaded.
1346
- return serializeByRefID(moduleId);
1486
+ return serializeByValueID(existingId);
1347
1487
  }
1348
1488
 
1349
- return serializeByValueID(moduleId);
1350
- } catch (x) {
1351
- request.pendingChunks++;
1489
+ try {
1490
+ var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
1491
+ request.pendingChunks++;
1492
+ var moduleId = request.nextChunkId++;
1493
+ emitModuleChunk(request, moduleId, moduleMetaData);
1494
+ writtenModules.set(moduleKey, moduleId);
1495
+
1496
+ if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1497
+ // If we're encoding the "type" of an element, we can refer
1498
+ // to that by a lazy reference instead of directly since React
1499
+ // knows how to deal with lazy values. This lets us suspend
1500
+ // on this component rather than its parent until the code has
1501
+ // loaded.
1502
+ return serializeByRefID(moduleId);
1503
+ }
1352
1504
 
1353
- var _errorId = request.nextChunkId++;
1505
+ return serializeByValueID(moduleId);
1506
+ } catch (x) {
1507
+ request.pendingChunks++;
1354
1508
 
1355
- emitErrorChunk(request, _errorId, x);
1356
- return serializeByValueID(_errorId);
1357
- }
1358
- }
1509
+ var _errorId = request.nextChunkId++;
1359
1510
 
1360
- if (typeof value === 'object') {
1361
- if (value.$$typeof === REACT_PROVIDER_TYPE) {
1511
+ emitErrorChunk(request, _errorId, x);
1512
+ return serializeByValueID(_errorId);
1513
+ }
1514
+ } else if (value.$$typeof === REACT_PROVIDER_TYPE) {
1362
1515
  var providerKey = value._context._globalName;
1363
1516
  var writtenProviders = request.writtenProviders;
1364
1517
  var providerId = writtenProviders.get(key);
@@ -1387,7 +1540,7 @@ function resolveModelToJSON(request, parent, key, value) {
1387
1540
  // Verify that this is a simple plain object.
1388
1541
  if (objectName(value) !== 'Object') {
1389
1542
  error('Only plain objects can be passed to client components from server components. ' + 'Built-ins like %s are not supported. ' + 'Remove %s from these props: %s', objectName(value), describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
1390
- } else if (!isSimpleObject(value)) {
1543
+ } else if (typeof value === 'object' && !isSimpleObject(value)) {
1391
1544
  error('Only plain objects can be passed to client components from server components. ' + 'Classes or other objects with methods are not supported. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
1392
1545
  } else if (Object.getOwnPropertySymbols) {
1393
1546
  var symbols = Object.getOwnPropertySymbols(value);
@@ -1540,6 +1693,7 @@ function performWork(request) {
1540
1693
  var prevCache = getCurrentCache();
1541
1694
  ReactCurrentDispatcher.current = Dispatcher;
1542
1695
  setCurrentCache(request.cache);
1696
+ prepareToUseHooksForRequest(request);
1543
1697
 
1544
1698
  try {
1545
1699
  var pingedSegments = request.pingedSegments;
@@ -1559,11 +1713,12 @@ function performWork(request) {
1559
1713
  } finally {
1560
1714
  ReactCurrentDispatcher.current = prevDispatcher;
1561
1715
  setCurrentCache(prevCache);
1716
+ resetHooksForRequest();
1562
1717
  }
1563
1718
  }
1564
1719
 
1565
1720
  function flushCompletedChunks(request, destination) {
1566
- beginWriting(destination);
1721
+ beginWriting();
1567
1722
 
1568
1723
  try {
1569
1724
  // We emit module chunks first in the stream so that
@@ -1692,9 +1847,20 @@ function createDrainHandler(destination, request) {
1692
1847
  };
1693
1848
  }
1694
1849
 
1695
- function renderToPipeableStream(model, options, context) {
1696
- var request = createRequest(model, {}, // Manifest, not used
1697
- options ? options.onError : undefined, context);
1850
+ function renderToPipeableStream(model, options) {
1851
+ var request = createRequest( // Wrap root in a dummy element that simply adds a flag
1852
+ // to the current dispatcher to check later in the proxies.
1853
+ assign({}, model, {
1854
+ $$typeof: Symbol.for('react.element'),
1855
+ props: {
1856
+ children: model
1857
+ },
1858
+ type: function () {
1859
+ React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher.current.isRsc = true;
1860
+ return model;
1861
+ }
1862
+ }), {}, // Manifest, not used
1863
+ options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
1698
1864
  var hasStartedFlowing = false;
1699
1865
  startWork(request);
1700
1866
  return {