@shopify/hydrogen 0.22.0 → 0.24.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 +240 -0
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +5 -5
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +5 -8
- package/dist/esnext/components/CartLineProvider/context.d.ts +12 -2
- 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/CartProvider/CartProvider.client.js +2 -5
- 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 +3 -5
- package/dist/esnext/components/CartProvider/types.d.ts +2 -0
- 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 +141 -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 +246 -322
- 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.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 +2 -1
- package/dist/esnext/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +1 -1
- 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} +8 -3
- package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +3 -2
- 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 +5 -6
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +18 -21
- 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.d.ts +1 -0
- package/dist/esnext/foundation/useQuery/hooks.js +24 -7
- package/dist/esnext/foundation/useRequestContext/index.d.ts +15 -0
- package/dist/esnext/foundation/useRequestContext/index.js +23 -0
- 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/useCartLine/useCartLine.d.ts +12 -2
- package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +2 -2
- 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 +12 -6
- package/dist/esnext/index.d.ts +9 -3
- package/dist/esnext/index.js +7 -3
- package/dist/esnext/storefront-api-types.d.ts +10 -339
- 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 +25 -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 +36 -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 +547 -0
- package/dist/node/components/CartProvider/cart-queries.d.ts +10 -0
- package/dist/node/components/CartProvider/cart-queries.js +214 -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 +96 -0
- package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +96 -0
- package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartCreateMutation.d.ts +95 -0
- package/dist/node/components/CartProvider/graphql/CartCreateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +96 -0
- package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartFragment.d.ts +82 -0
- package/dist/node/components/CartProvider/graphql/CartFragment.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartLineAddMutation.d.ts +96 -0
- package/dist/node/components/CartProvider/graphql/CartLineAddMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +96 -0
- package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +96 -0
- package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +96 -0
- package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.js +2 -0
- package/dist/node/components/CartProvider/graphql/CartQuery.d.ts +91 -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 +88 -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 +104 -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 +168 -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 +245 -321
- 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 +15 -13
- 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 +2 -1
- package/dist/node/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +3 -3
- 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} +8 -3
- package/dist/node/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +5 -4
- 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 +5 -6
- package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +18 -21
- 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 +37 -0
- package/dist/node/foundation/useQuery/hooks.js +119 -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 +39 -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/storefront-api-types.d.ts +10 -339
- 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 +4 -2
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +234 -53
- 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 +235 -54
- 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
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, createServerContext } from 'react';
|
|
12
|
+
import { TextEncoder } from 'util';
|
|
12
13
|
|
|
13
14
|
var ReactSharedInternals = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
14
15
|
|
|
@@ -61,31 +62,144 @@ function flushBuffered(destination) {
|
|
|
61
62
|
destination.flush();
|
|
62
63
|
}
|
|
63
64
|
}
|
|
65
|
+
var VIEW_SIZE = 2048;
|
|
66
|
+
var currentView = null;
|
|
67
|
+
var writtenBytes = 0;
|
|
68
|
+
var destinationHasCapacity = true;
|
|
64
69
|
function beginWriting(destination) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
71
|
+
writtenBytes = 0;
|
|
72
|
+
destinationHasCapacity = true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function writeStringChunk(destination, stringChunk) {
|
|
76
|
+
if (stringChunk.length === 0) {
|
|
77
|
+
return;
|
|
78
|
+
} // maximum possible view needed to encode entire string
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if (stringChunk.length * 3 > VIEW_SIZE) {
|
|
82
|
+
if (writtenBytes > 0) {
|
|
83
|
+
writeToDestination(destination, currentView.subarray(0, writtenBytes));
|
|
84
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
85
|
+
writtenBytes = 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
writeToDestination(destination, textEncoder.encode(stringChunk));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var target = currentView;
|
|
93
|
+
|
|
94
|
+
if (writtenBytes > 0) {
|
|
95
|
+
target = currentView.subarray(writtenBytes);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
var _textEncoder$encodeIn = textEncoder.encodeInto(stringChunk, target),
|
|
99
|
+
read = _textEncoder$encodeIn.read,
|
|
100
|
+
written = _textEncoder$encodeIn.written;
|
|
101
|
+
|
|
102
|
+
writtenBytes += written;
|
|
103
|
+
|
|
104
|
+
if (read < stringChunk.length) {
|
|
105
|
+
writeToDestination(destination, currentView);
|
|
106
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
107
|
+
writtenBytes = textEncoder.encodeInto(stringChunk.slice(read), currentView).written;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (writtenBytes === VIEW_SIZE) {
|
|
111
|
+
writeToDestination(destination, currentView);
|
|
112
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
113
|
+
writtenBytes = 0;
|
|
68
114
|
}
|
|
69
115
|
}
|
|
70
|
-
function writeChunkAndReturn(destination, chunk) {
|
|
71
|
-
var nodeBuffer = chunk; // close enough
|
|
72
116
|
|
|
73
|
-
|
|
117
|
+
function writeViewChunk(destination, chunk) {
|
|
118
|
+
if (chunk.byteLength === 0) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (chunk.byteLength > VIEW_SIZE) {
|
|
123
|
+
// this chunk may overflow a single view which implies it was not
|
|
124
|
+
// one that is cached by the streaming renderer. We will enqueu
|
|
125
|
+
// it directly and expect it is not re-used
|
|
126
|
+
if (writtenBytes > 0) {
|
|
127
|
+
writeToDestination(destination, currentView.subarray(0, writtenBytes));
|
|
128
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
129
|
+
writtenBytes = 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
writeToDestination(destination, chunk);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var bytesToWrite = chunk;
|
|
137
|
+
var allowableBytes = currentView.length - writtenBytes;
|
|
138
|
+
|
|
139
|
+
if (allowableBytes < bytesToWrite.byteLength) {
|
|
140
|
+
// this chunk would overflow the current view. We enqueue a full view
|
|
141
|
+
// and start a new view with the remaining chunk
|
|
142
|
+
if (allowableBytes === 0) {
|
|
143
|
+
// the current view is already full, send it
|
|
144
|
+
writeToDestination(destination, currentView);
|
|
145
|
+
} else {
|
|
146
|
+
// fill up the current view and apply the remaining chunk bytes
|
|
147
|
+
// to a new view.
|
|
148
|
+
currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes);
|
|
149
|
+
writtenBytes += allowableBytes;
|
|
150
|
+
writeToDestination(destination, currentView);
|
|
151
|
+
bytesToWrite = bytesToWrite.subarray(allowableBytes);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
155
|
+
writtenBytes = 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
currentView.set(bytesToWrite, writtenBytes);
|
|
159
|
+
writtenBytes += bytesToWrite.byteLength;
|
|
160
|
+
|
|
161
|
+
if (writtenBytes === VIEW_SIZE) {
|
|
162
|
+
writeToDestination(destination, currentView);
|
|
163
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
|
164
|
+
writtenBytes = 0;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function writeChunk(destination, chunk) {
|
|
169
|
+
if (typeof chunk === 'string') {
|
|
170
|
+
writeStringChunk(destination, chunk);
|
|
171
|
+
} else {
|
|
172
|
+
writeViewChunk(destination, chunk);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function writeToDestination(destination, view) {
|
|
177
|
+
var currentHasCapacity = destination.write(view);
|
|
178
|
+
destinationHasCapacity = destinationHasCapacity && currentHasCapacity;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function writeChunkAndReturn(destination, chunk) {
|
|
182
|
+
writeChunk(destination, chunk);
|
|
183
|
+
return destinationHasCapacity;
|
|
74
184
|
}
|
|
75
185
|
function completeWriting(destination) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
destination.uncork();
|
|
186
|
+
if (currentView && writtenBytes > 0) {
|
|
187
|
+
destination.write(currentView.subarray(0, writtenBytes));
|
|
79
188
|
}
|
|
189
|
+
|
|
190
|
+
currentView = null;
|
|
191
|
+
writtenBytes = 0;
|
|
192
|
+
destinationHasCapacity = true;
|
|
80
193
|
}
|
|
81
194
|
function close(destination) {
|
|
82
195
|
destination.end();
|
|
83
196
|
}
|
|
197
|
+
var textEncoder = new TextEncoder();
|
|
84
198
|
function stringToChunk(content) {
|
|
85
199
|
return content;
|
|
86
200
|
}
|
|
87
201
|
function stringToPrecomputedChunk(content) {
|
|
88
|
-
return
|
|
202
|
+
return textEncoder.encode(content);
|
|
89
203
|
}
|
|
90
204
|
function closeWithError(destination, error) {
|
|
91
205
|
// $FlowFixMe: This is an Error object or the destination accepts other types.
|
|
@@ -130,13 +244,15 @@ function processSymbolChunk(request, id, name) {
|
|
|
130
244
|
// eslint-disable-next-line no-unused-vars
|
|
131
245
|
var MODULE_TAG = Symbol.for('react.module.reference');
|
|
132
246
|
function getModuleKey(reference) {
|
|
247
|
+
if (typeof reference === 'string') reference = globalThis.__STRING_REFERENCE_INDEX[reference];
|
|
133
248
|
return reference.filepath + '#' + reference.name;
|
|
134
249
|
}
|
|
135
|
-
function
|
|
136
|
-
if (typeof reference === 'string') return globalThis.__STRING_REFERENCE_INDEX[reference];
|
|
137
|
-
return reference
|
|
250
|
+
function isModuleReference(reference) {
|
|
251
|
+
if (typeof reference === 'string') return !!globalThis.__STRING_REFERENCE_INDEX[reference];
|
|
252
|
+
return reference.$$typeof === MODULE_TAG;
|
|
138
253
|
}
|
|
139
254
|
function resolveModuleMetaData(config, moduleReference) {
|
|
255
|
+
if (typeof moduleReference === 'string') moduleReference = globalThis.__STRING_REFERENCE_INDEX[moduleReference];
|
|
140
256
|
return {
|
|
141
257
|
id: moduleReference.filepath,
|
|
142
258
|
name: moduleReference.name
|
|
@@ -452,7 +568,7 @@ var startInlineScript = stringToPrecomputedChunk('<script>');
|
|
|
452
568
|
var endInlineScript = stringToPrecomputedChunk('</script>');
|
|
453
569
|
var startScriptSrc = stringToPrecomputedChunk('<script src="');
|
|
454
570
|
var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
|
|
455
|
-
var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
|
|
571
|
+
var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
|
|
456
572
|
|
|
457
573
|
var textSeparator = stringToPrecomputedChunk('<!-- -->');
|
|
458
574
|
|
|
@@ -487,6 +603,10 @@ var startPendingSuspenseBoundary1 = stringToPrecomputedChunk('<!--$?--><template
|
|
|
487
603
|
var startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
|
|
488
604
|
var startClientRenderedSuspenseBoundary = stringToPrecomputedChunk('<!--$!-->');
|
|
489
605
|
var endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
|
|
606
|
+
var clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk('<template data-hash="');
|
|
607
|
+
var clientRenderedSuspenseBoundaryError1A = stringToPrecomputedChunk('" data-msg="');
|
|
608
|
+
var clientRenderedSuspenseBoundaryError1B = stringToPrecomputedChunk('" data-stack="');
|
|
609
|
+
var clientRenderedSuspenseBoundaryError2 = stringToPrecomputedChunk('"></template>');
|
|
490
610
|
var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="');
|
|
491
611
|
var startSegmentHTML2 = stringToPrecomputedChunk('">');
|
|
492
612
|
var endSegmentHTML = stringToPrecomputedChunk('</div>');
|
|
@@ -516,7 +636,7 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
|
|
|
516
636
|
// const SUSPENSE_PENDING_START_DATA = '$?';
|
|
517
637
|
// const SUSPENSE_FALLBACK_START_DATA = '$!';
|
|
518
638
|
//
|
|
519
|
-
// function clientRenderBoundary(suspenseBoundaryID) {
|
|
639
|
+
// function clientRenderBoundary(suspenseBoundaryID, errorHash, errorMsg, errorComponentStack) {
|
|
520
640
|
// // Find the fallback's first element.
|
|
521
641
|
// const suspenseIdNode = document.getElementById(suspenseBoundaryID);
|
|
522
642
|
// if (!suspenseIdNode) {
|
|
@@ -528,6 +648,11 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
|
|
|
528
648
|
// const suspenseNode = suspenseIdNode.previousSibling;
|
|
529
649
|
// // Tag it to be client rendered.
|
|
530
650
|
// suspenseNode.data = SUSPENSE_FALLBACK_START_DATA;
|
|
651
|
+
// // assign error metadata to first sibling
|
|
652
|
+
// let dataset = suspenseIdNode.dataset;
|
|
653
|
+
// if (errorHash) dataset.hash = errorHash;
|
|
654
|
+
// if (errorMsg) dataset.msg = errorMsg;
|
|
655
|
+
// if (errorComponentStack) dataset.stack = errorComponentStack;
|
|
531
656
|
// // Tell React to retry it if the parent already hydrated.
|
|
532
657
|
// if (suspenseNode._reactRetry) {
|
|
533
658
|
// suspenseNode._reactRetry();
|
|
@@ -611,7 +736,7 @@ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
|
|
|
611
736
|
|
|
612
737
|
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)}';
|
|
613
738
|
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()}}';
|
|
614
|
-
var clientRenderFunction = 'function $RX(
|
|
739
|
+
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())}';
|
|
615
740
|
var completeSegmentScript1Full = stringToPrecomputedChunk(completeSegmentFunction + ';$RS("');
|
|
616
741
|
var completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("');
|
|
617
742
|
var completeSegmentScript2 = stringToPrecomputedChunk('","');
|
|
@@ -622,7 +747,9 @@ var completeBoundaryScript2 = stringToPrecomputedChunk('","');
|
|
|
622
747
|
var completeBoundaryScript3 = stringToPrecomputedChunk('")</script>');
|
|
623
748
|
var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX("');
|
|
624
749
|
var clientRenderScript1Partial = stringToPrecomputedChunk('$RX("');
|
|
625
|
-
var
|
|
750
|
+
var clientRenderScript1A = stringToPrecomputedChunk('"');
|
|
751
|
+
var clientRenderScript2 = stringToPrecomputedChunk(')</script>');
|
|
752
|
+
var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');
|
|
626
753
|
|
|
627
754
|
var rendererSigil;
|
|
628
755
|
|
|
@@ -950,13 +1077,13 @@ function attemptResolveElement(type, key, ref, props) {
|
|
|
950
1077
|
throw new Error('Refs cannot be used in server components, nor passed to client components.');
|
|
951
1078
|
}
|
|
952
1079
|
|
|
953
|
-
if (getModuleReference(type)) {
|
|
954
|
-
// This is a reference to a client component.
|
|
955
|
-
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
956
|
-
}
|
|
957
|
-
|
|
958
1080
|
if (typeof type === 'function') {
|
|
959
|
-
|
|
1081
|
+
if (isModuleReference(type)) {
|
|
1082
|
+
// This is a reference to a client component.
|
|
1083
|
+
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
1084
|
+
} // This is a server-side component.
|
|
1085
|
+
|
|
1086
|
+
|
|
960
1087
|
return type(props);
|
|
961
1088
|
} else if (typeof type === 'string') {
|
|
962
1089
|
// This is a host element. E.g. HTML.
|
|
@@ -974,6 +1101,11 @@ function attemptResolveElement(type, key, ref, props) {
|
|
|
974
1101
|
|
|
975
1102
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
976
1103
|
} else if (type != null && typeof type === 'object') {
|
|
1104
|
+
if (isModuleReference(type)) {
|
|
1105
|
+
// This is a reference to a client component.
|
|
1106
|
+
return [REACT_ELEMENT_TYPE, type, key, props];
|
|
1107
|
+
}
|
|
1108
|
+
|
|
977
1109
|
switch (type.$$typeof) {
|
|
978
1110
|
case REACT_LAZY_TYPE:
|
|
979
1111
|
{
|
|
@@ -1300,59 +1432,56 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
|
1300
1432
|
}
|
|
1301
1433
|
}
|
|
1302
1434
|
|
|
1303
|
-
if (value
|
|
1304
|
-
return
|
|
1435
|
+
if (value == null) {
|
|
1436
|
+
return value;
|
|
1305
1437
|
}
|
|
1306
1438
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
return serializeByValueID(existingId);
|
|
1325
|
-
}
|
|
1439
|
+
if (typeof value === 'object' || isModuleReference(value)) {
|
|
1440
|
+
if (isModuleReference(value)) {
|
|
1441
|
+
var moduleReference = value;
|
|
1442
|
+
var moduleKey = getModuleKey(moduleReference);
|
|
1443
|
+
var writtenModules = request.writtenModules;
|
|
1444
|
+
var existingId = writtenModules.get(moduleKey);
|
|
1445
|
+
|
|
1446
|
+
if (existingId !== undefined) {
|
|
1447
|
+
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
|
1448
|
+
// If we're encoding the "type" of an element, we can refer
|
|
1449
|
+
// to that by a lazy reference instead of directly since React
|
|
1450
|
+
// knows how to deal with lazy values. This lets us suspend
|
|
1451
|
+
// on this component rather than its parent until the code has
|
|
1452
|
+
// loaded.
|
|
1453
|
+
return serializeByRefID(existingId);
|
|
1454
|
+
}
|
|
1326
1455
|
|
|
1327
|
-
|
|
1328
|
-
var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
|
|
1329
|
-
request.pendingChunks++;
|
|
1330
|
-
var moduleId = request.nextChunkId++;
|
|
1331
|
-
emitModuleChunk(request, moduleId, moduleMetaData);
|
|
1332
|
-
writtenModules.set(moduleKey, moduleId);
|
|
1333
|
-
|
|
1334
|
-
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
|
1335
|
-
// If we're encoding the "type" of an element, we can refer
|
|
1336
|
-
// to that by a lazy reference instead of directly since React
|
|
1337
|
-
// knows how to deal with lazy values. This lets us suspend
|
|
1338
|
-
// on this component rather than its parent until the code has
|
|
1339
|
-
// loaded.
|
|
1340
|
-
return serializeByRefID(moduleId);
|
|
1456
|
+
return serializeByValueID(existingId);
|
|
1341
1457
|
}
|
|
1342
1458
|
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1459
|
+
try {
|
|
1460
|
+
var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
|
|
1461
|
+
request.pendingChunks++;
|
|
1462
|
+
var moduleId = request.nextChunkId++;
|
|
1463
|
+
emitModuleChunk(request, moduleId, moduleMetaData);
|
|
1464
|
+
writtenModules.set(moduleKey, moduleId);
|
|
1465
|
+
|
|
1466
|
+
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
|
1467
|
+
// If we're encoding the "type" of an element, we can refer
|
|
1468
|
+
// to that by a lazy reference instead of directly since React
|
|
1469
|
+
// knows how to deal with lazy values. This lets us suspend
|
|
1470
|
+
// on this component rather than its parent until the code has
|
|
1471
|
+
// loaded.
|
|
1472
|
+
return serializeByRefID(moduleId);
|
|
1473
|
+
}
|
|
1346
1474
|
|
|
1347
|
-
|
|
1475
|
+
return serializeByValueID(moduleId);
|
|
1476
|
+
} catch (x) {
|
|
1477
|
+
request.pendingChunks++;
|
|
1348
1478
|
|
|
1349
|
-
|
|
1350
|
-
return serializeByValueID(_errorId);
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1479
|
+
var _errorId = request.nextChunkId++;
|
|
1353
1480
|
|
|
1354
|
-
|
|
1355
|
-
|
|
1481
|
+
emitErrorChunk(request, _errorId, x);
|
|
1482
|
+
return serializeByValueID(_errorId);
|
|
1483
|
+
}
|
|
1484
|
+
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
|
1356
1485
|
var providerKey = value._context._globalName;
|
|
1357
1486
|
var writtenProviders = request.writtenProviders;
|
|
1358
1487
|
var providerId = writtenProviders.get(key);
|
|
@@ -1381,7 +1510,7 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
|
1381
1510
|
// Verify that this is a simple plain object.
|
|
1382
1511
|
if (objectName(value) !== 'Object') {
|
|
1383
1512
|
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));
|
|
1384
|
-
} else if (!isSimpleObject(value)) {
|
|
1513
|
+
} else if (typeof value === 'object' && !isSimpleObject(value)) {
|
|
1385
1514
|
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));
|
|
1386
1515
|
} else if (Object.getOwnPropertySymbols) {
|
|
1387
1516
|
var symbols = Object.getOwnPropertySymbols(value);
|
|
@@ -1557,7 +1686,7 @@ function performWork(request) {
|
|
|
1557
1686
|
}
|
|
1558
1687
|
|
|
1559
1688
|
function flushCompletedChunks(request, destination) {
|
|
1560
|
-
beginWriting(
|
|
1689
|
+
beginWriting();
|
|
1561
1690
|
|
|
1562
1691
|
try {
|
|
1563
1692
|
// We emit module chunks first in the stream so that
|
|
@@ -28,7 +28,7 @@ function parseModel(response, json) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// eslint-disable-next-line no-unused-vars
|
|
31
|
-
function resolveModuleReference(moduleData) {
|
|
31
|
+
function resolveModuleReference(bundlerConfig, moduleData) {
|
|
32
32
|
return moduleData;
|
|
33
33
|
} // Vite import globs will be injected here.
|
|
34
34
|
|
|
@@ -355,9 +355,10 @@ function parseModelTuple(response, value) {
|
|
|
355
355
|
|
|
356
356
|
return value;
|
|
357
357
|
}
|
|
358
|
-
function createResponse() {
|
|
358
|
+
function createResponse(bundlerConfig) {
|
|
359
359
|
var chunks = new Map();
|
|
360
360
|
var response = {
|
|
361
|
+
_bundlerConfig: bundlerConfig,
|
|
361
362
|
_chunks: chunks,
|
|
362
363
|
readRoot: readRoot
|
|
363
364
|
};
|
|
@@ -381,7 +382,7 @@ function resolveModule(response, id, model) {
|
|
|
381
382
|
var chunks = response._chunks;
|
|
382
383
|
var chunk = chunks.get(id);
|
|
383
384
|
var moduleMetaData = parseModel(response, model);
|
|
384
|
-
var moduleReference = resolveModuleReference(moduleMetaData); // TODO: Add an option to encode modules that are lazy loaded.
|
|
385
|
+
var moduleReference = resolveModuleReference(response._bundlerConfig, moduleMetaData); // TODO: Add an option to encode modules that are lazy loaded.
|
|
385
386
|
// For now we preload all modules as early as possible since it's likely
|
|
386
387
|
// that we'll need them.
|
|
387
388
|
|
|
@@ -517,11 +518,11 @@ function createFromJSONCallback(response) {
|
|
|
517
518
|
};
|
|
518
519
|
}
|
|
519
520
|
|
|
520
|
-
function createResponse$1() {
|
|
521
|
+
function createResponse$1(bundlerConfig) {
|
|
521
522
|
// NOTE: CHECK THE COMPILER OUTPUT EACH TIME YOU CHANGE THIS.
|
|
522
523
|
// It should be inlined to one object literal but minor changes can break it.
|
|
523
524
|
var stringDecoder = createStringDecoder() ;
|
|
524
|
-
var response = createResponse();
|
|
525
|
+
var response = createResponse(bundlerConfig);
|
|
525
526
|
response._partialRow = '';
|
|
526
527
|
|
|
527
528
|
{
|
|
@@ -558,13 +559,13 @@ function startReadingFromStream(response, stream) {
|
|
|
558
559
|
}
|
|
559
560
|
|
|
560
561
|
function createFromReadableStream(stream) {
|
|
561
|
-
var response = createResponse$1();
|
|
562
|
+
var response = createResponse$1({});
|
|
562
563
|
startReadingFromStream(response, stream);
|
|
563
564
|
return response;
|
|
564
565
|
}
|
|
565
566
|
|
|
566
567
|
function createFromFetch(promiseForResponse) {
|
|
567
|
-
var response = createResponse$1();
|
|
568
|
+
var response = createResponse$1({});
|
|
568
569
|
promiseForResponse.then(function (r) {
|
|
569
570
|
startReadingFromStream(response, r.body);
|
|
570
571
|
}, function (e) {
|
|
@@ -574,7 +575,7 @@ function createFromFetch(promiseForResponse) {
|
|
|
574
575
|
}
|
|
575
576
|
|
|
576
577
|
function createFromXHR(request) {
|
|
577
|
-
var response = createResponse$1();
|
|
578
|
+
var response = createResponse$1({});
|
|
578
579
|
var processedLength = 0;
|
|
579
580
|
|
|
580
581
|
function progress(e) {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ProductProviderProps } from './ProductProvider.client';
|
|
3
|
-
interface ProductOptionsProviderProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
initialVariantId: ProductProviderProps['initialVariantId'];
|
|
6
|
-
}
|
|
7
|
-
export declare function ProductOptionsProvider({ children, initialVariantId, }: ProductOptionsProviderProps): JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ProductOptionsContext } from './context';
|
|
3
|
-
import { useProductOptions } from '../../hooks';
|
|
4
|
-
import { useProduct } from '../../hooks/useProduct';
|
|
5
|
-
export function ProductOptionsProvider({ children, initialVariantId, }) {
|
|
6
|
-
const product = useProduct();
|
|
7
|
-
const productOptions = useProductOptions({
|
|
8
|
-
variants: product.variantsConnection,
|
|
9
|
-
initialVariantId,
|
|
10
|
-
});
|
|
11
|
-
return (React.createElement(ProductOptionsContext.Provider, { value: productOptions }, children));
|
|
12
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { useProductOptions } from '../../hooks';
|
|
3
|
-
import type { Product as ProductType } from '../../storefront-api-types';
|
|
4
|
-
import type { PartialDeep } from 'type-fest';
|
|
5
|
-
export interface ProductProviderProps {
|
|
6
|
-
/** A `ReactNode` element. */
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
/** A [Product object](https://shopify.dev/api/storefront/reference/products/product). */
|
|
9
|
-
data: PartialDeep<ProductType>;
|
|
10
|
-
/** The initially selected variant.
|
|
11
|
-
* The following logic applies to `initialVariantId`:
|
|
12
|
-
* If `initialVariantId` is provided, then it's used, even if it's out of stock.
|
|
13
|
-
* If `initialVariantId` is provided, but is `null`, then no variant is used.
|
|
14
|
-
* If nothing is passed to `initialVariantId`, and you're in a `ProductProvider`, then `selectedVariant.id` is used.
|
|
15
|
-
* If nothing is passed to `initialVariantId` and you're not in a `ProductProvider`, then the first available or in-stock variant is used.
|
|
16
|
-
* If nothing is passed to `initialVariantId`, you're not in a `ProductProvider`, and no variants are in stock, then the first variant is used.
|
|
17
|
-
*/
|
|
18
|
-
initialVariantId?: Parameters<typeof useProductOptions>['0']['initialVariantId'];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The `ProductProvider` component sets up a context with product details. Descendents of
|
|
22
|
-
* this component can use the `useProduct` hook.
|
|
23
|
-
*/
|
|
24
|
-
export declare function ProductProvider({ children, data: product, initialVariantId, }: ProductProviderProps): JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { useParsedMetafields } from '../../hooks';
|
|
3
|
-
import { flattenConnection } from '../../utilities';
|
|
4
|
-
import { ProductContext } from './context';
|
|
5
|
-
import { ProductOptionsProvider } from './ProductOptionsProvider.client';
|
|
6
|
-
/**
|
|
7
|
-
* The `ProductProvider` component sets up a context with product details. Descendents of
|
|
8
|
-
* this component can use the `useProduct` hook.
|
|
9
|
-
*/
|
|
10
|
-
export function ProductProvider({ children, data: product, initialVariantId, }) {
|
|
11
|
-
const metafields = useParsedMetafields(product.metafields || {});
|
|
12
|
-
// @ts-expect-error The types here are broken on main, need to come back and fix them sometime
|
|
13
|
-
const providerValue = useMemo(() => {
|
|
14
|
-
return {
|
|
15
|
-
...product,
|
|
16
|
-
metafields,
|
|
17
|
-
metafieldsConnection: product.metafields,
|
|
18
|
-
media: product.media ? flattenConnection(product.media) : undefined,
|
|
19
|
-
mediaConnection: product.media,
|
|
20
|
-
variants: product.variants
|
|
21
|
-
? flattenConnection(product.variants)
|
|
22
|
-
: undefined,
|
|
23
|
-
variantsConnection: product.variants,
|
|
24
|
-
images: product.images ? flattenConnection(product.images) : undefined,
|
|
25
|
-
imagesConnection: product.images,
|
|
26
|
-
collections: product.collections
|
|
27
|
-
? flattenConnection(product.collections)
|
|
28
|
-
: undefined,
|
|
29
|
-
collectionsConnection: product.collections,
|
|
30
|
-
};
|
|
31
|
-
}, [metafields, product]);
|
|
32
|
-
return (React.createElement(ProductContext.Provider, { value: providerValue },
|
|
33
|
-
React.createElement(ProductOptionsProvider, { initialVariantId: initialVariantId }, children)));
|
|
34
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ProductOptionsHookValue } from '../../hooks';
|
|
2
|
-
import { ParsedMetafield } from '../../types';
|
|
3
|
-
import type { Collection, Image, Product as ProductType, ProductVariant as ProductVariantType, MediaEdge as MediaEdgeType } from '../../storefront-api-types';
|
|
4
|
-
import type { PartialDeep } from 'type-fest';
|
|
5
|
-
export declare const ProductContext: import("react").Context<import("type-fest/source/partial-deep").PartialObjectDeep<Omit<ProductType, "media" | "options" | "metafields" | "variants" | "sellingPlanGroups" | "collections" | "images"> & {
|
|
6
|
-
media?: import("../../storefront-api-types").ExternalVideo | import("../../storefront-api-types").MediaImage | import("../../storefront-api-types").Model3d | import("../../storefront-api-types").Video | undefined;
|
|
7
|
-
mediaConnection?: import("../../storefront-api-types").MediaConnection | undefined;
|
|
8
|
-
metafields?: ParsedMetafield[] | undefined;
|
|
9
|
-
metafieldsConnection?: import("../../storefront-api-types").MetafieldConnection | undefined;
|
|
10
|
-
images?: Partial<Image>[] | undefined;
|
|
11
|
-
imagesConnection?: import("../../storefront-api-types").ImageConnection | undefined;
|
|
12
|
-
collections?: Partial<Collection>[] | undefined;
|
|
13
|
-
collectionsConnection?: import("../../storefront-api-types").CollectionConnection | undefined;
|
|
14
|
-
variants?: Partial<ProductVariantType>[] | undefined;
|
|
15
|
-
variantsConnection?: import("../../storefront-api-types").ProductVariantConnection | undefined;
|
|
16
|
-
}> | null>;
|
|
17
|
-
export declare type ProductContextType = PartialDeep<Omit<ProductType, 'media' | 'metafields' | 'images' | 'collections' | 'variants' | 'sellingPlanGroups' | 'options'> & {
|
|
18
|
-
media?: MediaEdgeType['node'];
|
|
19
|
-
mediaConnection?: ProductType['media'];
|
|
20
|
-
metafields?: ParsedMetafield[];
|
|
21
|
-
metafieldsConnection?: ProductType['metafields'];
|
|
22
|
-
images?: Partial<Image>[];
|
|
23
|
-
imagesConnection?: ProductType['images'];
|
|
24
|
-
collections?: Partial<Collection>[];
|
|
25
|
-
collectionsConnection?: ProductType['collections'];
|
|
26
|
-
variants?: Partial<ProductVariantType>[];
|
|
27
|
-
variantsConnection?: ProductType['variants'];
|
|
28
|
-
}>;
|
|
29
|
-
export declare const ProductOptionsContext: import("react").Context<ProductOptionsHookValue | null>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function request(request: Request, data?: any, contentType?: string): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface RuntimeContext {
|
|
2
|
-
waitUntil: (fn: Promise<any>) => void;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Set a global runtime context for the current request.
|
|
6
|
-
* This is used to encapsulate things like:
|
|
7
|
-
* - `waitUntil()` to run promises after request has ended
|
|
8
|
-
*/
|
|
9
|
-
export declare function setContext(ctx?: RuntimeContext): void;
|
|
10
|
-
export declare function getContext(): RuntimeContext | undefined;
|
|
11
|
-
export declare function setCache(cache?: Cache): void;
|
|
12
|
-
export declare function getCache(): Cache | undefined;
|
|
13
|
-
export declare function runDelayedFunction(fn: () => Promise<any>): void | Promise<any>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Set a global runtime context for the current request.
|
|
3
|
-
* This is used to encapsulate things like:
|
|
4
|
-
* - `waitUntil()` to run promises after request has ended
|
|
5
|
-
*/
|
|
6
|
-
export function setContext(ctx) {
|
|
7
|
-
globalThis.__ctx = ctx;
|
|
8
|
-
}
|
|
9
|
-
export function getContext() {
|
|
10
|
-
return globalThis.__ctx;
|
|
11
|
-
}
|
|
12
|
-
export function setCache(cache) {
|
|
13
|
-
globalThis.__cache = cache;
|
|
14
|
-
}
|
|
15
|
-
export function getCache() {
|
|
16
|
-
return globalThis.__cache;
|
|
17
|
-
}
|
|
18
|
-
export function runDelayedFunction(fn) {
|
|
19
|
-
const context = getContext();
|
|
20
|
-
/**
|
|
21
|
-
* Runtimes (Oxygen, Node.js) might not have this.
|
|
22
|
-
*/
|
|
23
|
-
if (!(context === null || context === void 0 ? void 0 : context.waitUntil)) {
|
|
24
|
-
return fn();
|
|
25
|
-
}
|
|
26
|
-
return context.waitUntil(fn());
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useProduct } from './useProduct';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useProduct } from './useProduct';
|