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