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