@shopify/hydrogen 1.6.5 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (645) hide show
  1. package/dist/{node/framework → build}/graphiql.js +21 -10
  2. package/dist/build/index.cjs +133 -0
  3. package/dist/build/index.cjs.map +1 -0
  4. package/dist/build/index.d.ts +6 -0
  5. package/dist/build/index.js +131 -0
  6. package/dist/build/index.js.map +1 -0
  7. package/dist/development/index.cjs +632 -0
  8. package/dist/development/index.cjs.map +1 -0
  9. package/dist/development/index.js +619 -0
  10. package/dist/development/index.js.map +1 -0
  11. package/dist/index.cjs +1 -0
  12. package/dist/production/index.cjs +32 -0
  13. package/dist/production/index.cjs.map +1 -0
  14. package/dist/production/index.d.ts +215 -0
  15. package/dist/production/index.js +19 -0
  16. package/dist/production/index.js.map +1 -0
  17. package/dist/templates/[route-manifest.json].jsx +41 -0
  18. package/dist/templates/admin.jsx +16 -0
  19. package/package.json +42 -145
  20. package/src/templates/routes/[route-manifest.json].tsx +54 -0
  21. package/src/templates/routes/admin.tsx +15 -0
  22. package/README.md +0 -29
  23. package/dist/esnext/FileSessionStorage.d.ts +0 -1
  24. package/dist/esnext/FileSessionStorage.js +0 -1
  25. package/dist/esnext/client.d.ts +0 -16
  26. package/dist/esnext/client.js +0 -16
  27. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +0 -23
  28. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +0 -49
  29. package/dist/esnext/components/AddToCartButton/index.d.ts +0 -1
  30. package/dist/esnext/components/AddToCartButton/index.js +0 -1
  31. package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +0 -16
  32. package/dist/esnext/components/BaseButton/BaseButton.client.js +0 -16
  33. package/dist/esnext/components/BaseButton/index.d.ts +0 -1
  34. package/dist/esnext/components/BaseButton/index.js +0 -1
  35. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +0 -16
  36. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +0 -27
  37. package/dist/esnext/components/BuyNowButton/index.d.ts +0 -1
  38. package/dist/esnext/components/BuyNowButton/index.js +0 -1
  39. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +0 -11
  40. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +0 -17
  41. package/dist/esnext/components/CartCheckoutButton/index.d.ts +0 -1
  42. package/dist/esnext/components/CartCheckoutButton/index.js +0 -1
  43. package/dist/esnext/components/CartCost/CartCost.client.d.ts +0 -14
  44. package/dist/esnext/components/CartCost/CartCost.client.js +0 -29
  45. package/dist/esnext/components/CartCost/index.d.ts +0 -1
  46. package/dist/esnext/components/CartCost/index.js +0 -1
  47. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +0 -9
  48. package/dist/esnext/components/CartLineImage/CartLineImage.client.js +0 -11
  49. package/dist/esnext/components/CartLineImage/index.d.ts +0 -1
  50. package/dist/esnext/components/CartLineImage/index.js +0 -1
  51. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +0 -12
  52. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +0 -18
  53. package/dist/esnext/components/CartLinePrice/index.d.ts +0 -1
  54. package/dist/esnext/components/CartLinePrice/index.js +0 -1
  55. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +0 -8
  56. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +0 -12
  57. package/dist/esnext/components/CartLineProductTitle/index.d.ts +0 -1
  58. package/dist/esnext/components/CartLineProductTitle/index.js +0 -1
  59. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +0 -11
  60. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +0 -8
  61. package/dist/esnext/components/CartLineProvider/context.d.ts +0 -36
  62. package/dist/esnext/components/CartLineProvider/context.js +0 -2
  63. package/dist/esnext/components/CartLineProvider/index.d.ts +0 -2
  64. package/dist/esnext/components/CartLineProvider/index.js +0 -2
  65. package/dist/esnext/components/CartLineProvider/tests/fixtures.d.ts +0 -86
  66. package/dist/esnext/components/CartLineProvider/tests/fixtures.js +0 -34
  67. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +0 -8
  68. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +0 -12
  69. package/dist/esnext/components/CartLineQuantity/index.d.ts +0 -1
  70. package/dist/esnext/components/CartLineQuantity/index.js +0 -1
  71. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +0 -12
  72. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +0 -26
  73. package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +0 -1
  74. package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +0 -1
  75. package/dist/esnext/components/CartLines/CartLines.client.d.ts +0 -15
  76. package/dist/esnext/components/CartLines/CartLines.client.js +0 -17
  77. package/dist/esnext/components/CartLines/index.d.ts +0 -1
  78. package/dist/esnext/components/CartLines/index.js +0 -1
  79. package/dist/esnext/components/CartProvider/CartActions.client.d.ts +0 -61
  80. package/dist/esnext/components/CartProvider/CartActions.client.js +0 -132
  81. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +0 -49
  82. package/dist/esnext/components/CartProvider/CartProvider.client.js +0 -433
  83. package/dist/esnext/components/CartProvider/cart-queries.d.ts +0 -10
  84. package/dist/esnext/components/CartProvider/cart-queries.js +0 -206
  85. package/dist/esnext/components/CartProvider/constants.d.ts +0 -2
  86. package/dist/esnext/components/CartProvider/constants.js +0 -2
  87. package/dist/esnext/components/CartProvider/context.d.ts +0 -2
  88. package/dist/esnext/components/CartProvider/context.js +0 -2
  89. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +0 -96
  90. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.js +0 -1
  91. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +0 -96
  92. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +0 -1
  93. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +0 -95
  94. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.js +0 -1
  95. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +0 -96
  96. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +0 -1
  97. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +0 -82
  98. package/dist/esnext/components/CartProvider/graphql/CartFragment.js +0 -1
  99. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +0 -96
  100. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.js +0 -1
  101. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +0 -96
  102. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.js +0 -1
  103. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +0 -96
  104. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.js +0 -1
  105. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +0 -96
  106. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.js +0 -1
  107. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +0 -91
  108. package/dist/esnext/components/CartProvider/graphql/CartQuery.js +0 -1
  109. package/dist/esnext/components/CartProvider/hooks.client.d.ts +0 -15
  110. package/dist/esnext/components/CartProvider/hooks.client.js +0 -71
  111. package/dist/esnext/components/CartProvider/index.d.ts +0 -4
  112. package/dist/esnext/components/CartProvider/index.js +0 -3
  113. package/dist/esnext/components/CartProvider/tests/fixtures.d.ts +0 -254
  114. package/dist/esnext/components/CartProvider/tests/fixtures.js +0 -53
  115. package/dist/esnext/components/CartProvider/types.d.ts +0 -275
  116. package/dist/esnext/components/CartProvider/types.js +0 -1
  117. package/dist/esnext/components/CartProvider/useCartAPIStateMachine.client.d.ts +0 -21
  118. package/dist/esnext/components/CartProvider/useCartAPIStateMachine.client.js +0 -270
  119. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +0 -7
  120. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +0 -17
  121. package/dist/esnext/components/CartShopPayButton/index.d.ts +0 -1
  122. package/dist/esnext/components/CartShopPayButton/index.js +0 -1
  123. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +0 -21
  124. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +0 -14
  125. package/dist/esnext/components/ExternalVideo/index.d.ts +0 -1
  126. package/dist/esnext/components/ExternalVideo/index.js +0 -1
  127. package/dist/esnext/components/Image/Image.d.ts +0 -105
  128. package/dist/esnext/components/Image/Image.js +0 -145
  129. package/dist/esnext/components/Image/index.d.ts +0 -2
  130. package/dist/esnext/components/Image/index.js +0 -1
  131. package/dist/esnext/components/Link/Link.client.d.ts +0 -27
  132. package/dist/esnext/components/Link/Link.client.js +0 -145
  133. package/dist/esnext/components/Link/index.d.ts +0 -1
  134. package/dist/esnext/components/Link/index.js +0 -1
  135. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +0 -6
  136. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +0 -5
  137. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +0 -22
  138. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +0 -23
  139. package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
  140. package/dist/esnext/components/LocalizationProvider/index.js +0 -1
  141. package/dist/esnext/components/MediaFile/MediaFile.d.ts +0 -19
  142. package/dist/esnext/components/MediaFile/MediaFile.js +0 -32
  143. package/dist/esnext/components/MediaFile/index.d.ts +0 -1
  144. package/dist/esnext/components/MediaFile/index.js +0 -1
  145. package/dist/esnext/components/Metafield/Metafield.client.d.ts +0 -17
  146. package/dist/esnext/components/Metafield/Metafield.client.js +0 -102
  147. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +0 -12
  148. package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +0 -48
  149. package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +0 -1
  150. package/dist/esnext/components/Metafield/components/StarRating/index.js +0 -1
  151. package/dist/esnext/components/Metafield/components/index.d.ts +0 -1
  152. package/dist/esnext/components/Metafield/components/index.js +0 -1
  153. package/dist/esnext/components/Metafield/index.d.ts +0 -2
  154. package/dist/esnext/components/Metafield/index.js +0 -1
  155. package/dist/esnext/components/Metafield/types.d.ts +0 -4
  156. package/dist/esnext/components/Metafield/types.js +0 -1
  157. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +0 -128
  158. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +0 -104
  159. package/dist/esnext/components/ModelViewer/index.d.ts +0 -1
  160. package/dist/esnext/components/ModelViewer/index.js +0 -1
  161. package/dist/esnext/components/Money/Money.client.d.ts +0 -25
  162. package/dist/esnext/components/Money/Money.client.js +0 -39
  163. package/dist/esnext/components/Money/index.d.ts +0 -1
  164. package/dist/esnext/components/Money/index.js +0 -1
  165. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +0 -21
  166. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +0 -133
  167. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +0 -2
  168. package/dist/esnext/components/ProductOptionsProvider/context.js +0 -2
  169. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +0 -1
  170. package/dist/esnext/components/ProductOptionsProvider/index.js +0 -1
  171. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +0 -18
  172. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +0 -54
  173. package/dist/esnext/components/ProductPrice/index.d.ts +0 -1
  174. package/dist/esnext/components/ProductPrice/index.js +0 -1
  175. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +0 -3
  176. package/dist/esnext/components/Seo/CollectionSeo.client.js +0 -14
  177. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +0 -3
  178. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +0 -18
  179. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +0 -4
  180. package/dist/esnext/components/Seo/DescriptionSeo.client.js +0 -10
  181. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +0 -2
  182. package/dist/esnext/components/Seo/HomePageSeo.client.js +0 -25
  183. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +0 -3
  184. package/dist/esnext/components/Seo/ImageSeo.client.js +0 -10
  185. package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +0 -3
  186. package/dist/esnext/components/Seo/NoIndexSeo.client.js +0 -10
  187. package/dist/esnext/components/Seo/PageSeo.client.d.ts +0 -3
  188. package/dist/esnext/components/Seo/PageSeo.client.js +0 -12
  189. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +0 -5
  190. package/dist/esnext/components/Seo/ProductSeo.client.js +0 -62
  191. package/dist/esnext/components/Seo/Seo.client.d.ts +0 -30
  192. package/dist/esnext/components/Seo/Seo.client.js +0 -31
  193. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +0 -3
  194. package/dist/esnext/components/Seo/TitleSeo.client.js +0 -10
  195. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +0 -2
  196. package/dist/esnext/components/Seo/TwitterSeo.client.js +0 -9
  197. package/dist/esnext/components/Seo/index.d.ts +0 -1
  198. package/dist/esnext/components/Seo/index.js +0 -1
  199. package/dist/esnext/components/Seo/seo-types.d.ts +0 -18
  200. package/dist/esnext/components/Seo/seo-types.js +0 -1
  201. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +0 -40
  202. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +0 -56
  203. package/dist/esnext/components/ShopPayButton/index.d.ts +0 -1
  204. package/dist/esnext/components/ShopPayButton/index.js +0 -1
  205. package/dist/esnext/components/Video/Video.d.ts +0 -19
  206. package/dist/esnext/components/Video/Video.js +0 -23
  207. package/dist/esnext/components/Video/index.d.ts +0 -1
  208. package/dist/esnext/components/Video/index.js +0 -1
  209. package/dist/esnext/components/index.d.ts +0 -27
  210. package/dist/esnext/components/index.js +0 -25
  211. package/dist/esnext/components/types.d.ts +0 -71
  212. package/dist/esnext/components/types.js +0 -10
  213. package/dist/esnext/config.d.ts +0 -7
  214. package/dist/esnext/config.js +0 -5
  215. package/dist/esnext/constants.d.ts +0 -14
  216. package/dist/esnext/constants.js +0 -14
  217. package/dist/esnext/entry-client.d.ts +0 -3
  218. package/dist/esnext/entry-client.js +0 -197
  219. package/dist/esnext/entry-server.d.ts +0 -6
  220. package/dist/esnext/entry-server.js +0 -642
  221. package/dist/esnext/experimental.d.ts +0 -2
  222. package/dist/esnext/experimental.js +0 -2
  223. package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +0 -3
  224. package/dist/esnext/foundation/Analytics/Analytics.client.js +0 -30
  225. package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +0 -1
  226. package/dist/esnext/foundation/Analytics/Analytics.server.js +0 -47
  227. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +0 -27
  228. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +0 -99
  229. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +0 -4
  230. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +0 -51
  231. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +0 -7
  232. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +0 -83
  233. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +0 -1
  234. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +0 -23
  235. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +0 -3
  236. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +0 -7
  237. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +0 -3
  238. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +0 -7
  239. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +0 -3
  240. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +0 -191
  241. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +0 -3
  242. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +0 -49
  243. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +0 -31
  244. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +0 -54
  245. package/dist/esnext/foundation/Analytics/connectors/Shopify/customer-events.client.d.ts +0 -2
  246. package/dist/esnext/foundation/Analytics/connectors/Shopify/customer-events.client.js +0 -182
  247. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +0 -6
  248. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +0 -125
  249. package/dist/esnext/foundation/Analytics/const.d.ts +0 -9
  250. package/dist/esnext/foundation/Analytics/const.js +0 -9
  251. package/dist/esnext/foundation/Analytics/hook.d.ts +0 -1
  252. package/dist/esnext/foundation/Analytics/hook.js +0 -9
  253. package/dist/esnext/foundation/Analytics/index.d.ts +0 -1
  254. package/dist/esnext/foundation/Analytics/index.js +0 -1
  255. package/dist/esnext/foundation/Analytics/types.d.ts +0 -5
  256. package/dist/esnext/foundation/Analytics/types.js +0 -1
  257. package/dist/esnext/foundation/Analytics/utils.d.ts +0 -3
  258. package/dist/esnext/foundation/Analytics/utils.js +0 -29
  259. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +0 -4
  260. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +0 -8
  261. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +0 -2
  262. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +0 -23
  263. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.d.ts +0 -1
  264. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.js +0 -3
  265. package/dist/esnext/foundation/Cache/cache-sub-request.d.ts +0 -17
  266. package/dist/esnext/foundation/Cache/cache-sub-request.js +0 -64
  267. package/dist/esnext/foundation/Cache/cache.d.ts +0 -17
  268. package/dist/esnext/foundation/Cache/cache.js +0 -126
  269. package/dist/esnext/foundation/Cache/strategies/index.d.ts +0 -7
  270. package/dist/esnext/foundation/Cache/strategies/index.js +0 -54
  271. package/dist/esnext/foundation/Cookie/Cookie.d.ts +0 -48
  272. package/dist/esnext/foundation/Cookie/Cookie.js +0 -72
  273. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +0 -5
  274. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +0 -32
  275. package/dist/esnext/foundation/DevTools/DevTools.client.d.ts +0 -3
  276. package/dist/esnext/foundation/DevTools/DevTools.client.js +0 -17
  277. package/dist/esnext/foundation/DevTools/DevTools.server.d.ts +0 -1
  278. package/dist/esnext/foundation/DevTools/DevTools.server.js +0 -15
  279. package/dist/esnext/foundation/DevTools/components/GraphQL.client.d.ts +0 -1
  280. package/dist/esnext/foundation/DevTools/components/GraphQL.client.js +0 -25
  281. package/dist/esnext/foundation/DevTools/components/Heading.d.ts +0 -5
  282. package/dist/esnext/foundation/DevTools/components/Heading.js +0 -12
  283. package/dist/esnext/foundation/DevTools/components/Interface.client.d.ts +0 -11
  284. package/dist/esnext/foundation/DevTools/components/Interface.client.js +0 -47
  285. package/dist/esnext/foundation/DevTools/components/Panels.d.ts +0 -8
  286. package/dist/esnext/foundation/DevTools/components/Panels.js +0 -66
  287. package/dist/esnext/foundation/DevTools/components/Performance.client.d.ts +0 -14
  288. package/dist/esnext/foundation/DevTools/components/Performance.client.js +0 -25
  289. package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +0 -8
  290. package/dist/esnext/foundation/DevTools/components/Settings.client.js +0 -17
  291. package/dist/esnext/foundation/DevTools/components/Table.d.ts +0 -9
  292. package/dist/esnext/foundation/DevTools/components/Table.js +0 -7
  293. package/dist/esnext/foundation/DevTools/components/icons.d.ts +0 -2
  294. package/dist/esnext/foundation/DevTools/components/icons.js +0 -13
  295. package/dist/esnext/foundation/DevTools/components/index.d.ts +0 -2
  296. package/dist/esnext/foundation/DevTools/components/index.js +0 -2
  297. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +0 -22
  298. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +0 -69
  299. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +0 -6
  300. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +0 -149
  301. package/dist/esnext/foundation/Form/Form.client.d.ts +0 -14
  302. package/dist/esnext/foundation/Form/Form.client.js +0 -51
  303. package/dist/esnext/foundation/Head/Head.client.d.ts +0 -5
  304. package/dist/esnext/foundation/Head/Head.client.js +0 -10
  305. package/dist/esnext/foundation/Head/index.d.ts +0 -1
  306. package/dist/esnext/foundation/Head/index.js +0 -1
  307. package/dist/esnext/foundation/Html/Html.d.ts +0 -13
  308. package/dist/esnext/foundation/Html/Html.js +0 -96
  309. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +0 -78
  310. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +0 -206
  311. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +0 -23
  312. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +0 -49
  313. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +0 -5
  314. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +0 -53
  315. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +0 -5
  316. package/dist/esnext/foundation/Redirect/Redirect.client.js +0 -15
  317. package/dist/esnext/foundation/Route/Route.server.d.ts +0 -14
  318. package/dist/esnext/foundation/Route/Route.server.js +0 -28
  319. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +0 -14
  320. package/dist/esnext/foundation/Router/BrowserRouter.client.js +0 -144
  321. package/dist/esnext/foundation/Router/Router.server.d.ts +0 -10
  322. package/dist/esnext/foundation/Router/Router.server.js +0 -8
  323. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +0 -43
  324. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +0 -65
  325. package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +0 -1
  326. package/dist/esnext/foundation/ServerPropsProvider/index.js +0 -1
  327. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +0 -23
  328. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +0 -125
  329. package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +0 -1
  330. package/dist/esnext/foundation/ServerRequestProvider/index.js +0 -1
  331. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +0 -30
  332. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +0 -59
  333. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +0 -9
  334. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +0 -10
  335. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +0 -19
  336. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +0 -94
  337. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +0 -1
  338. package/dist/esnext/foundation/ShopifyProvider/index.js +0 -1
  339. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +0 -35
  340. package/dist/esnext/foundation/ShopifyProvider/types.js +0 -1
  341. package/dist/esnext/foundation/constants.d.ts +0 -2
  342. package/dist/esnext/foundation/constants.js +0 -4
  343. package/dist/esnext/foundation/fetchSync/ResponseSync.d.ts +0 -15
  344. package/dist/esnext/foundation/fetchSync/ResponseSync.js +0 -50
  345. package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +0 -10
  346. package/dist/esnext/foundation/fetchSync/client/fetchSync.js +0 -23
  347. package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +0 -8
  348. package/dist/esnext/foundation/fetchSync/server/fetchSync.js +0 -39
  349. package/dist/esnext/foundation/index.d.ts +0 -3
  350. package/dist/esnext/foundation/index.js +0 -3
  351. package/dist/esnext/foundation/runtime.d.ts +0 -2
  352. package/dist/esnext/foundation/runtime.js +0 -6
  353. package/dist/esnext/foundation/session/session-types.d.ts +0 -15
  354. package/dist/esnext/foundation/session/session-types.js +0 -1
  355. package/dist/esnext/foundation/session/session.d.ts +0 -18
  356. package/dist/esnext/foundation/session/session.js +0 -53
  357. package/dist/esnext/foundation/ssr-interop.d.ts +0 -29
  358. package/dist/esnext/foundation/ssr-interop.js +0 -35
  359. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +0 -17
  360. package/dist/esnext/foundation/useNavigate/useNavigate.js +0 -39
  361. package/dist/esnext/foundation/useQuery/hooks.d.ts +0 -41
  362. package/dist/esnext/foundation/useQuery/hooks.js +0 -105
  363. package/dist/esnext/foundation/useQuery/index.d.ts +0 -1
  364. package/dist/esnext/foundation/useQuery/index.js +0 -1
  365. package/dist/esnext/foundation/useRequestContext/index.d.ts +0 -15
  366. package/dist/esnext/foundation/useRequestContext/index.js +0 -23
  367. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +0 -13
  368. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +0 -12
  369. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +0 -4
  370. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +0 -9
  371. package/dist/esnext/foundation/useServerProps/index.d.ts +0 -1
  372. package/dist/esnext/foundation/useServerProps/index.js +0 -1
  373. package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +0 -21
  374. package/dist/esnext/foundation/useServerProps/use-server-props.js +0 -35
  375. package/dist/esnext/foundation/useSession/useSession.d.ts +0 -3
  376. package/dist/esnext/foundation/useSession/useSession.js +0 -20
  377. package/dist/esnext/foundation/useShop/index.d.ts +0 -1
  378. package/dist/esnext/foundation/useShop/index.js +0 -1
  379. package/dist/esnext/foundation/useShop/use-shop.d.ts +0 -6
  380. package/dist/esnext/foundation/useShop/use-shop.js +0 -14
  381. package/dist/esnext/foundation/useUrl/index.d.ts +0 -1
  382. package/dist/esnext/foundation/useUrl/index.js +0 -1
  383. package/dist/esnext/foundation/useUrl/useUrl.d.ts +0 -4
  384. package/dist/esnext/foundation/useUrl/useUrl.js +0 -29
  385. package/dist/esnext/framework/cache/in-memory.d.ts +0 -17
  386. package/dist/esnext/framework/cache/in-memory.js +0 -80
  387. package/dist/esnext/framework/graphiql.d.ts +0 -1
  388. package/dist/esnext/framework/graphiql.js +0 -34
  389. package/dist/esnext/framework/load-config.d.ts +0 -5
  390. package/dist/esnext/framework/load-config.js +0 -7
  391. package/dist/esnext/framework/middleware.d.ts +0 -21
  392. package/dist/esnext/framework/middleware.js +0 -97
  393. package/dist/esnext/framework/plugin.d.ts +0 -8
  394. package/dist/esnext/framework/plugin.js +0 -35
  395. package/dist/esnext/framework/plugins/vite-plugin-assets-version.d.ts +0 -2
  396. package/dist/esnext/framework/plugins/vite-plugin-assets-version.js +0 -12
  397. package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +0 -2
  398. package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +0 -28
  399. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +0 -2
  400. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +0 -101
  401. package/dist/esnext/framework/plugins/vite-plugin-css-rsc.d.ts +0 -2
  402. package/dist/esnext/framework/plugins/vite-plugin-css-rsc.js +0 -213
  403. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +0 -3
  404. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +0 -41
  405. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts +0 -3
  406. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.js +0 -36
  407. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +0 -4
  408. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +0 -113
  409. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +0 -11
  410. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +0 -60
  411. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +0 -2
  412. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +0 -23
  413. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +0 -3
  414. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +0 -24
  415. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +0 -7
  416. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +0 -149
  417. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +0 -3
  418. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +0 -112
  419. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.d.ts +0 -3
  420. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +0 -20
  421. package/dist/esnext/framework/types.d.ts +0 -20
  422. package/dist/esnext/framework/types.js +0 -1
  423. package/dist/esnext/framework/viteception.d.ts +0 -5
  424. package/dist/esnext/framework/viteception.js +0 -22
  425. package/dist/esnext/hooks/index.d.ts +0 -6
  426. package/dist/esnext/hooks/index.js +0 -6
  427. package/dist/esnext/hooks/useCart/index.d.ts +0 -1
  428. package/dist/esnext/hooks/useCart/index.js +0 -1
  429. package/dist/esnext/hooks/useCart/useCart.d.ts +0 -4
  430. package/dist/esnext/hooks/useCart/useCart.js +0 -12
  431. package/dist/esnext/hooks/useCartLine/index.d.ts +0 -1
  432. package/dist/esnext/hooks/useCartLine/index.js +0 -1
  433. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +0 -39
  434. package/dist/esnext/hooks/useCartLine/useCartLine.js +0 -12
  435. package/dist/esnext/hooks/useDelay/useDelay.d.ts +0 -1
  436. package/dist/esnext/hooks/useDelay/useDelay.js +0 -17
  437. package/dist/esnext/hooks/useLoadScript/index.d.ts +0 -1
  438. package/dist/esnext/hooks/useLoadScript/index.js +0 -1
  439. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +0 -8
  440. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +0 -23
  441. package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +0 -4
  442. package/dist/esnext/hooks/useLocalization/useLocalization.js +0 -9
  443. package/dist/esnext/hooks/useMeasurement/hooks.d.ts +0 -9
  444. package/dist/esnext/hooks/useMeasurement/hooks.js +0 -13
  445. package/dist/esnext/hooks/useMeasurement/index.d.ts +0 -1
  446. package/dist/esnext/hooks/useMeasurement/index.js +0 -1
  447. package/dist/esnext/hooks/useMoney/hooks.d.ts +0 -54
  448. package/dist/esnext/hooks/useMoney/hooks.js +0 -80
  449. package/dist/esnext/hooks/useMoney/index.d.ts +0 -1
  450. package/dist/esnext/hooks/useMoney/index.js +0 -1
  451. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +0 -6
  452. package/dist/esnext/hooks/useProductOptions/helpers.js +0 -36
  453. package/dist/esnext/hooks/useProductOptions/index.d.ts +0 -2
  454. package/dist/esnext/hooks/useProductOptions/index.js +0 -2
  455. package/dist/esnext/hooks/useProductOptions/types.d.ts +0 -44
  456. package/dist/esnext/hooks/useProductOptions/types.js +0 -1
  457. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +0 -1
  458. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +0 -9
  459. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +0 -28
  460. package/dist/esnext/hooks/useShopQuery/hooks.js +0 -176
  461. package/dist/esnext/hooks/useShopQuery/index.d.ts +0 -1
  462. package/dist/esnext/hooks/useShopQuery/index.js +0 -1
  463. package/dist/esnext/index.d.ts +0 -45
  464. package/dist/esnext/index.js +0 -41
  465. package/dist/esnext/node.d.ts +0 -1
  466. package/dist/esnext/node.js +0 -1
  467. package/dist/esnext/platforms/index.d.ts +0 -1
  468. package/dist/esnext/platforms/index.js +0 -1
  469. package/dist/esnext/platforms/node.d.ts +0 -9
  470. package/dist/esnext/platforms/node.js +0 -35
  471. package/dist/esnext/platforms/virtual.d.ts +0 -8
  472. package/dist/esnext/platforms/virtual.js +0 -12
  473. package/dist/esnext/platforms/worker-event.d.ts +0 -1
  474. package/dist/esnext/platforms/worker-event.js +0 -3
  475. package/dist/esnext/platforms/worker.d.ts +0 -14
  476. package/dist/esnext/platforms/worker.js +0 -25
  477. package/dist/esnext/shared-types.d.ts +0 -31
  478. package/dist/esnext/shared-types.js +0 -4
  479. package/dist/esnext/storefront-api-types.d.ts +0 -6326
  480. package/dist/esnext/storefront-api-types.js +0 -1775
  481. package/dist/esnext/streaming.server.d.ts +0 -16
  482. package/dist/esnext/streaming.server.js +0 -24
  483. package/dist/esnext/testing.d.ts +0 -2
  484. package/dist/esnext/testing.js +0 -2
  485. package/dist/esnext/types.d.ts +0 -117
  486. package/dist/esnext/types.js +0 -1
  487. package/dist/esnext/utilities/apiRoutes.d.ts +0 -44
  488. package/dist/esnext/utilities/apiRoutes.js +0 -200
  489. package/dist/esnext/utilities/bot-ua.d.ts +0 -4
  490. package/dist/esnext/utilities/bot-ua.js +0 -65
  491. package/dist/esnext/utilities/defer.d.ts +0 -6
  492. package/dist/esnext/utilities/defer.js +0 -14
  493. package/dist/esnext/utilities/devtools.d.ts +0 -11
  494. package/dist/esnext/utilities/devtools.js +0 -11
  495. package/dist/esnext/utilities/empty-hydrogen-config.d.ts +0 -2
  496. package/dist/esnext/utilities/empty-hydrogen-config.js +0 -2
  497. package/dist/esnext/utilities/error.d.ts +0 -1
  498. package/dist/esnext/utilities/error.js +0 -6
  499. package/dist/esnext/utilities/fetch.d.ts +0 -9
  500. package/dist/esnext/utilities/fetch.js +0 -34
  501. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +0 -7
  502. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +0 -18
  503. package/dist/esnext/utilities/flattenConnection/index.d.ts +0 -1
  504. package/dist/esnext/utilities/flattenConnection/index.js +0 -1
  505. package/dist/esnext/utilities/graphql-tag.d.ts +0 -1
  506. package/dist/esnext/utilities/graphql-tag.js +0 -6
  507. package/dist/esnext/utilities/graphql-tracker.d.ts +0 -17
  508. package/dist/esnext/utilities/graphql-tracker.js +0 -121
  509. package/dist/esnext/utilities/hash.d.ts +0 -2
  510. package/dist/esnext/utilities/hash.js +0 -26
  511. package/dist/esnext/utilities/html-encoding.d.ts +0 -1
  512. package/dist/esnext/utilities/html-encoding.js +0 -8
  513. package/dist/esnext/utilities/image_size.d.ts +0 -34
  514. package/dist/esnext/utilities/image_size.js +0 -96
  515. package/dist/esnext/utilities/index.d.ts +0 -12
  516. package/dist/esnext/utilities/index.js +0 -12
  517. package/dist/esnext/utilities/isBrowser/index.d.ts +0 -1
  518. package/dist/esnext/utilities/isBrowser/index.js +0 -1
  519. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +0 -4
  520. package/dist/esnext/utilities/isBrowser/isBrowser.js +0 -6
  521. package/dist/esnext/utilities/isServer/index.d.ts +0 -1
  522. package/dist/esnext/utilities/isServer/index.js +0 -1
  523. package/dist/esnext/utilities/isServer/isServer.d.ts +0 -4
  524. package/dist/esnext/utilities/isServer/isServer.js +0 -7
  525. package/dist/esnext/utilities/load_script.d.ts +0 -4
  526. package/dist/esnext/utilities/load_script.js +0 -28
  527. package/dist/esnext/utilities/locale/index.d.ts +0 -1
  528. package/dist/esnext/utilities/locale/index.js +0 -1
  529. package/dist/esnext/utilities/locale/locale.d.ts +0 -7
  530. package/dist/esnext/utilities/locale/locale.js +0 -22
  531. package/dist/esnext/utilities/log/index.d.ts +0 -4
  532. package/dist/esnext/utilities/log/index.js +0 -4
  533. package/dist/esnext/utilities/log/log-cache-api-status.d.ts +0 -1
  534. package/dist/esnext/utilities/log/log-cache-api-status.js +0 -17
  535. package/dist/esnext/utilities/log/log-cache-header.d.ts +0 -10
  536. package/dist/esnext/utilities/log/log-cache-header.js +0 -30
  537. package/dist/esnext/utilities/log/log-query-timeline.d.ts +0 -12
  538. package/dist/esnext/utilities/log/log-query-timeline.js +0 -105
  539. package/dist/esnext/utilities/log/log.d.ts +0 -28
  540. package/dist/esnext/utilities/log/log.js +0 -89
  541. package/dist/esnext/utilities/log/utils.d.ts +0 -3
  542. package/dist/esnext/utilities/log/utils.js +0 -11
  543. package/dist/esnext/utilities/matchPath.d.ts +0 -10
  544. package/dist/esnext/utilities/matchPath.js +0 -54
  545. package/dist/esnext/utilities/measurement.d.ts +0 -3
  546. package/dist/esnext/utilities/measurement.js +0 -98
  547. package/dist/esnext/utilities/object.d.ts +0 -5
  548. package/dist/esnext/utilities/object.js +0 -7
  549. package/dist/esnext/utilities/parse.d.ts +0 -2
  550. package/dist/esnext/utilities/parse.js +0 -28
  551. package/dist/esnext/utilities/parseMetafield/index.d.ts +0 -1
  552. package/dist/esnext/utilities/parseMetafield/index.js +0 -1
  553. package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +0 -15
  554. package/dist/esnext/utilities/parseMetafield/parseMetafield.js +0 -62
  555. package/dist/esnext/utilities/random.d.ts +0 -1
  556. package/dist/esnext/utilities/random.js +0 -11
  557. package/dist/esnext/utilities/storefrontApi.d.ts +0 -8
  558. package/dist/esnext/utilities/storefrontApi.js +0 -63
  559. package/dist/esnext/utilities/suspense.d.ts +0 -12
  560. package/dist/esnext/utilities/suspense.js +0 -58
  561. package/dist/esnext/utilities/template.d.ts +0 -10
  562. package/dist/esnext/utilities/template.js +0 -60
  563. package/dist/esnext/utilities/tests/MockedServerRequestProvider.server.d.ts +0 -6
  564. package/dist/esnext/utilities/tests/MockedServerRequestProvider.server.js +0 -9
  565. package/dist/esnext/utilities/tests/price.d.ts +0 -5
  566. package/dist/esnext/utilities/tests/price.js +0 -8
  567. package/dist/esnext/utilities/tests/provider-helpers.d.ts +0 -31
  568. package/dist/esnext/utilities/tests/provider-helpers.js +0 -36
  569. package/dist/esnext/utilities/timing.d.ts +0 -7
  570. package/dist/esnext/utilities/timing.js +0 -14
  571. package/dist/esnext/utilities/video_parameters.d.ts +0 -47
  572. package/dist/esnext/utilities/video_parameters.js +0 -22
  573. package/dist/esnext/utilities/vite.d.ts +0 -1
  574. package/dist/esnext/utilities/vite.js +0 -4
  575. package/dist/esnext/utilities/web-api-polyfill.d.ts +0 -1
  576. package/dist/esnext/utilities/web-api-polyfill.js +0 -25
  577. package/dist/esnext/version.d.ts +0 -1
  578. package/dist/esnext/version.js +0 -1
  579. package/dist/node/foundation/session/session-types.d.ts +0 -15
  580. package/dist/node/foundation/session/session-types.js +0 -2
  581. package/dist/node/framework/cache/in-memory.d.ts +0 -17
  582. package/dist/node/framework/cache/in-memory.js +0 -84
  583. package/dist/node/framework/graphiql.d.ts +0 -1
  584. package/dist/node/framework/load-config.d.ts +0 -5
  585. package/dist/node/framework/load-config.js +0 -11
  586. package/dist/node/framework/middleware.d.ts +0 -21
  587. package/dist/node/framework/middleware.js +0 -124
  588. package/dist/node/framework/plugin.d.ts +0 -5
  589. package/dist/node/framework/plugin.js +0 -40
  590. package/dist/node/framework/plugins/vite-plugin-assets-version.d.ts +0 -2
  591. package/dist/node/framework/plugins/vite-plugin-assets-version.js +0 -15
  592. package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +0 -2
  593. package/dist/node/framework/plugins/vite-plugin-client-imports.js +0 -31
  594. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +0 -2
  595. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +0 -107
  596. package/dist/node/framework/plugins/vite-plugin-css-rsc.d.ts +0 -2
  597. package/dist/node/framework/plugins/vite-plugin-css-rsc.js +0 -219
  598. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +0 -3
  599. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +0 -46
  600. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts +0 -3
  601. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-components-cache.js +0 -38
  602. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +0 -4
  603. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +0 -118
  604. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +0 -11
  605. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +0 -66
  606. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +0 -2
  607. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +0 -29
  608. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +0 -3
  609. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +0 -26
  610. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +0 -7
  611. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +0 -155
  612. package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +0 -3
  613. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +0 -117
  614. package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +0 -3
  615. package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +0 -22
  616. package/dist/node/framework/types.d.ts +0 -20
  617. package/dist/node/framework/types.js +0 -2
  618. package/dist/node/framework/viteception.d.ts +0 -5
  619. package/dist/node/framework/viteception.js +0 -26
  620. package/dist/node/shared-types.d.ts +0 -31
  621. package/dist/node/shared-types.js +0 -5
  622. package/dist/node/utilities/vite.d.ts +0 -1
  623. package/dist/node/utilities/vite.js +0 -30
  624. package/dist/node/utilities/web-api-polyfill.d.ts +0 -1
  625. package/dist/node/utilities/web-api-polyfill.js +0 -53
  626. package/vendor/react-server-dom-vite/LICENSE +0 -21
  627. package/vendor/react-server-dom-vite/README.md +0 -5
  628. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +0 -632
  629. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +0 -1884
  630. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +0 -48
  631. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +0 -1945
  632. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +0 -49
  633. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +0 -629
  634. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +0 -19
  635. package/vendor/react-server-dom-vite/esm/package.json +0 -3
  636. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +0 -83
  637. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +0 -628
  638. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +0 -1876
  639. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +0 -1937
  640. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +0 -619
  641. package/vendor/react-server-dom-vite/index.js +0 -7
  642. package/vendor/react-server-dom-vite/package.json +0 -67
  643. package/vendor/react-server-dom-vite/plugin.js +0 -3
  644. package/vendor/react-server-dom-vite/writer.browser.server.js +0 -7
  645. package/vendor/react-server-dom-vite/writer.node.server.js +0 -7
@@ -1,1884 +0,0 @@
1
- /**
2
- * @license React
3
- * react-server-dom-vite-writer.browser.development.server.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
-
17
- var React = require('react');
18
-
19
- var assign = Object.assign;
20
-
21
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
22
-
23
- function error(format) {
24
- {
25
- {
26
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
27
- args[_key2 - 1] = arguments[_key2];
28
- }
29
-
30
- printWarning('error', format, args);
31
- }
32
- }
33
- }
34
-
35
- function printWarning(level, format, args) {
36
- // When changing this logic, you might want to also
37
- // update consoleWithStackDev.www.js as well.
38
- {
39
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
40
- var stack = ReactDebugCurrentFrame.getStackAddendum();
41
-
42
- if (stack !== '') {
43
- format += '%s';
44
- args = args.concat([stack]);
45
- } // eslint-disable-next-line react-internal/safe-string-coercion
46
-
47
-
48
- var argsWithFormat = args.map(function (item) {
49
- return String(item);
50
- }); // Careful: RN currently depends on this prefix
51
-
52
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
53
- // breaks IE9: https://github.com/facebook/react/issues/13610
54
- // eslint-disable-next-line react-internal/no-production-logging
55
-
56
- Function.prototype.apply.call(console[level], console, argsWithFormat);
57
- }
58
- }
59
-
60
- function scheduleWork(callback) {
61
- callback();
62
- }
63
- var VIEW_SIZE = 512;
64
- var currentView = null;
65
- var writtenBytes = 0;
66
- function beginWriting(destination) {
67
- currentView = new Uint8Array(VIEW_SIZE);
68
- writtenBytes = 0;
69
- }
70
- function writeChunk(destination, chunk) {
71
- if (chunk.length === 0) {
72
- return;
73
- }
74
-
75
- if (chunk.length > VIEW_SIZE) {
76
- // this chunk may overflow a single view which implies it was not
77
- // one that is cached by the streaming renderer. We will enqueu
78
- // it directly and expect it is not re-used
79
- if (writtenBytes > 0) {
80
- destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
81
- currentView = new Uint8Array(VIEW_SIZE);
82
- writtenBytes = 0;
83
- }
84
-
85
- destination.enqueue(chunk);
86
- return;
87
- }
88
-
89
- var bytesToWrite = chunk;
90
- var allowableBytes = currentView.length - writtenBytes;
91
-
92
- if (allowableBytes < bytesToWrite.length) {
93
- // this chunk would overflow the current view. We enqueue a full view
94
- // and start a new view with the remaining chunk
95
- if (allowableBytes === 0) {
96
- // the current view is already full, send it
97
- destination.enqueue(currentView);
98
- } else {
99
- // fill up the current view and apply the remaining chunk bytes
100
- // to a new view.
101
- currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes); // writtenBytes += allowableBytes; // this can be skipped because we are going to immediately reset the view
102
-
103
- destination.enqueue(currentView);
104
- bytesToWrite = bytesToWrite.subarray(allowableBytes);
105
- }
106
-
107
- currentView = new Uint8Array(VIEW_SIZE);
108
- writtenBytes = 0;
109
- }
110
-
111
- currentView.set(bytesToWrite, writtenBytes);
112
- writtenBytes += bytesToWrite.length;
113
- }
114
- function writeChunkAndReturn(destination, chunk) {
115
- writeChunk(destination, chunk); // in web streams there is no backpressure so we can alwas write more
116
-
117
- return true;
118
- }
119
- function completeWriting(destination) {
120
- if (currentView && writtenBytes > 0) {
121
- destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
122
- currentView = null;
123
- writtenBytes = 0;
124
- }
125
- }
126
- function close(destination) {
127
- destination.close();
128
- }
129
- var textEncoder = new TextEncoder();
130
- function stringToChunk(content) {
131
- return textEncoder.encode(content);
132
- }
133
- function stringToPrecomputedChunk(content) {
134
- return textEncoder.encode(content);
135
- }
136
- function closeWithError(destination, error) {
137
- if (typeof destination.error === 'function') {
138
- // $FlowFixMe: This is an Error object or the destination accepts other types.
139
- destination.error(error);
140
- } else {
141
- // Earlier implementations doesn't support this method. In that environment you're
142
- // supposed to throw from a promise returned but we don't return a promise in our
143
- // approach. We could fork this implementation but this is environment is an edge
144
- // case to begin with. It's even less common to run this in an older environment.
145
- // Even then, this is not where errors are supposed to happen and they get reported
146
- // to a global callback in addition to this anyway. So it's fine just to close this.
147
- destination.close();
148
- }
149
- }
150
-
151
- // This file is an intermediate layer to translate between Flight
152
- var stringify = JSON.stringify;
153
-
154
- function serializeRowHeader(tag, id) {
155
- return tag + id.toString(16) + ':';
156
- }
157
-
158
- function processErrorChunk(request, id, message, stack) {
159
- var errorInfo = {
160
- message: message,
161
- stack: stack
162
- };
163
- var row = serializeRowHeader('E', id) + stringify(errorInfo) + '\n';
164
- return stringToChunk(row);
165
- }
166
- function processModelChunk(request, id, model) {
167
- var json = stringify(model, request.toJSON);
168
- var row = serializeRowHeader('J', id) + json + '\n';
169
- return stringToChunk(row);
170
- }
171
- function processReferenceChunk(request, id, reference) {
172
- var json = stringify(reference);
173
- var row = serializeRowHeader('J', id) + json + '\n';
174
- return stringToChunk(row);
175
- }
176
- function processModuleChunk(request, id, moduleMetaData) {
177
- var json = stringify(moduleMetaData);
178
- var row = serializeRowHeader('M', id) + json + '\n';
179
- return stringToChunk(row);
180
- }
181
- function processProviderChunk(request, id, contextName) {
182
- var row = serializeRowHeader('P', id) + contextName + '\n';
183
- return stringToChunk(row);
184
- }
185
- function processSymbolChunk(request, id, name) {
186
- var json = stringify(name);
187
- var row = serializeRowHeader('S', id) + json + '\n';
188
- return stringToChunk(row);
189
- }
190
-
191
- // eslint-disable-next-line no-unused-vars
192
- var MODULE_TAG = Symbol.for('react.module.reference');
193
- function getModuleKey(reference) {
194
- if (typeof reference === 'string') reference = globalThis.__STRING_REFERENCE_INDEX[reference];
195
- return reference.filepath + '#' + reference.name;
196
- }
197
- function isModuleReference(reference) {
198
- if (typeof reference === 'string') return !!globalThis.__STRING_REFERENCE_INDEX[reference];
199
- return reference.$$typeof === MODULE_TAG;
200
- }
201
- function resolveModuleMetaData(config, moduleReference) {
202
- if (typeof moduleReference === 'string') moduleReference = globalThis.__STRING_REFERENCE_INDEX[moduleReference];
203
- return {
204
- id: moduleReference.filepath,
205
- name: moduleReference.name
206
- };
207
- }
208
-
209
- // ATTENTION
210
- // When adding new symbols to this file,
211
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
212
- // The Symbol used to tag the ReactElement-like types.
213
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
214
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
215
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
216
- var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
217
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
218
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
219
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
220
- var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
221
-
222
- // A reserved attribute.
223
- // It is handled by React separately and shouldn't be written to the DOM.
224
- var RESERVED = 0; // A simple string attribute.
225
- // Attributes that aren't in the filter are presumed to have this type.
226
-
227
- var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
228
- // "enumerated" attributes with "true" and "false" as possible values.
229
- // When true, it should be set to a "true" string.
230
- // When false, it should be set to a "false" string.
231
-
232
- var BOOLEANISH_STRING = 2; // A real boolean attribute.
233
- // When true, it should be present (set either to an empty string or its name).
234
- // When false, it should be omitted.
235
-
236
- var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
237
- // When true, it should be present (set either to an empty string or its name).
238
- // When false, it should be omitted.
239
- // For any other value, should be present with that value.
240
-
241
- var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
242
- // When falsy, it should be removed.
243
-
244
- var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
245
- // When falsy, it should be removed.
246
-
247
- var POSITIVE_NUMERIC = 6;
248
-
249
- function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
250
- this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
251
- this.attributeName = attributeName;
252
- this.attributeNamespace = attributeNamespace;
253
- this.mustUseProperty = mustUseProperty;
254
- this.propertyName = name;
255
- this.type = type;
256
- this.sanitizeURL = sanitizeURL;
257
- this.removeEmptyString = removeEmptyString;
258
- } // When adding attributes to this list, be sure to also add them to
259
- // the `possibleStandardNames` module to ensure casing and incorrect
260
- // name warnings.
261
-
262
-
263
- var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
264
-
265
- var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
266
- // elements (not just inputs). Now that ReactDOMInput assigns to the
267
- // defaultValue property -- do we need this?
268
- 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
269
-
270
- {
271
- reservedProps.push('innerText', 'textContent');
272
- }
273
-
274
- reservedProps.forEach(function (name) {
275
- properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
276
- name, // attributeName
277
- null, // attributeNamespace
278
- false, // sanitizeURL
279
- false);
280
- }); // A few React string attributes have a different name.
281
- // This is a mapping from React prop names to the attribute names.
282
-
283
- [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
284
- var name = _ref[0],
285
- attributeName = _ref[1];
286
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
287
- attributeName, // attributeName
288
- null, // attributeNamespace
289
- false, // sanitizeURL
290
- false);
291
- }); // These are "enumerated" HTML attributes that accept "true" and "false".
292
- // In React, we let users pass `true` and `false` even though technically
293
- // these aren't boolean attributes (they are coerced to strings).
294
-
295
- ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
296
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
297
- name.toLowerCase(), // attributeName
298
- null, // attributeNamespace
299
- false, // sanitizeURL
300
- false);
301
- }); // These are "enumerated" SVG attributes that accept "true" and "false".
302
- // In React, we let users pass `true` and `false` even though technically
303
- // these aren't boolean attributes (they are coerced to strings).
304
- // Since these are SVG attributes, their attribute names are case-sensitive.
305
-
306
- ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
307
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
308
- name, // attributeName
309
- null, // attributeNamespace
310
- false, // sanitizeURL
311
- false);
312
- }); // These are HTML boolean attributes.
313
-
314
- ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
315
- // on the client side because the browsers are inconsistent. Instead we call focus().
316
- 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
317
- 'itemScope'].forEach(function (name) {
318
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
319
- name.toLowerCase(), // attributeName
320
- null, // attributeNamespace
321
- false, // sanitizeURL
322
- false);
323
- }); // These are the few React props that we set as DOM properties
324
- // rather than attributes. These are all booleans.
325
-
326
- ['checked', // Note: `option.selected` is not updated if `select.multiple` is
327
- // disabled with `removeAttribute`. We have special logic for handling this.
328
- 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
329
- // you'll need to set attributeName to name.toLowerCase()
330
- // instead in the assignment below.
331
- ].forEach(function (name) {
332
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
333
- name, // attributeName
334
- null, // attributeNamespace
335
- false, // sanitizeURL
336
- false);
337
- }); // These are HTML attributes that are "overloaded booleans": they behave like
338
- // booleans, but can also accept a string value.
339
-
340
- ['capture', 'download' // NOTE: if you add a camelCased prop to this list,
341
- // you'll need to set attributeName to name.toLowerCase()
342
- // instead in the assignment below.
343
- ].forEach(function (name) {
344
- properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
345
- name, // attributeName
346
- null, // attributeNamespace
347
- false, // sanitizeURL
348
- false);
349
- }); // These are HTML attributes that must be positive numbers.
350
-
351
- ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
352
- // you'll need to set attributeName to name.toLowerCase()
353
- // instead in the assignment below.
354
- ].forEach(function (name) {
355
- properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
356
- name, // attributeName
357
- null, // attributeNamespace
358
- false, // sanitizeURL
359
- false);
360
- }); // These are HTML attributes that must be numbers.
361
-
362
- ['rowSpan', 'start'].forEach(function (name) {
363
- properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
364
- name.toLowerCase(), // attributeName
365
- null, // attributeNamespace
366
- false, // sanitizeURL
367
- false);
368
- });
369
- var CAMELIZE = /[\-\:]([a-z])/g;
370
-
371
- var capitalize = function (token) {
372
- return token[1].toUpperCase();
373
- }; // This is a list of all SVG attributes that need special casing, namespacing,
374
- // or boolean value assignment. Regular attributes that just accept strings
375
- // and have the same names are omitted, just like in the HTML attribute filter.
376
- // Some of these attributes can be hard to find. This list was created by
377
- // scraping the MDN documentation.
378
-
379
-
380
- ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
381
- // you'll need to set attributeName to name.toLowerCase()
382
- // instead in the assignment below.
383
- ].forEach(function (attributeName) {
384
- var name = attributeName.replace(CAMELIZE, capitalize);
385
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
386
- attributeName, null, // attributeNamespace
387
- false, // sanitizeURL
388
- false);
389
- }); // String SVG attributes with the xlink namespace.
390
-
391
- ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
392
- // you'll need to set attributeName to name.toLowerCase()
393
- // instead in the assignment below.
394
- ].forEach(function (attributeName) {
395
- var name = attributeName.replace(CAMELIZE, capitalize);
396
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
397
- attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL
398
- false);
399
- }); // String SVG attributes with the xml namespace.
400
-
401
- ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
402
- // you'll need to set attributeName to name.toLowerCase()
403
- // instead in the assignment below.
404
- ].forEach(function (attributeName) {
405
- var name = attributeName.replace(CAMELIZE, capitalize);
406
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
407
- attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL
408
- false);
409
- }); // These attribute exists both in HTML and SVG.
410
- // The attribute name is case-sensitive in SVG so we can't just use
411
- // the React name like we do for attributes that exist only in HTML.
412
-
413
- ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
414
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
415
- attributeName.toLowerCase(), // attributeName
416
- null, // attributeNamespace
417
- false, // sanitizeURL
418
- false);
419
- }); // These attributes accept URLs. These must not allow javascript: URLS.
420
- // These will also need to accept Trusted Types object in the future.
421
-
422
- var xlinkHref = 'xlinkHref';
423
- properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
424
- 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL
425
- false);
426
- ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
427
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
428
- attributeName.toLowerCase(), // attributeName
429
- null, // attributeNamespace
430
- true, // sanitizeURL
431
- true);
432
- });
433
-
434
- /**
435
- * CSS properties which accept numbers but are not in units of "px".
436
- */
437
- var isUnitlessNumber = {
438
- animationIterationCount: true,
439
- aspectRatio: true,
440
- borderImageOutset: true,
441
- borderImageSlice: true,
442
- borderImageWidth: true,
443
- boxFlex: true,
444
- boxFlexGroup: true,
445
- boxOrdinalGroup: true,
446
- columnCount: true,
447
- columns: true,
448
- flex: true,
449
- flexGrow: true,
450
- flexPositive: true,
451
- flexShrink: true,
452
- flexNegative: true,
453
- flexOrder: true,
454
- gridArea: true,
455
- gridRow: true,
456
- gridRowEnd: true,
457
- gridRowSpan: true,
458
- gridRowStart: true,
459
- gridColumn: true,
460
- gridColumnEnd: true,
461
- gridColumnSpan: true,
462
- gridColumnStart: true,
463
- fontWeight: true,
464
- lineClamp: true,
465
- lineHeight: true,
466
- opacity: true,
467
- order: true,
468
- orphans: true,
469
- tabSize: true,
470
- widows: true,
471
- zIndex: true,
472
- zoom: true,
473
- // SVG-related properties
474
- fillOpacity: true,
475
- floodOpacity: true,
476
- stopOpacity: true,
477
- strokeDasharray: true,
478
- strokeDashoffset: true,
479
- strokeMiterlimit: true,
480
- strokeOpacity: true,
481
- strokeWidth: true
482
- };
483
- /**
484
- * @param {string} prefix vendor-specific prefix, eg: Webkit
485
- * @param {string} key style name, eg: transitionDuration
486
- * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
487
- * WebkitTransitionDuration
488
- */
489
-
490
- function prefixKey(prefix, key) {
491
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
492
- }
493
- /**
494
- * Support style names that may come passed in prefixed by adding permutations
495
- * of vendor prefixes.
496
- */
497
-
498
-
499
- var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
500
- // infinite loop, because it iterates over the newly added props too.
501
-
502
- Object.keys(isUnitlessNumber).forEach(function (prop) {
503
- prefixes.forEach(function (prefix) {
504
- isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
505
- });
506
- });
507
-
508
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
509
-
510
- function isArray(a) {
511
- return isArrayImpl(a);
512
- }
513
-
514
- var startInlineScript = stringToPrecomputedChunk('<script>');
515
- var endInlineScript = stringToPrecomputedChunk('</script>');
516
- var startScriptSrc = stringToPrecomputedChunk('<script src="');
517
- var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
518
- var scriptIntegirty = stringToPrecomputedChunk('" integrity="');
519
- var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
520
-
521
- var textSeparator = stringToPrecomputedChunk('<!-- -->');
522
-
523
- var styleAttributeStart = stringToPrecomputedChunk(' style="');
524
- var styleAssign = stringToPrecomputedChunk(':');
525
- var styleSeparator = stringToPrecomputedChunk(';');
526
-
527
- var attributeSeparator = stringToPrecomputedChunk(' ');
528
- var attributeAssign = stringToPrecomputedChunk('="');
529
- var attributeEnd = stringToPrecomputedChunk('"');
530
- var attributeEmptyString = stringToPrecomputedChunk('=""');
531
-
532
- var endOfStartTag = stringToPrecomputedChunk('>');
533
- var endOfStartTagSelfClosing = stringToPrecomputedChunk('/>');
534
-
535
- var selectedMarkerAttribute = stringToPrecomputedChunk(' selected=""');
536
-
537
- var leadingNewline = stringToPrecomputedChunk('\n');
538
-
539
- var DOCTYPE = stringToPrecomputedChunk('<!DOCTYPE html>');
540
- var endTag1 = stringToPrecomputedChunk('</');
541
- var endTag2 = stringToPrecomputedChunk('>');
542
- // A placeholder is a node inside a hidden partial tree that can be filled in later, but before
543
- // display. It's never visible to users. We use the template tag because it can be used in every
544
- // type of parent. <script> tags also work in every other tag except <colgroup>.
545
-
546
- var placeholder1 = stringToPrecomputedChunk('<template id="');
547
- var placeholder2 = stringToPrecomputedChunk('"></template>');
548
-
549
- var startCompletedSuspenseBoundary = stringToPrecomputedChunk('<!--$-->');
550
- var startPendingSuspenseBoundary1 = stringToPrecomputedChunk('<!--$?--><template id="');
551
- var startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
552
- var startClientRenderedSuspenseBoundary = stringToPrecomputedChunk('<!--$!-->');
553
- var endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
554
- var clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk('<template');
555
- var clientRenderedSuspenseBoundaryErrorAttrInterstitial = stringToPrecomputedChunk('"');
556
- var clientRenderedSuspenseBoundaryError1A = stringToPrecomputedChunk(' data-dgst="');
557
- var clientRenderedSuspenseBoundaryError1B = stringToPrecomputedChunk(' data-msg="');
558
- var clientRenderedSuspenseBoundaryError1C = stringToPrecomputedChunk(' data-stck="');
559
- var clientRenderedSuspenseBoundaryError2 = stringToPrecomputedChunk('></template>');
560
- var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="');
561
- var startSegmentHTML2 = stringToPrecomputedChunk('">');
562
- var endSegmentHTML = stringToPrecomputedChunk('</div>');
563
- var startSegmentSVG = stringToPrecomputedChunk('<svg aria-hidden="true" style="display:none" id="');
564
- var startSegmentSVG2 = stringToPrecomputedChunk('">');
565
- var endSegmentSVG = stringToPrecomputedChunk('</svg>');
566
- var startSegmentMathML = stringToPrecomputedChunk('<math aria-hidden="true" style="display:none" id="');
567
- var startSegmentMathML2 = stringToPrecomputedChunk('">');
568
- var endSegmentMathML = stringToPrecomputedChunk('</math>');
569
- var startSegmentTable = stringToPrecomputedChunk('<table hidden id="');
570
- var startSegmentTable2 = stringToPrecomputedChunk('">');
571
- var endSegmentTable = stringToPrecomputedChunk('</table>');
572
- var startSegmentTableBody = stringToPrecomputedChunk('<table hidden><tbody id="');
573
- var startSegmentTableBody2 = stringToPrecomputedChunk('">');
574
- var endSegmentTableBody = stringToPrecomputedChunk('</tbody></table>');
575
- var startSegmentTableRow = stringToPrecomputedChunk('<table hidden><tr id="');
576
- var startSegmentTableRow2 = stringToPrecomputedChunk('">');
577
- var endSegmentTableRow = stringToPrecomputedChunk('</tr></table>');
578
- var startSegmentColGroup = stringToPrecomputedChunk('<table hidden><colgroup id="');
579
- var startSegmentColGroup2 = stringToPrecomputedChunk('">');
580
- var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
581
- // The following code is the source scripts that we then minify and inline below,
582
- // with renamed function names that we hope don't collide:
583
- // const COMMENT_NODE = 8;
584
- // const SUSPENSE_START_DATA = '$';
585
- // const SUSPENSE_END_DATA = '/$';
586
- // const SUSPENSE_PENDING_START_DATA = '$?';
587
- // const SUSPENSE_FALLBACK_START_DATA = '$!';
588
- //
589
- // function clientRenderBoundary(suspenseBoundaryID, errorDigest, errorMsg, errorComponentStack) {
590
- // // Find the fallback's first element.
591
- // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
592
- // if (!suspenseIdNode) {
593
- // // The user must have already navigated away from this tree.
594
- // // E.g. because the parent was hydrated.
595
- // return;
596
- // }
597
- // // Find the boundary around the fallback. This is always the previous node.
598
- // const suspenseNode = suspenseIdNode.previousSibling;
599
- // // Tag it to be client rendered.
600
- // suspenseNode.data = SUSPENSE_FALLBACK_START_DATA;
601
- // // assign error metadata to first sibling
602
- // let dataset = suspenseIdNode.dataset;
603
- // if (errorDigest) dataset.dgst = errorDigest;
604
- // if (errorMsg) dataset.msg = errorMsg;
605
- // if (errorComponentStack) dataset.stck = errorComponentStack;
606
- // // Tell React to retry it if the parent already hydrated.
607
- // if (suspenseNode._reactRetry) {
608
- // suspenseNode._reactRetry();
609
- // }
610
- // }
611
- //
612
- // function completeBoundary(suspenseBoundaryID, contentID) {
613
- // // Find the fallback's first element.
614
- // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
615
- // const contentNode = document.getElementById(contentID);
616
- // // We'll detach the content node so that regardless of what happens next we don't leave in the tree.
617
- // // This might also help by not causing recalcing each time we move a child from here to the target.
618
- // contentNode.parentNode.removeChild(contentNode);
619
- // if (!suspenseIdNode) {
620
- // // The user must have already navigated away from this tree.
621
- // // E.g. because the parent was hydrated. That's fine there's nothing to do
622
- // // but we have to make sure that we already deleted the container node.
623
- // return;
624
- // }
625
- // // Find the boundary around the fallback. This is always the previous node.
626
- // const suspenseNode = suspenseIdNode.previousSibling;
627
- //
628
- // // Clear all the existing children. This is complicated because
629
- // // there can be embedded Suspense boundaries in the fallback.
630
- // // This is similar to clearSuspenseBoundary in ReactDOMHostConfig.
631
- // // TODO: We could avoid this if we never emitted suspense boundaries in fallback trees.
632
- // // They never hydrate anyway. However, currently we support incrementally loading the fallback.
633
- // const parentInstance = suspenseNode.parentNode;
634
- // let node = suspenseNode.nextSibling;
635
- // let depth = 0;
636
- // do {
637
- // if (node && node.nodeType === COMMENT_NODE) {
638
- // const data = node.data;
639
- // if (data === SUSPENSE_END_DATA) {
640
- // if (depth === 0) {
641
- // break;
642
- // } else {
643
- // depth--;
644
- // }
645
- // } else if (
646
- // data === SUSPENSE_START_DATA ||
647
- // data === SUSPENSE_PENDING_START_DATA ||
648
- // data === SUSPENSE_FALLBACK_START_DATA
649
- // ) {
650
- // depth++;
651
- // }
652
- // }
653
- //
654
- // const nextNode = node.nextSibling;
655
- // parentInstance.removeChild(node);
656
- // node = nextNode;
657
- // } while (node);
658
- //
659
- // const endOfBoundary = node;
660
- //
661
- // // Insert all the children from the contentNode between the start and end of suspense boundary.
662
- // while (contentNode.firstChild) {
663
- // parentInstance.insertBefore(contentNode.firstChild, endOfBoundary);
664
- // }
665
- // suspenseNode.data = SUSPENSE_START_DATA;
666
- // if (suspenseNode._reactRetry) {
667
- // suspenseNode._reactRetry();
668
- // }
669
- // }
670
- //
671
- // function completeSegment(containerID, placeholderID) {
672
- // const segmentContainer = document.getElementById(containerID);
673
- // const placeholderNode = document.getElementById(placeholderID);
674
- // // We always expect both nodes to exist here because, while we might
675
- // // have navigated away from the main tree, we still expect the detached
676
- // // tree to exist.
677
- // segmentContainer.parentNode.removeChild(segmentContainer);
678
- // while (segmentContainer.firstChild) {
679
- // placeholderNode.parentNode.insertBefore(
680
- // segmentContainer.firstChild,
681
- // placeholderNode,
682
- // );
683
- // }
684
- // placeholderNode.parentNode.removeChild(placeholderNode);
685
- // }
686
-
687
- 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)}';
688
- 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()}}';
689
- 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())}';
690
- var completeSegmentScript1Full = stringToPrecomputedChunk(completeSegmentFunction + ';$RS("');
691
- var completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("');
692
- var completeSegmentScript2 = stringToPrecomputedChunk('","');
693
- var completeSegmentScript3 = stringToPrecomputedChunk('")</script>');
694
- var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundaryFunction + ';$RC("');
695
- var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("');
696
- var completeBoundaryScript2 = stringToPrecomputedChunk('","');
697
- var completeBoundaryScript3 = stringToPrecomputedChunk('")</script>');
698
- var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX("');
699
- var clientRenderScript1Partial = stringToPrecomputedChunk('$RX("');
700
- var clientRenderScript1A = stringToPrecomputedChunk('"');
701
- var clientRenderScript2 = stringToPrecomputedChunk(')</script>');
702
- var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');
703
-
704
- var rendererSigil;
705
-
706
- {
707
- // Use this to detect multiple renderers using the same context
708
- rendererSigil = {};
709
- } // Used to store the parent path of all context overrides in a shared linked list.
710
- // Forming a reverse tree.
711
-
712
-
713
- var rootContextSnapshot = null; // We assume that this runtime owns the "current" field on all ReactContext instances.
714
- // This global (actually thread local) state represents what state all those "current",
715
- // fields are currently in.
716
-
717
- var currentActiveSnapshot = null;
718
-
719
- function popNode(prev) {
720
- {
721
- prev.context._currentValue = prev.parentValue;
722
- }
723
- }
724
-
725
- function pushNode(next) {
726
- {
727
- next.context._currentValue = next.value;
728
- }
729
- }
730
-
731
- function popToNearestCommonAncestor(prev, next) {
732
- if (prev === next) ; else {
733
- popNode(prev);
734
- var parentPrev = prev.parent;
735
- var parentNext = next.parent;
736
-
737
- if (parentPrev === null) {
738
- if (parentNext !== null) {
739
- throw new Error('The stacks must reach the root at the same time. This is a bug in React.');
740
- }
741
- } else {
742
- if (parentNext === null) {
743
- throw new Error('The stacks must reach the root at the same time. This is a bug in React.');
744
- }
745
-
746
- popToNearestCommonAncestor(parentPrev, parentNext); // On the way back, we push the new ones that weren't common.
747
-
748
- pushNode(next);
749
- }
750
- }
751
- }
752
-
753
- function popAllPrevious(prev) {
754
- popNode(prev);
755
- var parentPrev = prev.parent;
756
-
757
- if (parentPrev !== null) {
758
- popAllPrevious(parentPrev);
759
- }
760
- }
761
-
762
- function pushAllNext(next) {
763
- var parentNext = next.parent;
764
-
765
- if (parentNext !== null) {
766
- pushAllNext(parentNext);
767
- }
768
-
769
- pushNode(next);
770
- }
771
-
772
- function popPreviousToCommonLevel(prev, next) {
773
- popNode(prev);
774
- var parentPrev = prev.parent;
775
-
776
- if (parentPrev === null) {
777
- throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');
778
- }
779
-
780
- if (parentPrev.depth === next.depth) {
781
- // We found the same level. Now we just need to find a shared ancestor.
782
- popToNearestCommonAncestor(parentPrev, next);
783
- } else {
784
- // We must still be deeper.
785
- popPreviousToCommonLevel(parentPrev, next);
786
- }
787
- }
788
-
789
- function popNextToCommonLevel(prev, next) {
790
- var parentNext = next.parent;
791
-
792
- if (parentNext === null) {
793
- throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');
794
- }
795
-
796
- if (prev.depth === parentNext.depth) {
797
- // We found the same level. Now we just need to find a shared ancestor.
798
- popToNearestCommonAncestor(prev, parentNext);
799
- } else {
800
- // We must still be deeper.
801
- popNextToCommonLevel(prev, parentNext);
802
- }
803
-
804
- pushNode(next);
805
- } // Perform context switching to the new snapshot.
806
- // To make it cheap to read many contexts, while not suspending, we make the switch eagerly by
807
- // updating all the context's current values. That way reads, always just read the current value.
808
- // At the cost of updating contexts even if they're never read by this subtree.
809
-
810
-
811
- function switchContext(newSnapshot) {
812
- // The basic algorithm we need to do is to pop back any contexts that are no longer on the stack.
813
- // We also need to update any new contexts that are now on the stack with the deepest value.
814
- // The easiest way to update new contexts is to just reapply them in reverse order from the
815
- // perspective of the backpointers. To avoid allocating a lot when switching, we use the stack
816
- // for that. Therefore this algorithm is recursive.
817
- // 1) First we pop which ever snapshot tree was deepest. Popping old contexts as we go.
818
- // 2) Then we find the nearest common ancestor from there. Popping old contexts as we go.
819
- // 3) Then we reapply new contexts on the way back up the stack.
820
- var prev = currentActiveSnapshot;
821
- var next = newSnapshot;
822
-
823
- if (prev !== next) {
824
- if (prev === null) {
825
- // $FlowFixMe: This has to be non-null since it's not equal to prev.
826
- pushAllNext(next);
827
- } else if (next === null) {
828
- popAllPrevious(prev);
829
- } else if (prev.depth === next.depth) {
830
- popToNearestCommonAncestor(prev, next);
831
- } else if (prev.depth > next.depth) {
832
- popPreviousToCommonLevel(prev, next);
833
- } else {
834
- popNextToCommonLevel(prev, next);
835
- }
836
-
837
- currentActiveSnapshot = next;
838
- }
839
- }
840
- function pushProvider(context, nextValue) {
841
- var prevValue;
842
-
843
- {
844
- prevValue = context._currentValue;
845
- context._currentValue = nextValue;
846
-
847
- {
848
- if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
849
- error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
850
- }
851
-
852
- context._currentRenderer = rendererSigil;
853
- }
854
- }
855
-
856
- var prevNode = currentActiveSnapshot;
857
- var newNode = {
858
- parent: prevNode,
859
- depth: prevNode === null ? 0 : prevNode.depth + 1,
860
- context: context,
861
- parentValue: prevValue,
862
- value: nextValue
863
- };
864
- currentActiveSnapshot = newNode;
865
- return newNode;
866
- }
867
- function popProvider() {
868
- var prevSnapshot = currentActiveSnapshot;
869
-
870
- if (prevSnapshot === null) {
871
- throw new Error('Tried to pop a Context at the root of the app. This is a bug in React.');
872
- }
873
-
874
- {
875
- var value = prevSnapshot.parentValue;
876
-
877
- if (value === REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED) {
878
- prevSnapshot.context._currentValue = prevSnapshot.context._defaultValue;
879
- } else {
880
- prevSnapshot.context._currentValue = value;
881
- }
882
- }
883
-
884
- return currentActiveSnapshot = prevSnapshot.parent;
885
- }
886
- function getActiveContext() {
887
- return currentActiveSnapshot;
888
- }
889
- function readContext(context) {
890
- var value = context._currentValue ;
891
- return value;
892
- }
893
-
894
- var currentRequest = null;
895
- function prepareToUseHooksForRequest(request) {
896
- currentRequest = request;
897
- }
898
- function resetHooksForRequest() {
899
- currentRequest = null;
900
- }
901
-
902
- function readContext$1(context) {
903
- {
904
- if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
905
- error('Only ServerContext is supported in Flight');
906
- }
907
-
908
- if (currentCache === null) {
909
- error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
910
- }
911
- }
912
-
913
- return readContext(context);
914
- }
915
-
916
- var Dispatcher = {
917
- useMemo: function (nextCreate) {
918
- return nextCreate();
919
- },
920
- useCallback: function (callback) {
921
- return callback;
922
- },
923
- useDebugValue: function () {},
924
- useDeferredValue: unsupportedHook,
925
- useTransition: unsupportedHook,
926
- getCacheForType: function (resourceType) {
927
- if (!currentCache) {
928
- throw new Error('Reading the cache is only supported while rendering.');
929
- }
930
-
931
- var entry = currentCache.get(resourceType);
932
-
933
- if (entry === undefined) {
934
- entry = resourceType(); // TODO: Warn if undefined?
935
-
936
- currentCache.set(resourceType, entry);
937
- }
938
-
939
- return entry;
940
- },
941
- readContext: readContext$1,
942
- useContext: readContext$1,
943
- useReducer: unsupportedHook,
944
- useRef: unsupportedHook,
945
- useState: unsupportedHook,
946
- useInsertionEffect: unsupportedHook,
947
- useLayoutEffect: unsupportedHook,
948
- useImperativeHandle: unsupportedHook,
949
- useEffect: unsupportedHook,
950
- useId: useId,
951
- useMutableSource: unsupportedHook,
952
- useSyncExternalStore: unsupportedHook,
953
- useCacheRefresh: function () {
954
- return unsupportedRefresh;
955
- }
956
- };
957
-
958
- function unsupportedHook() {
959
- throw new Error('This Hook is not supported in Server Components.');
960
- }
961
-
962
- function unsupportedRefresh() {
963
- if (!currentCache) {
964
- throw new Error('Refreshing the cache is not supported in Server Components.');
965
- }
966
- }
967
-
968
- var currentCache = null;
969
- function setCurrentCache(cache) {
970
- currentCache = cache;
971
- return currentCache;
972
- }
973
- function getCurrentCache() {
974
- return currentCache;
975
- }
976
-
977
- function useId() {
978
- if (currentRequest === null) {
979
- throw new Error('useId can only be used while React is rendering');
980
- }
981
-
982
- var id = currentRequest.identifierCount++; // use 'S' for Flight components to distinguish from 'R' and 'r' in Fizz/Client
983
-
984
- return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
985
- }
986
-
987
- var ContextRegistry = ReactSharedInternals.ContextRegistry;
988
- function getOrCreateServerContext(globalName) {
989
- if (!ContextRegistry[globalName]) {
990
- ContextRegistry[globalName] = React.createServerContext(globalName, REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED);
991
- }
992
-
993
- return ContextRegistry[globalName];
994
- }
995
-
996
- var PENDING = 0;
997
- var COMPLETED = 1;
998
- var ABORTED = 3;
999
- var ERRORED = 4;
1000
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
1001
-
1002
- function defaultErrorHandler(error) {
1003
- console['error'](error); // Don't transform to our wrapper
1004
- }
1005
-
1006
- var OPEN = 0;
1007
- var CLOSING = 1;
1008
- var CLOSED = 2;
1009
- function createRequest(model, bundlerConfig, onError, context, identifierPrefix) {
1010
- var abortSet = new Set();
1011
- var pingedTasks = [];
1012
- var request = {
1013
- status: OPEN,
1014
- fatalError: null,
1015
- destination: null,
1016
- bundlerConfig: bundlerConfig,
1017
- cache: new Map(),
1018
- nextChunkId: 0,
1019
- pendingChunks: 0,
1020
- abortableTasks: abortSet,
1021
- pingedTasks: pingedTasks,
1022
- completedModuleChunks: [],
1023
- completedJSONChunks: [],
1024
- completedErrorChunks: [],
1025
- writtenSymbols: new Map(),
1026
- writtenModules: new Map(),
1027
- writtenProviders: new Map(),
1028
- identifierPrefix: identifierPrefix || '',
1029
- identifierCount: 1,
1030
- onError: onError === undefined ? defaultErrorHandler : onError,
1031
- toJSON: function (key, value) {
1032
- return resolveModelToJSON(request, this, key, value);
1033
- }
1034
- };
1035
- request.pendingChunks++;
1036
- var rootContext = createRootContext(context);
1037
- var rootTask = createTask(request, model, rootContext, abortSet);
1038
- pingedTasks.push(rootTask);
1039
- return request;
1040
- }
1041
-
1042
- function createRootContext(reqContext) {
1043
- return importServerContexts(reqContext);
1044
- }
1045
-
1046
- var POP = {};
1047
-
1048
- function attemptResolveElement(type, key, ref, props) {
1049
- if (ref !== null && ref !== undefined) {
1050
- // When the ref moves to the regular props object this will implicitly
1051
- // throw for functions. We could probably relax it to a DEV warning for other
1052
- // cases.
1053
- throw new Error('Refs cannot be used in server components, nor passed to client components.');
1054
- }
1055
-
1056
- if (typeof type === 'function') {
1057
- if (isModuleReference(type)) {
1058
- // This is a reference to a client component.
1059
- return [REACT_ELEMENT_TYPE, type, key, props];
1060
- } // This is a server-side component.
1061
-
1062
-
1063
- return type(props);
1064
- } else if (typeof type === 'string') {
1065
- // This is a host element. E.g. HTML.
1066
- return [REACT_ELEMENT_TYPE, type, key, props];
1067
- } else if (typeof type === 'symbol') {
1068
- if (type === REACT_FRAGMENT_TYPE) {
1069
- // For key-less fragments, we add a small optimization to avoid serializing
1070
- // it as a wrapper.
1071
- // TODO: If a key is specified, we should propagate its key to any children.
1072
- // Same as if a server component has a key.
1073
- return props.children;
1074
- } // This might be a built-in React component. We'll let the client decide.
1075
- // Any built-in works as long as its props are serializable.
1076
-
1077
-
1078
- return [REACT_ELEMENT_TYPE, type, key, props];
1079
- } else if (type != null && typeof type === 'object') {
1080
- if (isModuleReference(type)) {
1081
- // This is a reference to a client component.
1082
- return [REACT_ELEMENT_TYPE, type, key, props];
1083
- }
1084
-
1085
- switch (type.$$typeof) {
1086
- case REACT_LAZY_TYPE:
1087
- {
1088
- var payload = type._payload;
1089
- var init = type._init;
1090
- var wrappedType = init(payload);
1091
- return attemptResolveElement(wrappedType, key, ref, props);
1092
- }
1093
-
1094
- case REACT_FORWARD_REF_TYPE:
1095
- {
1096
- var render = type.render;
1097
- return render(props, undefined);
1098
- }
1099
-
1100
- case REACT_MEMO_TYPE:
1101
- {
1102
- return attemptResolveElement(type.type, key, ref, props);
1103
- }
1104
-
1105
- case REACT_PROVIDER_TYPE:
1106
- {
1107
- pushProvider(type._context, props.value);
1108
-
1109
- {
1110
- var extraKeys = Object.keys(props).filter(function (value) {
1111
- if (value === 'children' || value === 'value') {
1112
- return false;
1113
- }
1114
-
1115
- return true;
1116
- });
1117
-
1118
- if (extraKeys.length !== 0) {
1119
- error('ServerContext can only have a value prop and children. Found: %s', JSON.stringify(extraKeys));
1120
- }
1121
- }
1122
-
1123
- return [REACT_ELEMENT_TYPE, type, key, // Rely on __popProvider being serialized last to pop the provider.
1124
- {
1125
- value: props.value,
1126
- children: props.children,
1127
- __pop: POP
1128
- }];
1129
- }
1130
- }
1131
- }
1132
-
1133
- throw new Error("Unsupported server component type: " + describeValueForErrorMessage(type));
1134
- }
1135
-
1136
- function pingTask(request, task) {
1137
- var pingedTasks = request.pingedTasks;
1138
- pingedTasks.push(task);
1139
-
1140
- if (pingedTasks.length === 1) {
1141
- scheduleWork(function () {
1142
- return performWork(request);
1143
- });
1144
- }
1145
- }
1146
-
1147
- function createTask(request, model, context, abortSet) {
1148
- var id = request.nextChunkId++;
1149
- var task = {
1150
- id: id,
1151
- status: PENDING,
1152
- model: model,
1153
- context: context,
1154
- ping: function () {
1155
- return pingTask(request, task);
1156
- }
1157
- };
1158
- abortSet.add(task);
1159
- return task;
1160
- }
1161
-
1162
- function serializeByValueID(id) {
1163
- return '$' + id.toString(16);
1164
- }
1165
-
1166
- function serializeByRefID(id) {
1167
- return '@' + id.toString(16);
1168
- }
1169
-
1170
- function escapeStringValue(value) {
1171
- if (value[0] === '$' || value[0] === '@') {
1172
- // We need to escape $ or @ prefixed strings since we use those to encode
1173
- // references to IDs and as special symbol values.
1174
- return '$' + value;
1175
- } else {
1176
- return value;
1177
- }
1178
- }
1179
-
1180
- function isObjectPrototype(object) {
1181
- if (!object) {
1182
- return false;
1183
- }
1184
-
1185
- var ObjectPrototype = Object.prototype;
1186
-
1187
- if (object === ObjectPrototype) {
1188
- return true;
1189
- } // It might be an object from a different Realm which is
1190
- // still just a plain simple object.
1191
-
1192
-
1193
- if (Object.getPrototypeOf(object)) {
1194
- return false;
1195
- }
1196
-
1197
- var names = Object.getOwnPropertyNames(object);
1198
-
1199
- for (var i = 0; i < names.length; i++) {
1200
- if (!(names[i] in ObjectPrototype)) {
1201
- return false;
1202
- }
1203
- }
1204
-
1205
- return true;
1206
- }
1207
-
1208
- function isSimpleObject(object) {
1209
- if (!isObjectPrototype(Object.getPrototypeOf(object))) {
1210
- return false;
1211
- }
1212
-
1213
- var names = Object.getOwnPropertyNames(object);
1214
-
1215
- for (var i = 0; i < names.length; i++) {
1216
- var descriptor = Object.getOwnPropertyDescriptor(object, names[i]);
1217
-
1218
- if (!descriptor) {
1219
- return false;
1220
- }
1221
-
1222
- if (!descriptor.enumerable) {
1223
- if ((names[i] === 'key' || names[i] === 'ref') && typeof descriptor.get === 'function') {
1224
- // React adds key and ref getters to props objects to issue warnings.
1225
- // Those getters will not be transferred to the client, but that's ok,
1226
- // so we'll special case them.
1227
- continue;
1228
- }
1229
-
1230
- return false;
1231
- }
1232
- }
1233
-
1234
- return true;
1235
- }
1236
-
1237
- function objectName(object) {
1238
- var name = Object.prototype.toString.call(object);
1239
- return name.replace(/^\[object (.*)\]$/, function (m, p0) {
1240
- return p0;
1241
- });
1242
- }
1243
-
1244
- function describeKeyForErrorMessage(key) {
1245
- var encodedKey = JSON.stringify(key);
1246
- return '"' + key + '"' === encodedKey ? key : encodedKey;
1247
- }
1248
-
1249
- function describeValueForErrorMessage(value) {
1250
- switch (typeof value) {
1251
- case 'string':
1252
- {
1253
- return JSON.stringify(value.length <= 10 ? value : value.substr(0, 10) + '...');
1254
- }
1255
-
1256
- case 'object':
1257
- {
1258
- if (isArray(value)) {
1259
- return '[...]';
1260
- }
1261
-
1262
- var name = objectName(value);
1263
-
1264
- if (name === 'Object') {
1265
- return '{...}';
1266
- }
1267
-
1268
- return name;
1269
- }
1270
-
1271
- case 'function':
1272
- return 'function';
1273
-
1274
- default:
1275
- // eslint-disable-next-line react-internal/safe-string-coercion
1276
- return String(value);
1277
- }
1278
- }
1279
-
1280
- function describeObjectForErrorMessage(objectOrArray, expandedName) {
1281
- if (isArray(objectOrArray)) {
1282
- var str = '[';
1283
- var array = objectOrArray;
1284
-
1285
- for (var i = 0; i < array.length; i++) {
1286
- if (i > 0) {
1287
- str += ', ';
1288
- }
1289
-
1290
- if (i > 6) {
1291
- str += '...';
1292
- break;
1293
- }
1294
-
1295
- var _value = array[i];
1296
-
1297
- if ('' + i === expandedName && typeof _value === 'object' && _value !== null) {
1298
- str += describeObjectForErrorMessage(_value);
1299
- } else {
1300
- str += describeValueForErrorMessage(_value);
1301
- }
1302
- }
1303
-
1304
- str += ']';
1305
- return str;
1306
- } else {
1307
- var _str = '{';
1308
- var object = objectOrArray;
1309
- var names = Object.keys(object);
1310
-
1311
- for (var _i = 0; _i < names.length; _i++) {
1312
- if (_i > 0) {
1313
- _str += ', ';
1314
- }
1315
-
1316
- if (_i > 6) {
1317
- _str += '...';
1318
- break;
1319
- }
1320
-
1321
- var name = names[_i];
1322
- _str += describeKeyForErrorMessage(name) + ': ';
1323
- var _value2 = object[name];
1324
-
1325
- if (name === expandedName && typeof _value2 === 'object' && _value2 !== null) {
1326
- _str += describeObjectForErrorMessage(_value2);
1327
- } else {
1328
- _str += describeValueForErrorMessage(_value2);
1329
- }
1330
- }
1331
-
1332
- _str += '}';
1333
- return _str;
1334
- }
1335
- }
1336
-
1337
- var insideContextProps = null;
1338
- var isInsideContextValue = false;
1339
- function resolveModelToJSON(request, parent, key, value) {
1340
- {
1341
- // $FlowFixMe
1342
- var originalValue = parent[key];
1343
-
1344
- if (typeof originalValue === 'object' && originalValue !== value) {
1345
- error('Only plain objects can be passed to client components from server components. ' + 'Objects with toJSON methods are not supported. Convert it manually ' + 'to a simple value before passing it to props. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
1346
- }
1347
- } // Special Symbols
1348
-
1349
-
1350
- switch (value) {
1351
- case REACT_ELEMENT_TYPE:
1352
- return '$';
1353
- }
1354
-
1355
- {
1356
- if (parent[0] === REACT_ELEMENT_TYPE && parent[1] && parent[1].$$typeof === REACT_PROVIDER_TYPE && key === '3') {
1357
- insideContextProps = value;
1358
- } else if (insideContextProps === parent && key === 'value') {
1359
- isInsideContextValue = true;
1360
- } else if (insideContextProps === parent && key === 'children') {
1361
- isInsideContextValue = false;
1362
- }
1363
- } // Resolve server components.
1364
-
1365
-
1366
- while (typeof value === 'object' && value !== null && (value.$$typeof === REACT_ELEMENT_TYPE || value.$$typeof === REACT_LAZY_TYPE)) {
1367
- {
1368
- if (isInsideContextValue) {
1369
- error('React elements are not allowed in ServerContext');
1370
- }
1371
- }
1372
-
1373
- try {
1374
- switch (value.$$typeof) {
1375
- case REACT_ELEMENT_TYPE:
1376
- {
1377
- // TODO: Concatenate keys of parents onto children.
1378
- var element = value; // Attempt to render the server component.
1379
-
1380
- value = attemptResolveElement(element.type, element.key, element.ref, element.props);
1381
- break;
1382
- }
1383
-
1384
- case REACT_LAZY_TYPE:
1385
- {
1386
- var payload = value._payload;
1387
- var init = value._init;
1388
- value = init(payload);
1389
- break;
1390
- }
1391
- }
1392
- } catch (x) {
1393
- if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
1394
- // Something suspended, we'll need to create a new task and resolve it later.
1395
- request.pendingChunks++;
1396
- var newTask = createTask(request, value, getActiveContext(), request.abortableTasks);
1397
- var ping = newTask.ping;
1398
- x.then(ping, ping);
1399
- return serializeByRefID(newTask.id);
1400
- } else {
1401
- logRecoverableError(request, x); // Something errored. We'll still send everything we have up until this point.
1402
- // We'll replace this element with a lazy reference that throws on the client
1403
- // once it gets rendered.
1404
-
1405
- request.pendingChunks++;
1406
- var errorId = request.nextChunkId++;
1407
- emitErrorChunk(request, errorId, x);
1408
- return serializeByRefID(errorId);
1409
- }
1410
- }
1411
- }
1412
-
1413
- if (value == null) {
1414
- return value;
1415
- }
1416
-
1417
- if (typeof value === 'object' || isModuleReference(value)) {
1418
- if (isModuleReference(value)) {
1419
- var moduleReference = value;
1420
- var moduleKey = getModuleKey(moduleReference);
1421
- var writtenModules = request.writtenModules;
1422
- var existingId = writtenModules.get(moduleKey);
1423
-
1424
- if (existingId !== undefined) {
1425
- if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1426
- // If we're encoding the "type" of an element, we can refer
1427
- // to that by a lazy reference instead of directly since React
1428
- // knows how to deal with lazy values. This lets us suspend
1429
- // on this component rather than its parent until the code has
1430
- // loaded.
1431
- return serializeByRefID(existingId);
1432
- }
1433
-
1434
- return serializeByValueID(existingId);
1435
- }
1436
-
1437
- try {
1438
- var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
1439
- request.pendingChunks++;
1440
- var moduleId = request.nextChunkId++;
1441
- emitModuleChunk(request, moduleId, moduleMetaData);
1442
- writtenModules.set(moduleKey, moduleId);
1443
-
1444
- if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1445
- // If we're encoding the "type" of an element, we can refer
1446
- // to that by a lazy reference instead of directly since React
1447
- // knows how to deal with lazy values. This lets us suspend
1448
- // on this component rather than its parent until the code has
1449
- // loaded.
1450
- return serializeByRefID(moduleId);
1451
- }
1452
-
1453
- return serializeByValueID(moduleId);
1454
- } catch (x) {
1455
- request.pendingChunks++;
1456
-
1457
- var _errorId = request.nextChunkId++;
1458
-
1459
- emitErrorChunk(request, _errorId, x);
1460
- return serializeByValueID(_errorId);
1461
- }
1462
- } else if (value.$$typeof === REACT_PROVIDER_TYPE) {
1463
- var providerKey = value._context._globalName;
1464
- var writtenProviders = request.writtenProviders;
1465
- var providerId = writtenProviders.get(key);
1466
-
1467
- if (providerId === undefined) {
1468
- request.pendingChunks++;
1469
- providerId = request.nextChunkId++;
1470
- writtenProviders.set(providerKey, providerId);
1471
- emitProviderChunk(request, providerId, providerKey);
1472
- }
1473
-
1474
- return serializeByValueID(providerId);
1475
- } else if (value === POP) {
1476
- popProvider();
1477
-
1478
- {
1479
- insideContextProps = null;
1480
- isInsideContextValue = false;
1481
- }
1482
-
1483
- return undefined;
1484
- }
1485
-
1486
- {
1487
- if (value !== null && !isArray(value)) {
1488
- // Verify that this is a simple plain object.
1489
- if (objectName(value) !== 'Object') {
1490
- 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));
1491
- } else if (typeof value === 'object' && !isSimpleObject(value)) {
1492
- 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));
1493
- } else if (Object.getOwnPropertySymbols) {
1494
- var symbols = Object.getOwnPropertySymbols(value);
1495
-
1496
- if (symbols.length > 0) {
1497
- error('Only plain objects can be passed to client components from server components. ' + 'Objects with symbol properties like %s are not supported. ' + 'Remove %s from these props: %s', symbols[0].description, describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
1498
- }
1499
- }
1500
- }
1501
- }
1502
-
1503
- return value;
1504
- }
1505
-
1506
- if (typeof value === 'string') {
1507
- return escapeStringValue(value);
1508
- }
1509
-
1510
- if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
1511
- return value;
1512
- }
1513
-
1514
- if (typeof value === 'function') {
1515
- if (/^on[A-Z]/.test(key)) {
1516
- throw new Error('Event handlers cannot be passed to client component props. ' + ("Remove " + describeKeyForErrorMessage(key) + " from these props if possible: " + describeObjectForErrorMessage(parent) + "\n") + 'If you need interactivity, consider converting part of this to a client component.');
1517
- } else {
1518
- throw new Error('Functions cannot be passed directly to client components ' + "because they're not serializable. " + ("Remove " + describeKeyForErrorMessage(key) + " (" + (value.displayName || value.name || 'function') + ") from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1519
- }
1520
- }
1521
-
1522
- if (typeof value === 'symbol') {
1523
- var writtenSymbols = request.writtenSymbols;
1524
-
1525
- var _existingId = writtenSymbols.get(value);
1526
-
1527
- if (_existingId !== undefined) {
1528
- return serializeByValueID(_existingId);
1529
- }
1530
-
1531
- var name = value.description;
1532
-
1533
- if (Symbol.for(name) !== value) {
1534
- throw new Error('Only global symbols received from Symbol.for(...) can be passed to client components. ' + ("The symbol Symbol.for(" + value.description + ") cannot be found among global symbols. ") + ("Remove " + describeKeyForErrorMessage(key) + " from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1535
- }
1536
-
1537
- request.pendingChunks++;
1538
- var symbolId = request.nextChunkId++;
1539
- emitSymbolChunk(request, symbolId, name);
1540
- writtenSymbols.set(value, symbolId);
1541
- return serializeByValueID(symbolId);
1542
- } // $FlowFixMe: bigint isn't added to Flow yet.
1543
-
1544
-
1545
- if (typeof value === 'bigint') {
1546
- throw new Error("BigInt (" + value + ") is not yet supported in client component props. " + ("Remove " + describeKeyForErrorMessage(key) + " from this object or use a plain number instead: " + describeObjectForErrorMessage(parent)));
1547
- }
1548
-
1549
- throw new Error("Type " + typeof value + " is not supported in client component props. " + ("Remove " + describeKeyForErrorMessage(key) + " from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1550
- }
1551
-
1552
- function logRecoverableError(request, error) {
1553
- var onError = request.onError;
1554
- onError(error);
1555
- }
1556
-
1557
- function fatalError(request, error) {
1558
- // This is called outside error handling code such as if an error happens in React internals.
1559
- if (request.destination !== null) {
1560
- request.status = CLOSED;
1561
- closeWithError(request.destination, error);
1562
- } else {
1563
- request.status = CLOSING;
1564
- request.fatalError = error;
1565
- }
1566
- }
1567
-
1568
- function emitErrorChunk(request, id, error) {
1569
- // TODO: We should not leak error messages to the client in prod.
1570
- // Give this an error code instead and log on the server.
1571
- // We can serialize the error in DEV as a convenience.
1572
- var message;
1573
- var stack = '';
1574
-
1575
- try {
1576
- if (error instanceof Error) {
1577
- // eslint-disable-next-line react-internal/safe-string-coercion
1578
- message = String(error.message); // eslint-disable-next-line react-internal/safe-string-coercion
1579
-
1580
- stack = String(error.stack);
1581
- } else {
1582
- message = 'Error: ' + error;
1583
- }
1584
- } catch (x) {
1585
- message = 'An error occurred but serializing the error message failed.';
1586
- }
1587
-
1588
- var processedChunk = processErrorChunk(request, id, message, stack);
1589
- request.completedErrorChunks.push(processedChunk);
1590
- }
1591
-
1592
- function emitModuleChunk(request, id, moduleMetaData) {
1593
- var processedChunk = processModuleChunk(request, id, moduleMetaData);
1594
- request.completedModuleChunks.push(processedChunk);
1595
- }
1596
-
1597
- function emitSymbolChunk(request, id, name) {
1598
- var processedChunk = processSymbolChunk(request, id, name);
1599
- request.completedModuleChunks.push(processedChunk);
1600
- }
1601
-
1602
- function emitProviderChunk(request, id, contextName) {
1603
- var processedChunk = processProviderChunk(request, id, contextName);
1604
- request.completedJSONChunks.push(processedChunk);
1605
- }
1606
-
1607
- function retryTask(request, task) {
1608
- if (task.status !== PENDING) {
1609
- // We completed this by other means before we had a chance to retry it.
1610
- return;
1611
- }
1612
-
1613
- switchContext(task.context);
1614
-
1615
- try {
1616
- var _value3 = task.model;
1617
-
1618
- while (typeof _value3 === 'object' && _value3 !== null && _value3.$$typeof === REACT_ELEMENT_TYPE) {
1619
- // TODO: Concatenate keys of parents onto children.
1620
- var element = _value3; // Attempt to render the server component.
1621
- // Doing this here lets us reuse this same task if the next component
1622
- // also suspends.
1623
-
1624
- task.model = _value3;
1625
- _value3 = attemptResolveElement(element.type, element.key, element.ref, element.props);
1626
- }
1627
-
1628
- var processedChunk = processModelChunk(request, task.id, _value3);
1629
- request.completedJSONChunks.push(processedChunk);
1630
- request.abortableTasks.delete(task);
1631
- task.status = COMPLETED;
1632
- } catch (x) {
1633
- if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
1634
- // Something suspended again, let's pick it back up later.
1635
- var ping = task.ping;
1636
- x.then(ping, ping);
1637
- return;
1638
- } else {
1639
- request.abortableTasks.delete(task);
1640
- task.status = ERRORED;
1641
- logRecoverableError(request, x); // This errored, we need to serialize this error to the
1642
-
1643
- emitErrorChunk(request, task.id, x);
1644
- }
1645
- }
1646
- }
1647
-
1648
- function performWork(request) {
1649
- var prevDispatcher = ReactCurrentDispatcher.current;
1650
- var prevCache = getCurrentCache();
1651
- ReactCurrentDispatcher.current = Dispatcher;
1652
- setCurrentCache(request.cache);
1653
- prepareToUseHooksForRequest(request);
1654
-
1655
- try {
1656
- var pingedTasks = request.pingedTasks;
1657
- request.pingedTasks = [];
1658
-
1659
- for (var i = 0; i < pingedTasks.length; i++) {
1660
- var task = pingedTasks[i];
1661
- retryTask(request, task);
1662
- }
1663
-
1664
- if (request.destination !== null) {
1665
- flushCompletedChunks(request, request.destination);
1666
- }
1667
- } catch (error) {
1668
- logRecoverableError(request, error);
1669
- fatalError(request, error);
1670
- } finally {
1671
- ReactCurrentDispatcher.current = prevDispatcher;
1672
- setCurrentCache(prevCache);
1673
- resetHooksForRequest();
1674
- }
1675
- }
1676
-
1677
- function abortTask(task, request, errorId) {
1678
- task.status = ABORTED; // Instead of emitting an error per task.id, we emit a model that only
1679
- // has a single value referencing the error.
1680
-
1681
- var ref = serializeByValueID(errorId);
1682
- var processedChunk = processReferenceChunk(request, task.id, ref);
1683
- request.completedJSONChunks.push(processedChunk);
1684
- }
1685
-
1686
- function flushCompletedChunks(request, destination) {
1687
- beginWriting();
1688
-
1689
- try {
1690
- // We emit module chunks first in the stream so that
1691
- // they can be preloaded as early as possible.
1692
- var moduleChunks = request.completedModuleChunks;
1693
- var i = 0;
1694
-
1695
- for (; i < moduleChunks.length; i++) {
1696
- request.pendingChunks--;
1697
- var chunk = moduleChunks[i];
1698
- var keepWriting = writeChunkAndReturn(destination, chunk);
1699
-
1700
- if (!keepWriting) {
1701
- request.destination = null;
1702
- i++;
1703
- break;
1704
- }
1705
- }
1706
-
1707
- moduleChunks.splice(0, i); // Next comes model data.
1708
-
1709
- var jsonChunks = request.completedJSONChunks;
1710
- i = 0;
1711
-
1712
- for (; i < jsonChunks.length; i++) {
1713
- request.pendingChunks--;
1714
- var _chunk = jsonChunks[i];
1715
-
1716
- var _keepWriting = writeChunkAndReturn(destination, _chunk);
1717
-
1718
- if (!_keepWriting) {
1719
- request.destination = null;
1720
- i++;
1721
- break;
1722
- }
1723
- }
1724
-
1725
- jsonChunks.splice(0, i); // Finally, errors are sent. The idea is that it's ok to delay
1726
- // any error messages and prioritize display of other parts of
1727
- // the page.
1728
-
1729
- var errorChunks = request.completedErrorChunks;
1730
- i = 0;
1731
-
1732
- for (; i < errorChunks.length; i++) {
1733
- request.pendingChunks--;
1734
- var _chunk2 = errorChunks[i];
1735
-
1736
- var _keepWriting2 = writeChunkAndReturn(destination, _chunk2);
1737
-
1738
- if (!_keepWriting2) {
1739
- request.destination = null;
1740
- i++;
1741
- break;
1742
- }
1743
- }
1744
-
1745
- errorChunks.splice(0, i);
1746
- } finally {
1747
- completeWriting(destination);
1748
- }
1749
-
1750
- if (request.pendingChunks === 0) {
1751
- // We're done.
1752
- close(destination);
1753
- }
1754
- }
1755
-
1756
- function startWork(request) {
1757
- scheduleWork(function () {
1758
- return performWork(request);
1759
- });
1760
- }
1761
- function startFlowing(request, destination) {
1762
- if (request.status === CLOSING) {
1763
- request.status = CLOSED;
1764
- closeWithError(destination, request.fatalError);
1765
- return;
1766
- }
1767
-
1768
- if (request.status === CLOSED) {
1769
- return;
1770
- }
1771
-
1772
- if (request.destination !== null) {
1773
- // We're already flowing.
1774
- return;
1775
- }
1776
-
1777
- request.destination = destination;
1778
-
1779
- try {
1780
- flushCompletedChunks(request, destination);
1781
- } catch (error) {
1782
- logRecoverableError(request, error);
1783
- fatalError(request, error);
1784
- }
1785
- } // This is called to early terminate a request. It creates an error at all pending tasks.
1786
-
1787
- function abort(request, reason) {
1788
- try {
1789
- var abortableTasks = request.abortableTasks;
1790
-
1791
- if (abortableTasks.size > 0) {
1792
- // We have tasks to abort. We'll emit one error row and then emit a reference
1793
- // to that row from every row that's still remaining.
1794
- var _error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
1795
-
1796
- logRecoverableError(request, _error);
1797
- request.pendingChunks++;
1798
- var errorId = request.nextChunkId++;
1799
- emitErrorChunk(request, errorId, _error);
1800
- abortableTasks.forEach(function (task) {
1801
- return abortTask(task, request, errorId);
1802
- });
1803
- abortableTasks.clear();
1804
- }
1805
-
1806
- if (request.destination !== null) {
1807
- flushCompletedChunks(request, request.destination);
1808
- }
1809
- } catch (error) {
1810
- logRecoverableError(request, error);
1811
- fatalError(request, error);
1812
- }
1813
- }
1814
-
1815
- function importServerContexts(contexts) {
1816
- if (contexts) {
1817
- var prevContext = getActiveContext();
1818
- switchContext(rootContextSnapshot);
1819
-
1820
- for (var i = 0; i < contexts.length; i++) {
1821
- var _contexts$i = contexts[i],
1822
- name = _contexts$i[0],
1823
- _value4 = _contexts$i[1];
1824
- var context = getOrCreateServerContext(name);
1825
- pushProvider(context, _value4);
1826
- }
1827
-
1828
- var importedContext = getActiveContext();
1829
- switchContext(prevContext);
1830
- return importedContext;
1831
- }
1832
-
1833
- return rootContextSnapshot;
1834
- }
1835
-
1836
- function renderToReadableStream(model, options) {
1837
- var request = createRequest( // Wrap root in a dummy element that simply adds a flag
1838
- // to the current dispatcher to check later in the proxies.
1839
- assign({}, model, {
1840
- $$typeof: Symbol.for('react.element'),
1841
- props: {
1842
- children: model
1843
- },
1844
- type: function () {
1845
- React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher.current.isRsc = true;
1846
- return model;
1847
- }
1848
- }), {}, // Manifest, not used
1849
- options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
1850
-
1851
- if (options && options.signal) {
1852
- var signal = options.signal;
1853
-
1854
- if (signal.aborted) {
1855
- abort(request, signal.reason);
1856
- } else {
1857
- var listener = function () {
1858
- abort(request, signal.reason);
1859
- signal.removeEventListener('abort', listener);
1860
- };
1861
-
1862
- signal.addEventListener('abort', listener);
1863
- }
1864
- }
1865
-
1866
- var stream = new ReadableStream({
1867
- type: 'bytes',
1868
- start: function (controller) {
1869
- startWork(request);
1870
- },
1871
- pull: function (controller) {
1872
- startFlowing(request, controller);
1873
- },
1874
- cancel: function (reason) {}
1875
- }, // $FlowFixMe size() methods are not allowed on byte streams.
1876
- {
1877
- highWaterMark: 0
1878
- });
1879
- return stream;
1880
- }
1881
-
1882
- exports.renderToReadableStream = renderToReadableStream;
1883
- })();
1884
- }