@shopify/hydrogen 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +207 -0
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +5 -5
- package/dist/esnext/components/CartLines/{CartLines.d.ts → CartLines.client.d.ts} +0 -0
- package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +0 -0
- package/dist/esnext/components/CartLines/index.d.ts +1 -1
- package/dist/esnext/components/CartLines/index.js +1 -1
- package/dist/esnext/components/DevTools.client.js +1 -1
- package/dist/esnext/components/Image/Image.d.ts +8 -0
- package/dist/esnext/components/Image/Image.js +58 -10
- package/dist/esnext/components/Link/Link.client.d.ts +2 -0
- package/dist/esnext/components/Link/Link.client.js +7 -4
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +1 -1
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +140 -0
- package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
- package/dist/esnext/components/{ProductProvider → ProductOptionsProvider}/context.js +0 -1
- package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
- package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
- package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -2
- package/dist/esnext/components/ProductPrice/ProductPrice.client.js +10 -12
- package/dist/esnext/components/index.d.ts +1 -1
- package/dist/esnext/components/index.js +1 -1
- package/dist/esnext/entry-client.js +106 -6
- package/dist/esnext/entry-server.d.ts +2 -15
- package/dist/esnext/entry-server.js +245 -321
- package/dist/esnext/foundation/Analytics/Analytics.client.js +15 -13
- package/dist/esnext/foundation/Analytics/Analytics.server.js +27 -20
- package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +4 -2
- package/dist/esnext/foundation/Analytics/ClientAnalytics.js +15 -13
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.server.d.ts +1 -0
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/{PerformanceMetrics.server.js → ServerAnalyticsConnector.server.js} +7 -6
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.d.ts +1 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.js +19 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +190 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +24 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +28 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +51 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
- package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
- package/dist/esnext/foundation/Analytics/hook.js +4 -2
- package/dist/esnext/foundation/Analytics/utils.d.ts +2 -0
- package/dist/esnext/foundation/Analytics/utils.js +21 -0
- package/dist/{node/framework → esnext/foundation/Cache}/cache-sub-request.d.ts +1 -1
- package/dist/esnext/{framework → foundation/Cache}/cache-sub-request.js +3 -3
- package/dist/esnext/{framework → foundation/Cache}/cache.d.ts +1 -1
- package/dist/esnext/{framework → foundation/Cache}/cache.js +3 -3
- package/dist/{node/framework/CachingStrategy → esnext/foundation/Cache/strategies}/index.d.ts +1 -1
- package/dist/esnext/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +0 -0
- package/dist/esnext/foundation/Cookie/Cookie.d.ts +3 -3
- package/dist/{node/framework/Hydration → esnext/foundation/Html}/Html.d.ts +3 -1
- package/dist/esnext/{framework/Hydration → foundation/Html}/Html.js +15 -2
- package/dist/{node/framework/Hydration/ServerComponentRequest.server.d.ts → esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +7 -3
- package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +1 -1
- package/dist/{node/framework/Hydration/ServerComponentResponse.server.d.ts → esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +7 -10
- package/dist/esnext/{framework/Hydration/ServerComponentResponse.server.js → foundation/HydrogenResponse/HydrogenResponse.server.js} +19 -15
- package/dist/esnext/foundation/Router/BrowserRouter.client.js +16 -9
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +4 -4
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +2 -2
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +1 -1
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +1 -1
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +1 -0
- package/dist/esnext/foundation/index.d.ts +1 -1
- package/dist/esnext/foundation/index.js +1 -1
- package/dist/esnext/foundation/runtime.d.ts +2 -0
- package/dist/esnext/foundation/runtime.js +6 -0
- package/dist/esnext/foundation/session/session.d.ts +3 -3
- package/dist/esnext/foundation/ssr-interop.d.ts +2 -2
- package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +2 -0
- package/dist/esnext/foundation/useNavigate/useNavigate.js +11 -4
- package/dist/esnext/foundation/useQuery/hooks.js +9 -6
- package/dist/esnext/framework/Hydration/rsc.js +2 -0
- package/dist/esnext/framework/plugin.js +2 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +5 -2
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +1 -1
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +4 -12
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
- package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +2 -2
- package/dist/esnext/hooks/useProductOptions/types.d.ts +16 -14
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -15
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +8 -107
- package/dist/esnext/hooks/useShopQuery/hooks.js +12 -6
- package/dist/esnext/index.d.ts +6 -3
- package/dist/esnext/index.js +6 -3
- package/dist/esnext/streaming.server.d.ts +0 -1
- package/dist/esnext/streaming.server.js +0 -4
- package/dist/esnext/types.d.ts +32 -23
- package/dist/esnext/utilities/apiRoutes.d.ts +2 -2
- package/dist/esnext/utilities/graphql-tracker.js +1 -1
- package/dist/esnext/utilities/index.d.ts +1 -1
- package/dist/esnext/utilities/index.js +1 -1
- package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
- package/dist/esnext/utilities/isBrowser/index.js +1 -0
- package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
- package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
- package/dist/esnext/utilities/isServer/isServer.js +2 -2
- package/dist/esnext/utilities/log/index.d.ts +1 -1
- package/dist/esnext/utilities/log/index.js +1 -1
- package/dist/esnext/utilities/log/log-cache-header.d.ts +4 -4
- package/dist/esnext/utilities/log/log-query-timeline.d.ts +3 -3
- package/dist/esnext/utilities/log/log.d.ts +17 -11
- package/dist/esnext/utilities/log/log.js +29 -20
- package/dist/esnext/version.d.ts +1 -1
- package/dist/esnext/version.js +1 -1
- package/dist/node/client.d.ts +16 -0
- package/dist/node/client.js +43 -0
- package/dist/node/components/AddToCartButton/AddToCartButton.client.d.ts +23 -0
- package/dist/node/components/AddToCartButton/AddToCartButton.client.js +74 -0
- package/dist/node/components/AddToCartButton/index.d.ts +1 -0
- package/dist/node/components/AddToCartButton/index.js +5 -0
- package/dist/node/components/BuyNowButton/BuyNowButton.client.d.ts +18 -0
- package/dist/node/components/BuyNowButton/BuyNowButton.client.js +53 -0
- package/dist/node/components/BuyNowButton/index.d.ts +1 -0
- package/dist/node/components/BuyNowButton/index.js +5 -0
- package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +11 -0
- package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.js +44 -0
- package/dist/node/components/CartCheckoutButton/index.d.ts +1 -0
- package/dist/node/components/CartCheckoutButton/index.js +5 -0
- package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +14 -0
- package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.js +36 -0
- package/dist/node/components/CartEstimatedCost/index.d.ts +1 -0
- package/dist/node/components/CartEstimatedCost/index.js +5 -0
- package/dist/node/components/CartLineImage/CartLineImage.client.d.ts +9 -0
- package/dist/node/components/CartLineImage/CartLineImage.client.js +18 -0
- package/dist/node/components/CartLineImage/index.d.ts +1 -0
- package/dist/node/components/CartLineImage/index.js +5 -0
- package/dist/node/components/CartLinePrice/CartLinePrice.client.d.ts +12 -0
- package/dist/node/components/CartLinePrice/CartLinePrice.client.js +28 -0
- package/dist/node/components/CartLinePrice/index.d.ts +1 -0
- package/dist/node/components/CartLinePrice/index.js +5 -0
- package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -0
- package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.js +19 -0
- package/dist/node/components/CartLineProductTitle/index.d.ts +1 -0
- package/dist/node/components/CartLineProductTitle/index.js +5 -0
- package/dist/node/components/CartLineProvider/CartLineProvider.client.d.ts +11 -0
- package/dist/node/components/CartLineProvider/CartLineProvider.client.js +15 -0
- package/dist/node/components/CartLineProvider/context.d.ts +26 -0
- package/dist/node/components/CartLineProvider/context.js +5 -0
- package/dist/node/components/CartLineProvider/index.d.ts +2 -0
- package/dist/node/components/CartLineProvider/index.js +7 -0
- package/dist/node/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -0
- package/dist/node/components/CartLineQuantity/CartLineQuantity.client.js +19 -0
- package/dist/node/components/CartLineQuantity/index.d.ts +1 -0
- package/dist/node/components/CartLineQuantity/index.js +5 -0
- package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +14 -0
- package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +31 -0
- package/dist/node/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
- package/dist/node/components/CartLineQuantityAdjustButton/index.js +5 -0
- package/dist/node/components/CartLines/CartLines.client.d.ts +15 -0
- package/dist/node/components/CartLines/CartLines.client.js +44 -0
- package/dist/node/components/CartLines/index.d.ts +1 -0
- package/dist/node/components/CartLines/index.js +5 -0
- package/dist/node/components/CartProvider/CartProvider.client.d.ts +41 -0
- package/dist/node/components/CartProvider/CartProvider.client.js +550 -0
- package/dist/node/components/CartProvider/cart-queries.d.ts +10 -0
- package/dist/node/components/CartProvider/cart-queries.js +203 -0
- package/dist/node/components/CartProvider/constants.d.ts +2 -0
- package/dist/node/components/CartProvider/constants.js +5 -0
- package/dist/node/components/CartProvider/context.d.ts +2 -0
- package/dist/node/components/CartProvider/context.js +5 -0
- package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartCreateMutation.d.ts +85 -0
- package/dist/node/components/CartProvider/graphql/CartCreateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartFragment.d.ts +72 -0
- package/dist/node/components/CartProvider/graphql/CartFragment.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartLineAddMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartLineAddMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +86 -0
- package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartQuery.d.ts +81 -0
- package/dist/node/components/CartProvider/graphql/CartQuery.js +2 -0
- package/dist/node/components/CartProvider/hooks.client.d.ts +15 -0
- package/dist/node/components/CartProvider/hooks.client.js +90 -0
- package/dist/node/components/CartProvider/index.d.ts +4 -0
- package/dist/node/components/CartProvider/index.js +10 -0
- package/dist/node/components/CartProvider/types.d.ts +102 -0
- package/dist/node/components/CartProvider/types.js +2 -0
- package/dist/node/components/CartShopPayButton/CartShopPayButton.client.d.ts +9 -0
- package/dist/node/components/CartShopPayButton/CartShopPayButton.client.js +46 -0
- package/dist/node/components/CartShopPayButton/index.d.ts +1 -0
- package/dist/node/components/CartShopPayButton/index.js +5 -0
- package/dist/node/components/ExternalVideo/ExternalVideo.d.ts +21 -0
- package/dist/node/components/ExternalVideo/ExternalVideo.js +21 -0
- package/dist/node/components/ExternalVideo/index.d.ts +1 -0
- package/dist/node/components/ExternalVideo/index.js +5 -0
- package/dist/node/components/Image/Image.d.ts +8 -0
- package/dist/node/components/Image/Image.js +57 -9
- package/dist/node/components/Link/Link.client.d.ts +25 -0
- package/dist/node/components/Link/Link.client.js +165 -0
- package/dist/node/components/Link/index.d.ts +1 -0
- package/dist/node/components/Link/index.js +5 -0
- package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
- package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.js +11 -0
- package/dist/node/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -0
- package/dist/node/components/LocalizationProvider/LocalizationContext.client.js +5 -0
- package/dist/node/components/LocalizationProvider/LocalizationProvider.server.d.ts +33 -0
- package/dist/node/components/LocalizationProvider/LocalizationProvider.server.js +51 -0
- package/dist/node/components/MediaFile/MediaFile.d.ts +19 -0
- package/dist/node/components/MediaFile/MediaFile.js +39 -0
- package/dist/node/components/MediaFile/index.d.ts +1 -0
- package/dist/node/components/MediaFile/index.js +5 -0
- package/dist/node/components/Metafield/Metafield.client.d.ts +21 -0
- package/dist/node/components/Metafield/Metafield.client.js +75 -0
- package/dist/node/components/Metafield/index.d.ts +2 -0
- package/dist/node/components/Metafield/index.js +5 -0
- package/dist/node/components/Metafield/types.d.ts +4 -0
- package/dist/node/components/Metafield/types.js +2 -0
- package/dist/node/components/ModelViewer/ModelViewer.client.d.ts +128 -0
- package/dist/node/components/ModelViewer/ModelViewer.client.js +132 -0
- package/dist/node/components/ModelViewer/index.d.ts +1 -0
- package/dist/node/components/ModelViewer/index.js +5 -0
- package/dist/node/components/Money/Money.client.d.ts +25 -0
- package/dist/node/components/Money/Money.client.js +46 -0
- package/dist/node/components/Money/index.d.ts +1 -0
- package/dist/node/components/Money/index.js +5 -0
- package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
- package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.js +167 -0
- package/dist/node/components/ProductOptionsProvider/context.d.ts +2 -0
- package/dist/node/components/ProductOptionsProvider/context.js +5 -0
- package/dist/node/components/ProductOptionsProvider/index.d.ts +2 -0
- package/dist/node/components/ProductOptionsProvider/index.js +7 -0
- package/dist/node/components/ProductPrice/ProductPrice.client.d.ts +18 -0
- package/dist/node/components/ProductPrice/ProductPrice.client.js +61 -0
- package/dist/node/components/ProductPrice/index.d.ts +1 -0
- package/dist/node/components/ProductPrice/index.js +5 -0
- package/dist/node/components/Seo/CollectionSeo.client.d.ts +3 -0
- package/dist/node/components/Seo/CollectionSeo.client.js +22 -0
- package/dist/node/components/Seo/DefaultPageSeo.client.d.ts +3 -0
- package/dist/node/components/Seo/DefaultPageSeo.client.js +25 -0
- package/dist/node/components/Seo/DescriptionSeo.client.d.ts +4 -0
- package/dist/node/components/Seo/DescriptionSeo.client.js +17 -0
- package/dist/node/components/Seo/HomePageSeo.client.d.ts +2 -0
- package/dist/node/components/Seo/HomePageSeo.client.js +32 -0
- package/dist/node/components/Seo/ImageSeo.client.d.ts +3 -0
- package/dist/node/components/Seo/ImageSeo.client.js +17 -0
- package/dist/node/components/Seo/NoIndexSeo.client.d.ts +3 -0
- package/dist/node/components/Seo/NoIndexSeo.client.js +17 -0
- package/dist/node/components/Seo/PageSeo.client.d.ts +3 -0
- package/dist/node/components/Seo/PageSeo.client.js +20 -0
- package/dist/node/components/Seo/ProductSeo.client.d.ts +5 -0
- package/dist/node/components/Seo/ProductSeo.client.js +70 -0
- package/dist/node/components/Seo/Seo.client.d.ts +30 -0
- package/dist/node/components/Seo/Seo.client.js +38 -0
- package/dist/node/components/Seo/TitleSeo.client.d.ts +3 -0
- package/dist/node/components/Seo/TitleSeo.client.js +17 -0
- package/dist/node/components/Seo/TwitterSeo.client.d.ts +2 -0
- package/dist/node/components/Seo/TwitterSeo.client.js +16 -0
- package/dist/node/components/Seo/index.d.ts +1 -0
- package/dist/node/components/Seo/index.js +5 -0
- package/dist/node/components/Seo/seo-types.d.ts +17 -0
- package/dist/node/components/Seo/seo-types.js +2 -0
- package/dist/node/components/ShopPayButton/ShopPayButton.client.d.ts +38 -0
- package/dist/node/components/ShopPayButton/ShopPayButton.client.js +60 -0
- package/dist/node/components/ShopPayButton/index.d.ts +1 -0
- package/dist/node/components/ShopPayButton/index.js +5 -0
- package/dist/node/components/Video/Video.d.ts +14 -0
- package/dist/node/components/Video/Video.js +31 -0
- package/dist/node/components/Video/index.d.ts +1 -0
- package/dist/node/components/Video/index.js +5 -0
- package/dist/node/components/index.d.ts +28 -0
- package/dist/node/components/index.js +59 -0
- package/dist/node/components/types.d.ts +71 -0
- package/dist/node/components/types.js +11 -0
- package/dist/node/entry-server.d.ts +2 -15
- package/dist/node/entry-server.js +244 -320
- package/dist/node/foundation/Analytics/Analytics.client.js +15 -13
- package/dist/node/foundation/Analytics/Analytics.server.js +27 -20
- package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +4 -2
- package/dist/node/foundation/Analytics/ClientAnalytics.js +14 -12
- package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
- package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
- package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +68 -0
- package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
- package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +27 -0
- package/dist/node/foundation/Analytics/hook.js +4 -2
- package/dist/node/foundation/Analytics/index.d.ts +1 -0
- package/dist/node/foundation/Analytics/index.js +5 -0
- package/dist/node/foundation/Analytics/utils.d.ts +2 -0
- package/dist/node/foundation/Analytics/utils.js +24 -1
- package/dist/{esnext/framework → node/foundation/Cache}/cache-sub-request.d.ts +1 -1
- package/dist/node/{framework → foundation/Cache}/cache-sub-request.js +4 -4
- package/dist/node/{framework → foundation/Cache}/cache.d.ts +1 -1
- package/dist/node/{framework → foundation/Cache}/cache.js +5 -5
- package/dist/{esnext/framework/CachingStrategy → node/foundation/Cache/strategies}/index.d.ts +1 -1
- package/dist/node/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +0 -0
- package/dist/node/foundation/Head/Head.client.d.ts +5 -0
- package/dist/node/foundation/Head/Head.client.js +17 -0
- package/dist/node/foundation/Head/index.d.ts +1 -0
- package/dist/node/foundation/Head/index.js +5 -0
- package/dist/{esnext/framework/Hydration → node/foundation/Html}/Html.d.ts +3 -1
- package/dist/node/{framework/Hydration → foundation/Html}/Html.js +15 -2
- package/dist/{esnext/framework/Hydration/ServerComponentRequest.server.d.ts → node/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +7 -3
- package/dist/node/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +3 -3
- package/dist/{esnext/framework/Hydration/ServerComponentResponse.server.d.ts → node/foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +7 -10
- package/dist/node/{framework/Hydration/ServerComponentResponse.server.js → foundation/HydrogenResponse/HydrogenResponse.server.js} +23 -19
- package/dist/node/foundation/Router/BrowserRouter.client.js +16 -9
- package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
- package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
- package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +4 -4
- package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +2 -2
- package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.js +35 -0
- package/dist/node/foundation/ShopifyProvider/index.d.ts +1 -0
- package/dist/node/foundation/ShopifyProvider/index.js +5 -0
- package/dist/node/foundation/fetchSync/client/fetchSync.d.ts +10 -0
- package/dist/node/foundation/fetchSync/client/fetchSync.js +33 -0
- package/dist/node/foundation/fetchSync/server/fetchSync.d.ts +8 -0
- package/dist/node/foundation/fetchSync/server/fetchSync.js +33 -0
- package/dist/node/foundation/fetchSync/types.d.ts +5 -0
- package/dist/node/foundation/fetchSync/types.js +2 -0
- package/dist/node/foundation/index.d.ts +3 -0
- package/dist/node/foundation/index.js +10 -0
- package/dist/node/foundation/runtime.d.ts +2 -0
- package/dist/node/foundation/runtime.js +11 -0
- package/dist/node/foundation/session/session.d.ts +3 -3
- package/dist/node/foundation/ssr-interop.d.ts +2 -2
- package/dist/node/foundation/useNavigate/useNavigate.d.ts +2 -0
- package/dist/node/foundation/useNavigate/useNavigate.js +11 -4
- package/dist/node/foundation/useQuery/hooks.d.ts +36 -0
- package/dist/node/foundation/useQuery/hooks.js +104 -0
- package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.d.ts +10 -0
- package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.js +34 -0
- package/dist/node/foundation/useRouteParams/useRouteParams.d.ts +4 -0
- package/dist/node/foundation/useRouteParams/useRouteParams.js +13 -0
- package/dist/node/foundation/useServerProps/index.d.ts +1 -0
- package/dist/node/foundation/useServerProps/index.js +5 -0
- package/dist/node/foundation/useSession/useSession.d.ts +2 -0
- package/dist/node/foundation/useSession/useSession.js +12 -0
- package/dist/node/foundation/useShop/index.d.ts +1 -0
- package/dist/node/foundation/useShop/index.js +5 -0
- package/dist/node/foundation/useShop/use-shop.d.ts +6 -0
- package/dist/node/foundation/useShop/use-shop.js +18 -0
- package/dist/node/foundation/useUrl/index.d.ts +1 -0
- package/dist/node/foundation/useUrl/index.js +5 -0
- package/dist/node/foundation/useUrl/useUrl.d.ts +4 -0
- package/dist/node/foundation/useUrl/useUrl.js +32 -0
- package/dist/node/framework/Hydration/rsc.js +2 -0
- package/dist/node/framework/plugin.js +2 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +5 -2
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +1 -1
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +4 -12
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
- package/dist/node/hooks/index.d.ts +6 -0
- package/dist/node/hooks/index.js +28 -0
- package/dist/node/hooks/useCart/index.d.ts +1 -0
- package/dist/node/hooks/useCart/index.js +5 -0
- package/dist/node/hooks/useCart/useCart.d.ts +4 -0
- package/dist/node/hooks/useCart/useCart.js +19 -0
- package/dist/node/hooks/useCartLine/index.d.ts +1 -0
- package/dist/node/hooks/useCartLine/index.js +5 -0
- package/dist/node/hooks/useCartLine/useCartLine.d.ts +29 -0
- package/dist/node/hooks/useCartLine/useCartLine.js +16 -0
- package/dist/node/hooks/useCountry/index.d.ts +1 -0
- package/dist/node/hooks/useCountry/index.js +5 -0
- package/dist/node/hooks/useCountry/useCountry.d.ts +7 -0
- package/dist/node/hooks/useCountry/useCountry.js +21 -0
- package/dist/node/hooks/useLoadScript/index.d.ts +1 -0
- package/dist/node/hooks/useLoadScript/index.js +5 -0
- package/dist/node/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
- package/dist/node/hooks/useLoadScript/useLoadScript.client.js +27 -0
- package/dist/node/hooks/useMeasurement/hooks.d.ts +9 -0
- package/dist/node/hooks/useMeasurement/hooks.js +17 -0
- package/dist/node/hooks/useMeasurement/index.d.ts +1 -0
- package/dist/node/hooks/useMeasurement/index.js +5 -0
- package/dist/node/hooks/useMoney/hooks.d.ts +54 -0
- package/dist/node/hooks/useMoney/hooks.js +70 -0
- package/dist/node/hooks/useMoney/index.d.ts +1 -0
- package/dist/node/hooks/useMoney/index.js +5 -0
- package/dist/node/hooks/useParsedMetafields/index.d.ts +1 -0
- package/dist/node/hooks/useParsedMetafields/index.js +5 -0
- package/dist/node/hooks/useParsedMetafields/useParsedMetafields.d.ts +21 -0
- package/dist/node/hooks/useParsedMetafields/useParsedMetafields.js +25 -0
- package/dist/node/hooks/useProductOptions/helpers.d.ts +6 -0
- package/dist/node/hooks/useProductOptions/helpers.js +46 -0
- package/dist/node/hooks/useProductOptions/index.d.ts +2 -0
- package/dist/node/hooks/useProductOptions/index.js +20 -0
- package/dist/node/hooks/useProductOptions/types.d.ts +44 -0
- package/dist/node/hooks/useProductOptions/types.js +2 -0
- package/dist/node/hooks/useProductOptions/useProductOptions.client.d.ts +1 -0
- package/dist/node/hooks/useProductOptions/useProductOptions.client.js +13 -0
- package/dist/node/hooks/useShopQuery/hooks.d.ts +28 -0
- package/dist/node/hooks/useShopQuery/hooks.js +171 -0
- package/dist/node/hooks/useShopQuery/index.d.ts +1 -0
- package/dist/node/hooks/useShopQuery/index.js +5 -0
- package/dist/node/streaming.server.d.ts +0 -1
- package/dist/node/streaming.server.js +1 -6
- package/dist/node/types.d.ts +32 -23
- package/dist/node/utilities/apiRoutes.d.ts +2 -2
- package/dist/node/utilities/devtools.d.ts +11 -0
- package/dist/node/utilities/devtools.js +15 -0
- package/dist/node/utilities/graphql-tag.d.ts +1 -0
- package/dist/node/utilities/graphql-tag.js +10 -0
- package/dist/node/utilities/graphql-tracker.d.ts +17 -0
- package/dist/node/utilities/graphql-tracker.js +130 -0
- package/dist/node/utilities/index.d.ts +1 -1
- package/dist/node/utilities/index.js +3 -3
- package/dist/node/utilities/isBrowser/index.d.ts +1 -0
- package/dist/node/utilities/isBrowser/index.js +5 -0
- package/dist/node/utilities/isBrowser/isBrowser.d.ts +4 -0
- package/dist/node/utilities/isBrowser/isBrowser.js +10 -0
- package/dist/node/utilities/isServer/isServer.js +2 -2
- package/dist/node/utilities/log/index.d.ts +1 -1
- package/dist/node/utilities/log/index.js +1 -3
- package/dist/node/utilities/log/log-cache-header.d.ts +4 -4
- package/dist/node/utilities/log/log-query-timeline.d.ts +3 -3
- package/dist/node/utilities/log/log.d.ts +17 -11
- package/dist/node/utilities/log/log.js +30 -23
- package/dist/node/version.d.ts +1 -1
- package/dist/node/version.js +1 -1
- package/package.json +3 -1
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +203 -52
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +77 -59
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +30 -30
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +199 -70
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +38 -35
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +9 -8
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +3 -3
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -7
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +204 -53
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +77 -59
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +199 -70
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +9 -8
- package/vendor/react-server-dom-vite/package.json +1 -1
- package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +0 -8
- package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +0 -12
- package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -24
- package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -34
- package/dist/esnext/components/ProductProvider/context.d.ts +0 -29
- package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
- package/dist/esnext/components/ProductProvider/index.js +0 -2
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +0 -1
- package/dist/esnext/framework/config.d.ts +0 -6
- package/dist/esnext/framework/config.js +0 -6
- package/dist/esnext/framework/runtime.d.ts +0 -13
- package/dist/esnext/framework/runtime.js +0 -27
- package/dist/esnext/hooks/useProduct/index.d.ts +0 -1
- package/dist/esnext/hooks/useProduct/index.js +0 -1
- package/dist/esnext/hooks/useProduct/useProduct.d.ts +0 -52
- package/dist/esnext/hooks/useProduct/useProduct.js +0 -43
- package/dist/esnext/utilities/isClient/index.d.ts +0 -1
- package/dist/esnext/utilities/isClient/index.js +0 -1
- package/dist/esnext/utilities/isClient/isClient.d.ts +0 -4
- package/dist/esnext/utilities/isClient/isClient.js +0 -6
- package/dist/node/framework/config.d.ts +0 -6
- package/dist/node/framework/config.js +0 -11
- package/dist/node/framework/runtime.d.ts +0 -13
- package/dist/node/framework/runtime.js +0 -35
- package/dist/node/utilities/defer.d.ts +0 -6
- package/dist/node/utilities/defer.js +0 -18
- package/dist/node/utilities/isClient/index.d.ts +0 -1
- package/dist/node/utilities/isClient/index.js +0 -5
- package/dist/node/utilities/isClient/isClient.d.ts +0 -4
- package/dist/node/utilities/isClient/isClient.js +0 -10
|
@@ -7,40 +7,40 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
'use strict';var e=require("react"),h=null,m=0;function n(a,
|
|
11
|
-
function x(a){return"string"===typeof a
|
|
12
|
-
function C(a,
|
|
10
|
+
'use strict';var e=require("react"),h=null,m=0;function n(a,b){if(0!==b.length)if(512<b.length)0<m&&(a.enqueue(new Uint8Array(h.buffer,0,m)),h=new Uint8Array(512),m=0),a.enqueue(b);else{var d=h.length-m;d<b.length&&(0===d?a.enqueue(h):(h.set(b.subarray(0,d),m),a.enqueue(h),b=b.subarray(d)),h=new Uint8Array(512),m=0);h.set(b,m);m+=b.length}return!0}var p=new TextEncoder;function r(a){return p.encode(a)}function u(a,b){"function"===typeof a.error?a.error(b):a.close()}var w=JSON.stringify,aa=Symbol.for("react.module.reference");
|
|
11
|
+
function x(a){return"string"===typeof a?!!globalThis.__STRING_REFERENCE_INDEX[a]:a.$$typeof===aa}var y=Symbol.for("react.element"),ba=Symbol.for("react.fragment"),z=Symbol.for("react.provider"),ca=Symbol.for("react.forward_ref"),da=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.default_value");
|
|
12
|
+
function C(a,b,d,c,f,g,k){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b;this.sanitizeURL=g;this.removeEmptyString=k}var D="children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ");D.push("innerText","textContent");D.forEach(function(a){new C(a,0,!1,a,null,!1,!1)});
|
|
13
13
|
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new C(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new C(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new C(a,2,!1,a,null,!1,!1)});
|
|
14
14
|
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){new C(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new C(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new C(a,4,!1,a,null,!1,!1)});
|
|
15
15
|
["cols","rows","size","span"].forEach(function(a){new C(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){new C(a,5,!1,a.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function F(a){return a[1].toUpperCase()}
|
|
16
|
-
"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".split(" ").forEach(function(a){var
|
|
17
|
-
F);new C(
|
|
16
|
+
"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".split(" ").forEach(function(a){var b=a.replace(E,
|
|
17
|
+
F);new C(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(E,F);new C(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(E,F);new C(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){new C(a,1,!1,a.toLowerCase(),null,!1,!1)});
|
|
18
18
|
new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){new C(a,1,!1,a.toLowerCase(),null,!0,!0)});
|
|
19
19
|
var G={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,
|
|
20
|
-
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ea=["Webkit","ms","Moz","O"];Object.keys(G).forEach(function(a){ea.forEach(function(
|
|
21
|
-
r("/>");r(' selected=""');r("\n");r("<!DOCTYPE html>");r("</");r(">");r('<template id="');r('"></template>');r("\x3c!--$--\x3e");r('\x3c!--$?--\x3e<template id="');r('"></template>');r("\x3c!--$!--\x3e");r("\x3c!--/$--\x3e");r('<
|
|
22
|
-
r("</tbody></table>");r('<table hidden><tr id="');r('">');r("</tr></table>");r('<table hidden><colgroup id="');r('">');r("</colgroup></table>");r('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)};$RS("');r('$RS("');r('","');r('")\x3c/script>');r('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()}};$RC("');
|
|
23
|
-
r('$RC("');r('","');r('")\x3c/script>');r('function $RX(
|
|
24
|
-
function J(a,
|
|
25
|
-
function L(a){var
|
|
26
|
-
function ha(a,
|
|
20
|
+
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ea=["Webkit","ms","Moz","O"];Object.keys(G).forEach(function(a){ea.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);G[b]=G[a]})});var H=Array.isArray;r("<script>");r("\x3c/script>");r('<script src="');r('<script type="module" src="');r('" async="">\x3c/script>');r("\x3c!-- --\x3e");r(' style="');r(":");r(";");r(" ");r('="');r('"');r('=""');r(">");
|
|
21
|
+
r("/>");r(' selected=""');r("\n");r("<!DOCTYPE html>");r("</");r(">");r('<template id="');r('"></template>');r("\x3c!--$--\x3e");r('\x3c!--$?--\x3e<template id="');r('"></template>');r("\x3c!--$!--\x3e");r("\x3c!--/$--\x3e");r('<template data-hash="');r('" data-msg="');r('" data-stack="');r('"></template>');r('<div hidden id="');r('">');r("</div>");r('<svg aria-hidden="true" style="display:none" id="');r('">');r("</svg>");r('<math aria-hidden="true" style="display:none" id="');r('">');r("</math>");
|
|
22
|
+
r('<table hidden id="');r('">');r("</table>");r('<table hidden><tbody id="');r('">');r("</tbody></table>");r('<table hidden><tr id="');r('">');r("</tr></table>");r('<table hidden><colgroup id="');r('">');r("</colgroup></table>");r('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)};$RS("');r('$RS("');r('","');r('")\x3c/script>');r('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()}};$RC("');
|
|
23
|
+
r('$RC("');r('","');r('")\x3c/script>');r('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.hash=c),d&&(a.msg=d),e&&(a.stack=e),b._reactRetry&&b._reactRetry())};$RX("');r('$RX("');r('"');r(")\x3c/script>");r(",");var I=null;
|
|
24
|
+
function J(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var d=b.parent;if(null===a){if(null!==d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");J(a,d);b.context._currentValue=b.value}}}function K(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&K(a)}
|
|
25
|
+
function L(a){var b=a.parent;null!==b&&L(b);a.context._currentValue=a.value}function fa(a,b){a.context._currentValue=a.parentValue;a=a.parent;if(null===a)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===b.depth?J(a,b):fa(a,b)}
|
|
26
|
+
function ha(a,b){var d=b.parent;if(null===d)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===d.depth?J(a,d):ha(a,d);b.context._currentValue=b.value}function M(a){var b=I;b!==a&&(null===b?L(a):null===a?K(b):b.depth===a.depth?J(b,a):b.depth>a.depth?fa(b,a):ha(b,a),I=a)}function ia(a,b){var d=a._currentValue;a._currentValue=b;var c=I;return I=a={parent:c,depth:null===c?0:c.depth+1,context:a,parentValue:d,value:b}}
|
|
27
27
|
function ja(a){return a._currentValue}
|
|
28
|
-
var ma={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:N,useTransition:N,getCacheForType:function(a){if(!
|
|
29
|
-
function N(){throw Error("This Hook is not supported in Server Components.");}function la(){if(!
|
|
30
|
-
function pa(a,
|
|
31
|
-
function U(a,
|
|
32
|
-
[y,a,
|
|
28
|
+
var ma={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:N,useTransition:N,getCacheForType:function(a){if(!O)throw Error("Reading the cache is only supported while rendering.");var b=O.get(a);void 0===b&&(b=a(),O.set(a,b));return b},readContext:ja,useContext:ja,useReducer:N,useRef:N,useState:N,useInsertionEffect:N,useLayoutEffect:N,useImperativeHandle:N,useEffect:N,useId:N,useMutableSource:N,useSyncExternalStore:N,useCacheRefresh:function(){return la}};
|
|
29
|
+
function N(){throw Error("This Hook is not supported in Server Components.");}function la(){if(!O)throw Error("Refreshing the cache is not supported in Server Components.");}var O=null,na=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=na.ContextRegistry,T=na.ReactCurrentDispatcher;function oa(a){console.error(a)}
|
|
30
|
+
function pa(a,b,d,c){var f=[],g={status:0,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,pingedSegments:f,completedModuleChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenProviders:new Map,onError:void 0===d?oa:d,toJSON:function(a,b){return qa(g,this,a,b)}};g.pendingChunks++;b=ra(c);a=sa(g,a,b);f.push(a);return g}var ta={};
|
|
31
|
+
function U(a,b,d,c){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in server components, nor passed to client components.");if("function"===typeof a)return x(a)?[y,a,b,c]:a(c);if("string"===typeof a)return[y,a,b,c];if("symbol"===typeof a)return a===ba?c.children:[y,a,b,c];if(null!=a&&"object"===typeof a){if(x(a))return[y,a,b,c];switch(a.$$typeof){case A:var f=a._init;a=f(a._payload);return U(a,b,d,c);case ca:return b=a.render,b(c,void 0);case da:return U(a.type,b,d,c);case z:return ia(a._context,
|
|
32
|
+
c.value),[y,a,b,{value:c.value,children:c.children,__pop:ta}]}}throw Error("Unsupported server component type: "+V(a));}function sa(a,b,d){var c={id:a.nextChunkId++,model:b,context:d,ping:function(){var b=a.pingedSegments;b.push(c);1===b.length&&ua(a)}};return c}function va(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,d){return d})}function W(a){var b=JSON.stringify(a);return'"'+a+'"'===b?a:b}
|
|
33
33
|
function V(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(H(a))return"[...]";a=va(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
|
34
|
-
function X(a,
|
|
35
|
-
function qa(a,
|
|
36
|
-
"#"+f.name;g=a.writtenModules;var k=g.get(
|
|
37
|
-
c=a.writtenProviders,d=c.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,c.set(b,d),b="P"+d.toString(16)+":"+b+"\n",b=p.encode(b),a.completedJSONChunks.push(b)),"$"+d.toString(16);if(
|
|
38
|
-
typeof
|
|
39
|
-
|
|
40
|
-
q.set(
|
|
41
|
-
function Z(a,
|
|
42
|
-
function ua(a){var
|
|
43
|
-
Z(k,g.id,v)}}null!==a.destination&&xa(a,a.destination)}catch(v){Y(a,v),wa(a,v)}finally{T.current=
|
|
44
|
-
function xa(a,
|
|
45
|
-
a.pendingChunks&&
|
|
46
|
-
exports.renderToReadableStream=function(a,
|
|
34
|
+
function X(a,b){if(H(a)){for(var d="[",c=0;c<a.length;c++){0<c&&(d+=", ");if(6<c){d+="...";break}var f=a[c];d=""+c===b&&"object"===typeof f&&null!==f?d+X(f):d+V(f)}return d+"]"}d="{";c=Object.keys(a);for(f=0;f<c.length;f++){0<f&&(d+=", ");if(6<f){d+="...";break}var g=c[f];d+=W(g)+": ";var k=a[g];d=g===b&&"object"===typeof k&&null!==k?d+X(k):d+V(k)}return d+"}"}
|
|
35
|
+
function qa(a,b,d,c){switch(c){case y:return"$"}for(;"object"===typeof c&&null!==c&&(c.$$typeof===y||c.$$typeof===A);)try{switch(c.$$typeof){case y:var f=c;c=U(f.type,f.key,f.ref,f.props);break;case A:var g=c._init;c=g(c._payload)}}catch(t){if("object"===typeof t&&null!==t&&"function"===typeof t.then)return a.pendingChunks++,a=sa(a,c,I),d=a.ping,t.then(d,d),"@"+a.id.toString(16);Y(a,t);a.pendingChunks++;d=a.nextChunkId++;Z(a,d,t);return"@"+d.toString(16)}if(null==c)return c;if("object"===typeof c||
|
|
36
|
+
x(c)){if(x(c)){f=c;"string"===typeof f&&(f=globalThis.__STRING_REFERENCE_INDEX[f]);f=f.filepath+"#"+f.name;g=a.writtenModules;var k=g.get(f);if(void 0!==k)return b[0]===y&&"1"===d?"@"+k.toString(16):"$"+k.toString(16);try{"string"===typeof c&&(c=globalThis.__STRING_REFERENCE_INDEX[c]);var q={id:c.filepath,name:c.name};a.pendingChunks++;var l=a.nextChunkId++,P=w(q),Q="M"+l.toString(16)+":"+P+"\n";var R=p.encode(Q);a.completedModuleChunks.push(R);g.set(f,l);return b[0]===y&&"1"===d?"@"+l.toString(16):
|
|
37
|
+
"$"+l.toString(16)}catch(t){return a.pendingChunks++,d=a.nextChunkId++,Z(a,d,t),"$"+d.toString(16)}}else{if(c.$$typeof===z)return b=c._context._globalName,c=a.writtenProviders,d=c.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,c.set(b,d),b="P"+d.toString(16)+":"+b+"\n",b=p.encode(b),a.completedJSONChunks.push(b)),"$"+d.toString(16);if(c===ta){a=I;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=d===B?
|
|
38
|
+
a.context._defaultValue:d;I=a.parent;return}}return c}if("string"===typeof c)return a="$"===c[0]||"@"===c[0]?"$"+c:c,a;if("boolean"===typeof c||"number"===typeof c||"undefined"===typeof c)return c;if("function"===typeof c){if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to client component props. Remove "+(W(d)+" from these props if possible: "+X(b)+"\nIf you need interactivity, consider converting part of this to a client component."));throw Error("Functions cannot be passed directly to client components because they're not serializable. Remove "+
|
|
39
|
+
(W(d)+" ("+(c.displayName||c.name||"function")+") from this object, or avoid the entire object: "+X(b)));}if("symbol"===typeof c){q=a.writtenSymbols;l=q.get(c);if(void 0!==l)return"$"+l.toString(16);l=c.description;if(Symbol.for(l)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to client components. The symbol Symbol.for("+(c.description+") cannot be found among global symbols. Remove ")+(W(d)+" from this object, or avoid the entire object: "+X(b)));a.pendingChunks++;
|
|
40
|
+
d=a.nextChunkId++;b=w(l);b="S"+d.toString(16)+":"+b+"\n";b=p.encode(b);a.completedModuleChunks.push(b);q.set(c,d);return"$"+d.toString(16)}if("bigint"===typeof c)throw Error("BigInt ("+c+") is not yet supported in client component props. Remove "+(W(d)+" from this object or use a plain number instead: "+X(b)));throw Error("Type "+typeof c+" is not supported in client component props. Remove "+(W(d)+" from this object, or avoid the entire object: "+X(b)));}function Y(a,b){a=a.onError;a(b)}
|
|
41
|
+
function wa(a,b){null!==a.destination?(a.status=2,u(a.destination,b)):(a.status=1,a.fatalError=b)}function Z(a,b,d){var c="";try{if(d instanceof Error){var f=String(d.message);c=String(d.stack)}else f="Error: "+d}catch(g){f="An error occurred but serializing the error message failed."}d={message:f,stack:c};b="E"+b.toString(16)+":"+w(d)+"\n";b=p.encode(b);a.completedErrorChunks.push(b)}
|
|
42
|
+
function ua(a){var b=T.current,d=O;T.current=ma;O=a.cache;try{var c=a.pingedSegments;a.pingedSegments=[];for(var f=0;f<c.length;f++){var g=c[f];var k=a;M(g.context);try{for(var q=g.model;"object"===typeof q&&null!==q&&q.$$typeof===y;){var l=q;g.model=q;q=U(l.type,l.key,l.ref,l.props)}var P=g.id,Q=w(q,k.toJSON),R="J"+P.toString(16)+":"+Q+"\n";var t=p.encode(R);k.completedJSONChunks.push(t)}catch(v){if("object"===typeof v&&null!==v&&"function"===typeof v.then){var ka=g.ping;v.then(ka,ka)}else Y(k,v),
|
|
43
|
+
Z(k,g.id,v)}}null!==a.destination&&xa(a,a.destination)}catch(v){Y(a,v),wa(a,v)}finally{T.current=b,O=d}}
|
|
44
|
+
function xa(a,b){h=new Uint8Array(512);m=0;try{for(var d=a.completedModuleChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!n(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var f=a.completedJSONChunks;for(c=0;c<f.length;c++)if(a.pendingChunks--,!n(b,f[c])){a.destination=null;c++;break}f.splice(0,c);var g=a.completedErrorChunks;for(c=0;c<g.length;c++)if(a.pendingChunks--,!n(b,g[c])){a.destination=null;c++;break}g.splice(0,c)}finally{h&&0<m&&(b.enqueue(new Uint8Array(h.buffer,0,m)),h=null,m=0)}0===
|
|
45
|
+
a.pendingChunks&&b.close()}function ra(a){if(a){var b=I;M(null);for(var d=0;d<a.length;d++){var c=a[d],f=c[0];c=c[1];S[f]||(S[f]=e.createServerContext(f,B));ia(S[f],c)}a=I;M(b);return a}return null}
|
|
46
|
+
exports.renderToReadableStream=function(a,b,d){var c=pa(a,{},b?b.onError:void 0,d);return new ReadableStream({type:"bytes",start:function(){ua(c)},pull:function(a){if(1===c.status)c.status=2,u(a,c.fatalError);else if(2!==c.status&&null===c.destination){c.destination=a;try{xa(c,a)}catch(g){Y(c,g),wa(c,g)}}},cancel:function(){}},{highWaterMark:0})};
|
package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js
CHANGED
|
@@ -15,6 +15,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
17
|
var React = require('react');
|
|
18
|
+
var util = require('util');
|
|
18
19
|
|
|
19
20
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
20
21
|
|
|
@@ -67,31 +68,144 @@ function flushBuffered(destination) {
|
|
|
67
68
|
destination.flush();
|
|
68
69
|
}
|
|
69
70
|
}
|
|
71
|
+
var VIEW_SIZE = 2048;
|
|
72
|
+
var currentView = null;
|
|
73
|
+
var writtenBytes = 0;
|
|
74
|
+
var destinationHasCapacity = true;
|
|
70
75
|
function beginWriting(destination) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
77
|
+
writtenBytes = 0;
|
|
78
|
+
destinationHasCapacity = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function writeStringChunk(destination, stringChunk) {
|
|
82
|
+
if (stringChunk.length === 0) {
|
|
83
|
+
return;
|
|
84
|
+
} // maximum possible view needed to encode entire string
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if (stringChunk.length * 3 > VIEW_SIZE) {
|
|
88
|
+
if (writtenBytes > 0) {
|
|
89
|
+
writeToDestination(destination, currentView.subarray(0, writtenBytes));
|
|
90
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
91
|
+
writtenBytes = 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
writeToDestination(destination, textEncoder.encode(stringChunk));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
var target = currentView;
|
|
99
|
+
|
|
100
|
+
if (writtenBytes > 0) {
|
|
101
|
+
target = currentView.subarray(writtenBytes);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
var _textEncoder$encodeIn = textEncoder.encodeInto(stringChunk, target),
|
|
105
|
+
read = _textEncoder$encodeIn.read,
|
|
106
|
+
written = _textEncoder$encodeIn.written;
|
|
107
|
+
|
|
108
|
+
writtenBytes += written;
|
|
109
|
+
|
|
110
|
+
if (read < stringChunk.length) {
|
|
111
|
+
writeToDestination(destination, currentView);
|
|
112
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
113
|
+
writtenBytes = textEncoder.encodeInto(stringChunk.slice(read), currentView).written;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (writtenBytes === VIEW_SIZE) {
|
|
117
|
+
writeToDestination(destination, currentView);
|
|
118
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
119
|
+
writtenBytes = 0;
|
|
74
120
|
}
|
|
75
121
|
}
|
|
76
|
-
function writeChunkAndReturn(destination, chunk) {
|
|
77
|
-
var nodeBuffer = chunk; // close enough
|
|
78
122
|
|
|
79
|
-
|
|
123
|
+
function writeViewChunk(destination, chunk) {
|
|
124
|
+
if (chunk.byteLength === 0) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (chunk.byteLength > VIEW_SIZE) {
|
|
129
|
+
// this chunk may overflow a single view which implies it was not
|
|
130
|
+
// one that is cached by the streaming renderer. We will enqueu
|
|
131
|
+
// it directly and expect it is not re-used
|
|
132
|
+
if (writtenBytes > 0) {
|
|
133
|
+
writeToDestination(destination, currentView.subarray(0, writtenBytes));
|
|
134
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
135
|
+
writtenBytes = 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
writeToDestination(destination, chunk);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var bytesToWrite = chunk;
|
|
143
|
+
var allowableBytes = currentView.length - writtenBytes;
|
|
144
|
+
|
|
145
|
+
if (allowableBytes < bytesToWrite.byteLength) {
|
|
146
|
+
// this chunk would overflow the current view. We enqueue a full view
|
|
147
|
+
// and start a new view with the remaining chunk
|
|
148
|
+
if (allowableBytes === 0) {
|
|
149
|
+
// the current view is already full, send it
|
|
150
|
+
writeToDestination(destination, currentView);
|
|
151
|
+
} else {
|
|
152
|
+
// fill up the current view and apply the remaining chunk bytes
|
|
153
|
+
// to a new view.
|
|
154
|
+
currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes);
|
|
155
|
+
writtenBytes += allowableBytes;
|
|
156
|
+
writeToDestination(destination, currentView);
|
|
157
|
+
bytesToWrite = bytesToWrite.subarray(allowableBytes);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
161
|
+
writtenBytes = 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
currentView.set(bytesToWrite, writtenBytes);
|
|
165
|
+
writtenBytes += bytesToWrite.byteLength;
|
|
166
|
+
|
|
167
|
+
if (writtenBytes === VIEW_SIZE) {
|
|
168
|
+
writeToDestination(destination, currentView);
|
|
169
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
170
|
+
writtenBytes = 0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function writeChunk(destination, chunk) {
|
|
175
|
+
if (typeof chunk === 'string') {
|
|
176
|
+
writeStringChunk(destination, chunk);
|
|
177
|
+
} else {
|
|
178
|
+
writeViewChunk(destination, chunk);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function writeToDestination(destination, view) {
|
|
183
|
+
var currentHasCapacity = destination.write(view);
|
|
184
|
+
destinationHasCapacity = destinationHasCapacity && currentHasCapacity;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function writeChunkAndReturn(destination, chunk) {
|
|
188
|
+
writeChunk(destination, chunk);
|
|
189
|
+
return destinationHasCapacity;
|
|
80
190
|
}
|
|
81
191
|
function completeWriting(destination) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
destination.uncork();
|
|
192
|
+
if (currentView && writtenBytes > 0) {
|
|
193
|
+
destination.write(currentView.subarray(0, writtenBytes));
|
|
85
194
|
}
|
|
195
|
+
|
|
196
|
+
currentView = null;
|
|
197
|
+
writtenBytes = 0;
|
|
198
|
+
destinationHasCapacity = true;
|
|
86
199
|
}
|
|
87
200
|
function close(destination) {
|
|
88
201
|
destination.end();
|
|
89
202
|
}
|
|
203
|
+
var textEncoder = new util.TextEncoder();
|
|
90
204
|
function stringToChunk(content) {
|
|
91
205
|
return content;
|
|
92
206
|
}
|
|
93
207
|
function stringToPrecomputedChunk(content) {
|
|
94
|
-
return
|
|
208
|
+
return textEncoder.encode(content);
|
|
95
209
|
}
|
|
96
210
|
function closeWithError(destination, error) {
|
|
97
211
|
// $FlowFixMe: This is an Error object or the destination accepts other types.
|
|
@@ -136,13 +250,15 @@ function processSymbolChunk(request, id, name) {
|
|
|
136
250
|
// eslint-disable-next-line no-unused-vars
|
|
137
251
|
var MODULE_TAG = Symbol.for('react.module.reference');
|
|
138
252
|
function getModuleKey(reference) {
|
|
253
|
+
if (typeof reference === 'string') reference = globalThis.__STRING_REFERENCE_INDEX[reference];
|
|
139
254
|
return reference.filepath + '#' + reference.name;
|
|
140
255
|
}
|
|
141
|
-
function
|
|
142
|
-
if (typeof reference === 'string') return globalThis.__STRING_REFERENCE_INDEX[reference];
|
|
143
|
-
return reference
|
|
256
|
+
function isModuleReference(reference) {
|
|
257
|
+
if (typeof reference === 'string') return !!globalThis.__STRING_REFERENCE_INDEX[reference];
|
|
258
|
+
return reference.$$typeof === MODULE_TAG;
|
|
144
259
|
}
|
|
145
260
|
function resolveModuleMetaData(config, moduleReference) {
|
|
261
|
+
if (typeof moduleReference === 'string') moduleReference = globalThis.__STRING_REFERENCE_INDEX[moduleReference];
|
|
146
262
|
return {
|
|
147
263
|
id: moduleReference.filepath,
|
|
148
264
|
name: moduleReference.name
|
|
@@ -458,7 +574,7 @@ var startInlineScript = stringToPrecomputedChunk('<script>');
|
|
|
458
574
|
var endInlineScript = stringToPrecomputedChunk('</script>');
|
|
459
575
|
var startScriptSrc = stringToPrecomputedChunk('<script src="');
|
|
460
576
|
var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
|
|
461
|
-
var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
|
|
577
|
+
var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
|
|
462
578
|
|
|
463
579
|
var textSeparator = stringToPrecomputedChunk('<!-- -->');
|
|
464
580
|
|
|
@@ -493,6 +609,10 @@ var startPendingSuspenseBoundary1 = stringToPrecomputedChunk('<!--$?--><template
|
|
|
493
609
|
var startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
|
|
494
610
|
var startClientRenderedSuspenseBoundary = stringToPrecomputedChunk('<!--$!-->');
|
|
495
611
|
var endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
|
|
612
|
+
var clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk('<template data-hash="');
|
|
613
|
+
var clientRenderedSuspenseBoundaryError1A = stringToPrecomputedChunk('" data-msg="');
|
|
614
|
+
var clientRenderedSuspenseBoundaryError1B = stringToPrecomputedChunk('" data-stack="');
|
|
615
|
+
var clientRenderedSuspenseBoundaryError2 = stringToPrecomputedChunk('"></template>');
|
|
496
616
|
var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="');
|
|
497
617
|
var startSegmentHTML2 = stringToPrecomputedChunk('">');
|
|
498
618
|
var endSegmentHTML = stringToPrecomputedChunk('</div>');
|
|
@@ -522,7 +642,7 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
|
|
|
522
642
|
// const SUSPENSE_PENDING_START_DATA = '$?';
|
|
523
643
|
// const SUSPENSE_FALLBACK_START_DATA = '$!';
|
|
524
644
|
//
|
|
525
|
-
// function clientRenderBoundary(suspenseBoundaryID) {
|
|
645
|
+
// function clientRenderBoundary(suspenseBoundaryID, errorHash, errorMsg, errorComponentStack) {
|
|
526
646
|
// // Find the fallback's first element.
|
|
527
647
|
// const suspenseIdNode = document.getElementById(suspenseBoundaryID);
|
|
528
648
|
// if (!suspenseIdNode) {
|
|
@@ -534,6 +654,11 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
|
|
|
534
654
|
// const suspenseNode = suspenseIdNode.previousSibling;
|
|
535
655
|
// // Tag it to be client rendered.
|
|
536
656
|
// suspenseNode.data = SUSPENSE_FALLBACK_START_DATA;
|
|
657
|
+
// // assign error metadata to first sibling
|
|
658
|
+
// let dataset = suspenseIdNode.dataset;
|
|
659
|
+
// if (errorHash) dataset.hash = errorHash;
|
|
660
|
+
// if (errorMsg) dataset.msg = errorMsg;
|
|
661
|
+
// if (errorComponentStack) dataset.stack = errorComponentStack;
|
|
537
662
|
// // Tell React to retry it if the parent already hydrated.
|
|
538
663
|
// if (suspenseNode._reactRetry) {
|
|
539
664
|
// suspenseNode._reactRetry();
|
|
@@ -617,7 +742,7 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
|
|
|
617
742
|
|
|
618
743
|
var completeSegmentFunction = 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}';
|
|
619
744
|
var completeBoundaryFunction = 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}';
|
|
620
|
-
var clientRenderFunction = 'function $RX(
|
|
745
|
+
var clientRenderFunction = 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.hash=c),d&&(a.msg=d),e&&(a.stack=e),b._reactRetry&&b._reactRetry())}';
|
|
621
746
|
var completeSegmentScript1Full = stringToPrecomputedChunk(completeSegmentFunction + ';$RS("');
|
|
622
747
|
var completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("');
|
|
623
748
|
var completeSegmentScript2 = stringToPrecomputedChunk('","');
|
|
@@ -628,7 +753,9 @@ var completeBoundaryScript2 = stringToPrecomputedChunk('","');
|
|
|
628
753
|
var completeBoundaryScript3 = stringToPrecomputedChunk('")</script>');
|
|
629
754
|
var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX("');
|
|
630
755
|
var clientRenderScript1Partial = stringToPrecomputedChunk('$RX("');
|
|
631
|
-
var
|
|
756
|
+
var clientRenderScript1A = stringToPrecomputedChunk('"');
|
|
757
|
+
var clientRenderScript2 = stringToPrecomputedChunk(')</script>');
|
|
758
|
+
var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');
|
|
632
759
|
|
|
633
760
|
var rendererSigil;
|
|
634
761
|
|
|
@@ -956,13 +1083,13 @@ function attemptResolveElement(type, key, ref, props) {
|
|
|
956
1083
|
throw new Error('Refs cannot be used in server components, nor passed to client components.');
|
|
957
1084
|
}
|
|
958
1085
|
|
|
959
|
-
if (getModuleReference(type)) {
|
|
960
|
-
// This is a reference to a client component.
|
|
961
|
-
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
962
|
-
}
|
|
963
|
-
|
|
964
1086
|
if (typeof type === 'function') {
|
|
965
|
-
|
|
1087
|
+
if (isModuleReference(type)) {
|
|
1088
|
+
// This is a reference to a client component.
|
|
1089
|
+
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
1090
|
+
} // This is a server-side component.
|
|
1091
|
+
|
|
1092
|
+
|
|
966
1093
|
return type(props);
|
|
967
1094
|
} else if (typeof type === 'string') {
|
|
968
1095
|
// This is a host element. E.g. HTML.
|
|
@@ -980,6 +1107,11 @@ function attemptResolveElement(type, key, ref, props) {
|
|
|
980
1107
|
|
|
981
1108
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
982
1109
|
} else if (type != null && typeof type === 'object') {
|
|
1110
|
+
if (isModuleReference(type)) {
|
|
1111
|
+
// This is a reference to a client component.
|
|
1112
|
+
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
1113
|
+
}
|
|
1114
|
+
|
|
983
1115
|
switch (type.$$typeof) {
|
|
984
1116
|
case REACT_LAZY_TYPE:
|
|
985
1117
|
{
|
|
@@ -1306,59 +1438,56 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
|
1306
1438
|
}
|
|
1307
1439
|
}
|
|
1308
1440
|
|
|
1309
|
-
if (value
|
|
1310
|
-
return
|
|
1441
|
+
if (value == null) {
|
|
1442
|
+
return value;
|
|
1311
1443
|
}
|
|
1312
1444
|
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
return serializeByValueID(existingId);
|
|
1331
|
-
}
|
|
1445
|
+
if (typeof value === 'object' || isModuleReference(value)) {
|
|
1446
|
+
if (isModuleReference(value)) {
|
|
1447
|
+
var moduleReference = value;
|
|
1448
|
+
var moduleKey = getModuleKey(moduleReference);
|
|
1449
|
+
var writtenModules = request.writtenModules;
|
|
1450
|
+
var existingId = writtenModules.get(moduleKey);
|
|
1451
|
+
|
|
1452
|
+
if (existingId !== undefined) {
|
|
1453
|
+
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
|
1454
|
+
// If we're encoding the "type" of an element, we can refer
|
|
1455
|
+
// to that by a lazy reference instead of directly since React
|
|
1456
|
+
// knows how to deal with lazy values. This lets us suspend
|
|
1457
|
+
// on this component rather than its parent until the code has
|
|
1458
|
+
// loaded.
|
|
1459
|
+
return serializeByRefID(existingId);
|
|
1460
|
+
}
|
|
1332
1461
|
|
|
1333
|
-
|
|
1334
|
-
var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
|
|
1335
|
-
request.pendingChunks++;
|
|
1336
|
-
var moduleId = request.nextChunkId++;
|
|
1337
|
-
emitModuleChunk(request, moduleId, moduleMetaData);
|
|
1338
|
-
writtenModules.set(moduleKey, moduleId);
|
|
1339
|
-
|
|
1340
|
-
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
|
1341
|
-
// If we're encoding the "type" of an element, we can refer
|
|
1342
|
-
// to that by a lazy reference instead of directly since React
|
|
1343
|
-
// knows how to deal with lazy values. This lets us suspend
|
|
1344
|
-
// on this component rather than its parent until the code has
|
|
1345
|
-
// loaded.
|
|
1346
|
-
return serializeByRefID(moduleId);
|
|
1462
|
+
return serializeByValueID(existingId);
|
|
1347
1463
|
}
|
|
1348
1464
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1465
|
+
try {
|
|
1466
|
+
var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
|
|
1467
|
+
request.pendingChunks++;
|
|
1468
|
+
var moduleId = request.nextChunkId++;
|
|
1469
|
+
emitModuleChunk(request, moduleId, moduleMetaData);
|
|
1470
|
+
writtenModules.set(moduleKey, moduleId);
|
|
1471
|
+
|
|
1472
|
+
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
|
1473
|
+
// If we're encoding the "type" of an element, we can refer
|
|
1474
|
+
// to that by a lazy reference instead of directly since React
|
|
1475
|
+
// knows how to deal with lazy values. This lets us suspend
|
|
1476
|
+
// on this component rather than its parent until the code has
|
|
1477
|
+
// loaded.
|
|
1478
|
+
return serializeByRefID(moduleId);
|
|
1479
|
+
}
|
|
1352
1480
|
|
|
1353
|
-
|
|
1481
|
+
return serializeByValueID(moduleId);
|
|
1482
|
+
} catch (x) {
|
|
1483
|
+
request.pendingChunks++;
|
|
1354
1484
|
|
|
1355
|
-
|
|
1356
|
-
return serializeByValueID(_errorId);
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1485
|
+
var _errorId = request.nextChunkId++;
|
|
1359
1486
|
|
|
1360
|
-
|
|
1361
|
-
|
|
1487
|
+
emitErrorChunk(request, _errorId, x);
|
|
1488
|
+
return serializeByValueID(_errorId);
|
|
1489
|
+
}
|
|
1490
|
+
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
|
1362
1491
|
var providerKey = value._context._globalName;
|
|
1363
1492
|
var writtenProviders = request.writtenProviders;
|
|
1364
1493
|
var providerId = writtenProviders.get(key);
|
|
@@ -1387,7 +1516,7 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
|
1387
1516
|
// Verify that this is a simple plain object.
|
|
1388
1517
|
if (objectName(value) !== 'Object') {
|
|
1389
1518
|
error('Only plain objects can be passed to client components from server components. ' + 'Built-ins like %s are not supported. ' + 'Remove %s from these props: %s', objectName(value), describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
|
|
1390
|
-
} else if (!isSimpleObject(value)) {
|
|
1519
|
+
} else if (typeof value === 'object' && !isSimpleObject(value)) {
|
|
1391
1520
|
error('Only plain objects can be passed to client components from server components. ' + 'Classes or other objects with methods are not supported. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
|
|
1392
1521
|
} else if (Object.getOwnPropertySymbols) {
|
|
1393
1522
|
var symbols = Object.getOwnPropertySymbols(value);
|
|
@@ -1563,7 +1692,7 @@ function performWork(request) {
|
|
|
1563
1692
|
}
|
|
1564
1693
|
|
|
1565
1694
|
function flushCompletedChunks(request, destination) {
|
|
1566
|
-
beginWriting(
|
|
1695
|
+
beginWriting();
|
|
1567
1696
|
|
|
1568
1697
|
try {
|
|
1569
1698
|
// We emit module chunks first in the stream so that
|