@shopify/hydrogen 1.1.0 → 1.2.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/dist/esnext/FileSessionStorage.d.ts +1 -1
- package/dist/esnext/FileSessionStorage.js +1 -1
- package/dist/esnext/client.d.ts +16 -16
- package/dist/esnext/client.js +16 -16
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +5 -2
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +6 -5
- package/dist/esnext/components/AddToCartButton/index.d.ts +1 -1
- package/dist/esnext/components/AddToCartButton/index.js +1 -1
- package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +7 -5
- package/dist/esnext/components/BaseButton/BaseButton.client.js +5 -4
- package/dist/esnext/components/BaseButton/index.d.ts +1 -1
- package/dist/esnext/components/BaseButton/index.js +1 -1
- package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +3 -2
- package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +2 -2
- package/dist/esnext/components/BuyNowButton/index.d.ts +1 -1
- package/dist/esnext/components/BuyNowButton/index.js +1 -1
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +1 -1
- package/dist/esnext/components/CartCheckoutButton/index.d.ts +1 -1
- package/dist/esnext/components/CartCheckoutButton/index.js +1 -1
- package/dist/esnext/components/CartCost/CartCost.client.d.ts +1 -1
- package/dist/esnext/components/CartCost/CartCost.client.js +2 -2
- package/dist/esnext/components/CartCost/index.d.ts +1 -1
- package/dist/esnext/components/CartCost/index.js +1 -1
- package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +1 -1
- package/dist/esnext/components/CartLineImage/CartLineImage.client.js +2 -2
- package/dist/esnext/components/CartLineImage/index.d.ts +1 -1
- package/dist/esnext/components/CartLineImage/index.js +1 -1
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +1 -1
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +2 -2
- package/dist/esnext/components/CartLinePrice/index.d.ts +1 -1
- package/dist/esnext/components/CartLinePrice/index.js +1 -1
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +1 -1
- package/dist/esnext/components/CartLineProductTitle/index.d.ts +1 -1
- package/dist/esnext/components/CartLineProductTitle/index.js +1 -1
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +1 -1
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +1 -1
- package/dist/esnext/components/CartLineProvider/context.d.ts +13 -13
- package/dist/esnext/components/CartLineProvider/index.d.ts +2 -2
- package/dist/esnext/components/CartLineProvider/index.js +2 -2
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +1 -1
- package/dist/esnext/components/CartLineQuantity/index.d.ts +1 -1
- package/dist/esnext/components/CartLineQuantity/index.js +1 -1
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +7 -8
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +3 -3
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +1 -1
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +1 -1
- package/dist/esnext/components/CartLines/CartLines.client.d.ts +1 -1
- package/dist/esnext/components/CartLines/CartLines.client.js +2 -2
- 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.d.ts +2 -2
- package/dist/esnext/components/CartProvider/CartProvider.client.js +7 -7
- package/dist/esnext/components/CartProvider/context.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +1 -1
- package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +1 -1
- package/dist/esnext/components/CartProvider/hooks.client.d.ts +2 -2
- package/dist/esnext/components/CartProvider/hooks.client.js +4 -4
- package/dist/esnext/components/CartProvider/index.d.ts +4 -4
- package/dist/esnext/components/CartProvider/index.js +3 -3
- package/dist/esnext/components/CartProvider/types.d.ts +2 -2
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +1 -1
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +2 -2
- package/dist/esnext/components/CartShopPayButton/index.d.ts +1 -1
- package/dist/esnext/components/CartShopPayButton/index.js +1 -1
- package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +2 -2
- package/dist/esnext/components/ExternalVideo/ExternalVideo.js +1 -1
- package/dist/esnext/components/ExternalVideo/index.d.ts +1 -1
- package/dist/esnext/components/ExternalVideo/index.js +1 -1
- package/dist/esnext/components/Image/Image.d.ts +1 -1
- package/dist/esnext/components/Image/Image.js +1 -1
- package/dist/esnext/components/Image/index.d.ts +2 -2
- package/dist/esnext/components/Image/index.js +1 -1
- package/dist/esnext/components/Link/Link.client.js +5 -5
- package/dist/esnext/components/Link/index.d.ts +1 -1
- package/dist/esnext/components/Link/index.js +1 -1
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +1 -1
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +1 -1
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +1 -1
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +5 -5
- package/dist/esnext/components/LocalizationProvider/index.d.ts +1 -1
- package/dist/esnext/components/LocalizationProvider/index.js +1 -1
- package/dist/esnext/components/MediaFile/MediaFile.d.ts +4 -4
- package/dist/esnext/components/MediaFile/MediaFile.js +4 -4
- package/dist/esnext/components/MediaFile/index.d.ts +1 -1
- package/dist/esnext/components/MediaFile/index.js +1 -1
- package/dist/esnext/components/Metafield/Metafield.client.d.ts +2 -2
- package/dist/esnext/components/Metafield/Metafield.client.js +6 -6
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +1 -1
- package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +1 -1
- package/dist/esnext/components/Metafield/components/StarRating/index.js +1 -1
- package/dist/esnext/components/Metafield/components/index.d.ts +1 -1
- package/dist/esnext/components/Metafield/components/index.js +1 -1
- package/dist/esnext/components/Metafield/index.d.ts +2 -2
- package/dist/esnext/components/Metafield/index.js +1 -1
- package/dist/esnext/components/Metafield/types.d.ts +1 -1
- package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +2 -2
- package/dist/esnext/components/ModelViewer/ModelViewer.client.js +1 -1
- package/dist/esnext/components/ModelViewer/index.d.ts +1 -1
- package/dist/esnext/components/ModelViewer/index.js +1 -1
- package/dist/esnext/components/Money/Money.client.d.ts +1 -1
- package/dist/esnext/components/Money/Money.client.js +1 -1
- package/dist/esnext/components/Money/index.d.ts +1 -1
- package/dist/esnext/components/Money/index.js +1 -1
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +1 -1
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +3 -3
- package/dist/esnext/components/ProductOptionsProvider/context.d.ts +1 -1
- package/dist/esnext/components/ProductOptionsProvider/index.d.ts +1 -1
- package/dist/esnext/components/ProductOptionsProvider/index.js +1 -1
- package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +2 -2
- package/dist/esnext/components/ProductPrice/ProductPrice.client.js +2 -2
- package/dist/esnext/components/ProductPrice/index.d.ts +1 -1
- package/dist/esnext/components/ProductPrice/index.js +1 -1
- package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/CollectionSeo.client.js +4 -4
- package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/DefaultPageSeo.client.js +5 -5
- package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/DescriptionSeo.client.js +1 -1
- package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/HomePageSeo.client.js +3 -3
- package/dist/esnext/components/Seo/ImageSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/ImageSeo.client.js +1 -1
- package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/NoIndexSeo.client.js +2 -2
- package/dist/esnext/components/Seo/PageSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/PageSeo.client.js +3 -3
- package/dist/esnext/components/Seo/ProductSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/ProductSeo.client.js +6 -6
- package/dist/esnext/components/Seo/Seo.client.d.ts +4 -4
- package/dist/esnext/components/Seo/Seo.client.js +7 -7
- package/dist/esnext/components/Seo/TitleSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/TitleSeo.client.js +1 -1
- package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +1 -1
- package/dist/esnext/components/Seo/TwitterSeo.client.js +1 -1
- package/dist/esnext/components/Seo/index.d.ts +1 -1
- package/dist/esnext/components/Seo/index.js +1 -1
- package/dist/esnext/components/Seo/seo-types.d.ts +1 -1
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +2 -2
- package/dist/esnext/components/ShopPayButton/index.d.ts +1 -1
- package/dist/esnext/components/ShopPayButton/index.js +1 -1
- package/dist/esnext/components/Video/Video.d.ts +7 -2
- package/dist/esnext/components/Video/Video.js +3 -3
- package/dist/esnext/components/Video/index.d.ts +1 -1
- package/dist/esnext/components/Video/index.js +1 -1
- package/dist/esnext/components/index.d.ts +27 -27
- package/dist/esnext/components/index.js +25 -25
- package/dist/esnext/config.d.ts +5 -5
- package/dist/esnext/config.js +4 -4
- package/dist/esnext/entry-client.d.ts +1 -1
- package/dist/esnext/entry-client.js +35 -14
- package/dist/esnext/entry-server.d.ts +1 -1
- package/dist/esnext/entry-server.js +66 -48
- package/dist/esnext/experimental.d.ts +1 -0
- package/dist/esnext/experimental.js +1 -0
- package/dist/esnext/foundation/Analytics/Analytics.client.js +1 -1
- package/dist/esnext/foundation/Analytics/Analytics.server.js +5 -5
- package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +1 -1
- package/dist/esnext/foundation/Analytics/ClientAnalytics.js +4 -4
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +1 -1
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +1 -1
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +3 -3
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +1 -1
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +1 -1
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +1 -1
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +3 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +9 -9
- package/dist/esnext/foundation/Analytics/hook.js +2 -2
- package/dist/esnext/foundation/Analytics/index.d.ts +1 -1
- package/dist/esnext/foundation/Analytics/index.js +1 -1
- package/dist/esnext/foundation/Analytics/utils.js +1 -1
- package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +1 -1
- package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +3 -3
- package/dist/esnext/foundation/Cache/cache-sub-request.d.ts +1 -1
- package/dist/esnext/foundation/Cache/cache-sub-request.js +4 -4
- package/dist/esnext/foundation/Cache/cache.d.ts +1 -1
- package/dist/esnext/foundation/Cache/cache.js +3 -3
- package/dist/esnext/foundation/Cache/strategies/index.d.ts +1 -1
- package/dist/esnext/foundation/Cookie/Cookie.js +2 -2
- package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +2 -2
- package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +2 -1
- package/dist/esnext/foundation/DevTools/DevTools.client.js +1 -1
- package/dist/esnext/foundation/DevTools/DevTools.server.js +4 -3
- package/dist/esnext/foundation/DevTools/components/Interface.client.js +1 -1
- package/dist/esnext/foundation/DevTools/components/Panels.d.ts +2 -2
- package/dist/esnext/foundation/DevTools/components/Panels.js +3 -3
- package/dist/esnext/foundation/DevTools/components/Performance.client.js +1 -1
- package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +2 -1
- package/dist/esnext/foundation/DevTools/components/Settings.client.js +1 -1
- package/dist/esnext/foundation/DevTools/components/index.d.ts +2 -2
- package/dist/esnext/foundation/DevTools/components/index.js +2 -2
- package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +1 -1
- package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +5 -5
- package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +3 -3
- package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +2 -2
- package/dist/esnext/foundation/Form/Form.client.d.ts +11 -0
- package/dist/esnext/foundation/Form/Form.client.js +51 -0
- package/dist/esnext/foundation/Head/Head.client.js +1 -1
- package/dist/esnext/foundation/Head/index.d.ts +1 -1
- package/dist/esnext/foundation/Head/index.js +1 -1
- package/dist/esnext/foundation/Html/Html.d.ts +1 -1
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +5 -5
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +4 -4
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +2 -2
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +2 -2
- package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +2 -2
- package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +1 -1
- package/dist/esnext/foundation/Redirect/Redirect.client.js +1 -1
- package/dist/esnext/foundation/Route/Route.server.js +3 -3
- package/dist/esnext/foundation/Router/BrowserRouter.client.js +2 -2
- package/dist/esnext/foundation/Router/Router.server.js +1 -1
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +3 -1
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +3 -1
- package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +1 -1
- package/dist/esnext/foundation/ServerPropsProvider/index.js +1 -1
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +2 -2
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +3 -3
- package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +1 -1
- package/dist/esnext/foundation/ServerRequestProvider/index.js +1 -1
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +1 -1
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +2 -2
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +7 -6
- package/dist/esnext/foundation/ShopifyProvider/index.d.ts +1 -1
- package/dist/esnext/foundation/ShopifyProvider/index.js +1 -1
- package/dist/esnext/foundation/ShopifyProvider/types.d.ts +4 -3
- package/dist/esnext/foundation/fetchSync/ResponseSync.js +2 -2
- package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +1 -1
- package/dist/esnext/foundation/fetchSync/client/fetchSync.js +2 -2
- package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +2 -2
- package/dist/esnext/foundation/fetchSync/server/fetchSync.js +3 -3
- package/dist/esnext/foundation/index.d.ts +3 -3
- package/dist/esnext/foundation/index.js +3 -3
- package/dist/esnext/foundation/session/session-types.d.ts +13 -0
- package/dist/esnext/foundation/session/session-types.js +1 -0
- package/dist/esnext/foundation/session/session.d.ts +4 -16
- package/dist/esnext/foundation/session/session.js +1 -1
- package/dist/esnext/foundation/ssr-interop.d.ts +2 -2
- package/dist/esnext/foundation/ssr-interop.js +2 -2
- package/dist/esnext/foundation/useNavigate/useNavigate.js +2 -2
- package/dist/esnext/foundation/useQuery/hooks.d.ts +1 -1
- package/dist/esnext/foundation/useQuery/hooks.js +4 -4
- package/dist/esnext/foundation/useQuery/index.d.ts +1 -1
- package/dist/esnext/foundation/useQuery/index.js +1 -1
- package/dist/esnext/foundation/useRequestContext/index.js +1 -1
- package/dist/esnext/foundation/useRouteParams/useRouteParams.js +2 -2
- package/dist/esnext/foundation/useServerProps/index.d.ts +1 -1
- package/dist/esnext/foundation/useServerProps/index.js +1 -1
- package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +1 -1
- package/dist/esnext/foundation/useServerProps/use-server-props.js +1 -1
- package/dist/esnext/foundation/useSession/useSession.js +1 -1
- package/dist/esnext/foundation/useShop/index.d.ts +1 -1
- package/dist/esnext/foundation/useShop/index.js +1 -1
- package/dist/esnext/foundation/useShop/use-shop.d.ts +1 -1
- package/dist/esnext/foundation/useShop/use-shop.js +2 -2
- package/dist/esnext/foundation/useUrl/index.d.ts +1 -1
- package/dist/esnext/foundation/useUrl/index.js +1 -1
- package/dist/esnext/foundation/useUrl/useUrl.js +4 -4
- package/dist/esnext/framework/load-config.js +2 -2
- package/dist/esnext/framework/middleware.d.ts +1 -1
- package/dist/esnext/framework/middleware.js +2 -2
- package/dist/esnext/framework/plugin.d.ts +1 -1
- package/dist/esnext/framework/plugin.js +14 -13
- package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +1 -1
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.d.ts +2 -0
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.js +113 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +1 -1
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +3 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +1 -1
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +2 -2
- 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 +11 -1
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +1 -1
- package/dist/esnext/framework/types.d.ts +13 -0
- package/dist/esnext/hooks/index.d.ts +6 -6
- package/dist/esnext/hooks/index.js +6 -6
- package/dist/esnext/hooks/useCart/index.d.ts +1 -1
- package/dist/esnext/hooks/useCart/index.js +1 -1
- package/dist/esnext/hooks/useCart/useCart.d.ts +1 -1
- package/dist/esnext/hooks/useCart/useCart.js +1 -1
- package/dist/esnext/hooks/useCartLine/index.d.ts +1 -1
- package/dist/esnext/hooks/useCartLine/index.js +1 -1
- package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +13 -13
- package/dist/esnext/hooks/useCartLine/useCartLine.js +1 -1
- package/dist/esnext/hooks/useLoadScript/index.d.ts +1 -1
- package/dist/esnext/hooks/useLoadScript/index.js +1 -1
- package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +1 -1
- package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +1 -1
- package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +2 -3
- package/dist/esnext/hooks/useLocalization/useLocalization.js +2 -2
- package/dist/esnext/hooks/useMeasurement/hooks.d.ts +1 -1
- package/dist/esnext/hooks/useMeasurement/hooks.js +2 -2
- package/dist/esnext/hooks/useMeasurement/index.d.ts +1 -1
- package/dist/esnext/hooks/useMeasurement/index.js +1 -1
- package/dist/esnext/hooks/useMoney/hooks.d.ts +1 -1
- package/dist/esnext/hooks/useMoney/hooks.js +1 -1
- package/dist/esnext/hooks/useMoney/index.d.ts +1 -1
- package/dist/esnext/hooks/useMoney/index.js +1 -1
- package/dist/esnext/hooks/useProductOptions/helpers.d.ts +2 -2
- package/dist/esnext/hooks/useProductOptions/index.d.ts +2 -2
- package/dist/esnext/hooks/useProductOptions/index.js +2 -2
- package/dist/esnext/hooks/useProductOptions/types.d.ts +1 -1
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -1
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +1 -1
- package/dist/esnext/hooks/useShopQuery/hooks.d.ts +1 -1
- package/dist/esnext/hooks/useShopQuery/hooks.js +16 -11
- package/dist/esnext/hooks/useShopQuery/index.d.ts +1 -1
- package/dist/esnext/hooks/useShopQuery/index.js +1 -1
- package/dist/esnext/index.d.ts +26 -26
- package/dist/esnext/index.js +22 -22
- package/dist/esnext/node.d.ts +1 -1
- package/dist/esnext/node.js +1 -1
- package/dist/esnext/platforms/index.d.ts +1 -1
- package/dist/esnext/platforms/index.js +1 -1
- package/dist/esnext/platforms/node.d.ts +1 -1
- package/dist/esnext/platforms/node.js +4 -4
- package/dist/esnext/platforms/virtual.d.ts +1 -1
- package/dist/esnext/platforms/virtual.js +0 -2
- package/dist/esnext/platforms/worker-event.js +1 -1
- package/dist/esnext/platforms/worker.js +1 -1
- package/dist/esnext/shared-types.d.ts +3 -0
- package/dist/esnext/types.d.ts +8 -7
- package/dist/esnext/types.js +1 -1
- package/dist/esnext/utilities/apiRoutes.d.ts +4 -4
- package/dist/esnext/utilities/apiRoutes.js +41 -6
- package/dist/esnext/utilities/error.js +1 -1
- package/dist/esnext/utilities/fetch.js +1 -1
- package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +1 -1
- package/dist/esnext/utilities/flattenConnection/index.d.ts +1 -1
- package/dist/esnext/utilities/flattenConnection/index.js +1 -1
- package/dist/esnext/utilities/hash.d.ts +1 -1
- package/dist/esnext/utilities/hash.js +1 -1
- package/dist/esnext/utilities/image_size.d.ts +1 -1
- package/dist/esnext/utilities/index.d.ts +12 -12
- package/dist/esnext/utilities/index.js +12 -12
- package/dist/esnext/utilities/isBrowser/index.d.ts +1 -1
- package/dist/esnext/utilities/isBrowser/index.js +1 -1
- package/dist/esnext/utilities/isServer/index.d.ts +1 -1
- package/dist/esnext/utilities/isServer/index.js +1 -1
- package/dist/esnext/utilities/isServer/isServer.js +1 -1
- package/dist/esnext/utilities/load_script.d.ts +1 -0
- package/dist/esnext/utilities/load_script.js +6 -1
- package/dist/esnext/utilities/locale/index.d.ts +1 -0
- package/dist/esnext/utilities/locale/index.js +1 -0
- package/dist/esnext/utilities/locale/locale.d.ts +7 -0
- package/dist/esnext/utilities/locale/locale.js +22 -0
- package/dist/esnext/utilities/log/index.d.ts +4 -4
- package/dist/esnext/utilities/log/index.js +4 -4
- package/dist/esnext/utilities/log/log-cache-api-status.js +1 -1
- package/dist/esnext/utilities/log/log-cache-header.d.ts +4 -4
- package/dist/esnext/utilities/log/log-cache-header.js +3 -3
- package/dist/esnext/utilities/log/log-query-timeline.d.ts +3 -3
- package/dist/esnext/utilities/log/log-query-timeline.js +13 -10
- package/dist/esnext/utilities/log/log.d.ts +1 -1
- package/dist/esnext/utilities/log/log.js +2 -2
- package/dist/esnext/utilities/log/utils.d.ts +1 -1
- package/dist/esnext/utilities/measurement.d.ts +1 -1
- package/dist/esnext/utilities/parseMetafield/index.d.ts +1 -1
- package/dist/esnext/utilities/parseMetafield/index.js +1 -1
- package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +2 -2
- package/dist/esnext/utilities/parseMetafield/parseMetafield.js +1 -1
- package/dist/esnext/utilities/storefrontApi.js +1 -1
- package/dist/esnext/utilities/suspense.d.ts +1 -1
- package/dist/esnext/utilities/suspense.js +1 -1
- package/dist/esnext/version.d.ts +1 -1
- package/dist/esnext/version.js +1 -1
- package/dist/node/foundation/session/session-types.d.ts +13 -0
- package/dist/node/foundation/session/session-types.js +2 -0
- package/dist/node/framework/load-config.js +3 -3
- package/dist/node/framework/middleware.d.ts +1 -1
- package/dist/node/framework/middleware.js +3 -3
- package/dist/node/framework/plugin.d.ts +1 -1
- package/dist/node/framework/plugin.js +25 -24
- package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +3 -3
- package/dist/node/framework/plugins/vite-plugin-css-rsc.d.ts +2 -0
- package/dist/node/framework/plugins/vite-plugin-css-rsc.js +119 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +1 -1
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +7 -7
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +1 -1
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +5 -5
- 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 +12 -2
- package/dist/node/framework/plugins/vite-plugin-platform-entry.js +2 -2
- package/dist/node/framework/types.d.ts +13 -0
- package/dist/node/shared-types.d.ts +3 -0
- package/package.json +14 -3
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +7 -0
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +7 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useLocalization } from '../../hooks/useLocalization/useLocalization';
|
|
3
|
-
import { Head } from '../../foundation/Head/Head.client';
|
|
2
|
+
import { useLocalization } from '../../hooks/useLocalization/useLocalization.js';
|
|
3
|
+
import { Head } from '../../foundation/Head/Head.client.js';
|
|
4
4
|
export function NoIndexPageSeo({ title, titleTemplate, lang, }) {
|
|
5
5
|
const { language: { isoCode: fallBacklang }, } = useLocalization();
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Page as PageType } from '../../storefront-api-types';
|
|
1
|
+
import type { Page as PageType } from '../../storefront-api-types.js';
|
|
2
2
|
import type { PartialDeep } from 'type-fest';
|
|
3
3
|
export declare function PageSeo({ title, seo }: PartialDeep<PageType>): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TitleSeo } from './TitleSeo.client';
|
|
3
|
-
import { DescriptionSeo } from './DescriptionSeo.client';
|
|
4
|
-
import { TwitterSeo } from './TwitterSeo.client';
|
|
2
|
+
import { TitleSeo } from './TitleSeo.client.js';
|
|
3
|
+
import { DescriptionSeo } from './DescriptionSeo.client.js';
|
|
4
|
+
import { TwitterSeo } from './TwitterSeo.client.js';
|
|
5
5
|
export function PageSeo({ title, seo }) {
|
|
6
6
|
const seoTitle = seo?.title ?? title;
|
|
7
7
|
const seoDescription = seo?.description;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Scalars, Product as ProductType } from '../../storefront-api-types';
|
|
1
|
+
import type { Scalars, Product as ProductType } from '../../storefront-api-types.js';
|
|
2
2
|
import type { PartialDeep } from 'type-fest';
|
|
3
3
|
export declare function ProductSeo({ url, title, description, seo, vendor, featuredImage, variants, }: PartialDeep<ProductType> & {
|
|
4
4
|
url: Scalars['URL'];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Head } from '../../foundation/Head';
|
|
3
|
-
import { TitleSeo } from './TitleSeo.client';
|
|
4
|
-
import { DescriptionSeo } from './DescriptionSeo.client';
|
|
5
|
-
import { TwitterSeo } from './TwitterSeo.client';
|
|
6
|
-
import { ImageSeo } from './ImageSeo.client';
|
|
7
|
-
import { flattenConnection } from '../../utilities/flattenConnection';
|
|
2
|
+
import { Head } from '../../foundation/Head/index.js';
|
|
3
|
+
import { TitleSeo } from './TitleSeo.client.js';
|
|
4
|
+
import { DescriptionSeo } from './DescriptionSeo.client.js';
|
|
5
|
+
import { TwitterSeo } from './TwitterSeo.client.js';
|
|
6
|
+
import { ImageSeo } from './ImageSeo.client.js';
|
|
7
|
+
import { flattenConnection } from '../../utilities/flattenConnection/index.js';
|
|
8
8
|
export function ProductSeo({ url, title, description, seo, vendor, featuredImage, variants, }) {
|
|
9
9
|
const seoTitle = seo?.title ?? title;
|
|
10
10
|
const seoDescription = seo?.description ?? description;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
import { ProductSeo } from './ProductSeo.client';
|
|
3
|
-
import { CollectionSeo } from './CollectionSeo.client';
|
|
4
|
-
import { PageSeo } from './PageSeo.client';
|
|
5
|
-
import { NoIndexPageSeo } from './NoIndexSeo.client';
|
|
2
|
+
import { ProductSeo } from './ProductSeo.client.js';
|
|
3
|
+
import { CollectionSeo } from './CollectionSeo.client.js';
|
|
4
|
+
import { PageSeo } from './PageSeo.client.js';
|
|
5
|
+
import { NoIndexPageSeo } from './NoIndexSeo.client.js';
|
|
6
6
|
import type { DefaultPage as DefaultPageType, HomePage as HomePageType } from './seo-types';
|
|
7
7
|
declare type Props = {
|
|
8
8
|
type: 'defaultSeo';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useUrl } from '../../foundation/useUrl';
|
|
3
|
-
import { DefaultPageSeo } from './DefaultPageSeo.client';
|
|
4
|
-
import { HomePageSeo } from './HomePageSeo.client';
|
|
5
|
-
import { ProductSeo } from './ProductSeo.client';
|
|
6
|
-
import { CollectionSeo } from './CollectionSeo.client';
|
|
7
|
-
import { PageSeo } from './PageSeo.client';
|
|
8
|
-
import { NoIndexPageSeo } from './NoIndexSeo.client';
|
|
2
|
+
import { useUrl } from '../../foundation/useUrl/index.js';
|
|
3
|
+
import { DefaultPageSeo } from './DefaultPageSeo.client.js';
|
|
4
|
+
import { HomePageSeo } from './HomePageSeo.client.js';
|
|
5
|
+
import { ProductSeo } from './ProductSeo.client.js';
|
|
6
|
+
import { CollectionSeo } from './CollectionSeo.client.js';
|
|
7
|
+
import { PageSeo } from './PageSeo.client.js';
|
|
8
|
+
import { NoIndexPageSeo } from './NoIndexSeo.client.js';
|
|
9
9
|
/**
|
|
10
10
|
* The `Seo` component renders SEO information on a webpage.
|
|
11
11
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Twitter } from './seo-types';
|
|
1
|
+
import type { Twitter } from './seo-types.js';
|
|
2
2
|
export declare function TwitterSeo({ site, title, description }: Partial<Twitter>): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Head } from '../../foundation/Head';
|
|
2
|
+
import { Head } from '../../foundation/Head/index.js';
|
|
3
3
|
export function TwitterSeo({ site, title, description }) {
|
|
4
4
|
return (React.createElement(Head, null,
|
|
5
5
|
React.createElement("meta", { name: "twitter:card", content: "summary_large_image" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Seo } from './Seo.client';
|
|
1
|
+
export { Seo } from './Seo.client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Seo } from './Seo.client';
|
|
1
|
+
export { Seo } from './Seo.client.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useShop } from '../../foundation/useShop';
|
|
3
|
-
import { useLoadScript } from '../../hooks/useLoadScript/useLoadScript.client';
|
|
2
|
+
import { useShop } from '../../foundation/useShop/index.js';
|
|
3
|
+
import { useLoadScript } from '../../hooks/useLoadScript/useLoadScript.client.js';
|
|
4
4
|
const URL = 'https://cdn.shopify.com/shopifycloud/shop-js/v1.0/client.js';
|
|
5
5
|
/**
|
|
6
6
|
* The `ShopPayButton` component renders a button that redirects to the Shop Pay checkout.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ShopPayButton } from './ShopPayButton.client';
|
|
1
|
+
export { ShopPayButton } from './ShopPayButton.client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ShopPayButton } from './ShopPayButton.client';
|
|
1
|
+
export { ShopPayButton } from './ShopPayButton.client.js';
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { shopifyImageLoader } from '../../utilities/index.js';
|
|
3
|
+
import type { Video as VideoType } from '../../storefront-api-types.js';
|
|
3
4
|
import type { PartialDeep } from 'type-fest';
|
|
4
5
|
interface VideoProps {
|
|
5
6
|
/** An object with fields that correspond to the Storefront API's [Video object](https://shopify.dev/api/storefront/latest/objects/video). */
|
|
6
7
|
data: PartialDeep<VideoType>;
|
|
7
8
|
/** An object of image size options for the video's `previewImage`. Uses `shopifyImageLoader` to generate the `poster` URL. */
|
|
8
9
|
previewImageOptions?: Parameters<typeof shopifyImageLoader>[0];
|
|
10
|
+
/** Props that will be passed to the `video` element's `source` children elements. */
|
|
11
|
+
sourceProps?: HTMLAttributes<HTMLSourceElement> & {
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
};
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
16
|
* The `Video` component renders a `video` for the Storefront API's [Video object](https://shopify.dev/api/storefront/reference/products/video).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { shopifyImageLoader } from '../../utilities';
|
|
2
|
+
import { shopifyImageLoader } from '../../utilities/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The `Video` component renders a `video` for the Storefront API's [Video object](https://shopify.dev/api/storefront/reference/products/video).
|
|
5
5
|
*/
|
|
6
6
|
export function Video(props) {
|
|
7
|
-
const { data, previewImageOptions, id = data.id, playsInline = true, controls = true, ...passthroughProps } = props;
|
|
7
|
+
const { data, previewImageOptions, id = data.id, playsInline = true, controls = true, sourceProps = {}, ...passthroughProps } = props;
|
|
8
8
|
const posterUrl = shopifyImageLoader({
|
|
9
9
|
src: data.previewImage?.url ?? '',
|
|
10
10
|
...previewImageOptions,
|
|
@@ -18,6 +18,6 @@ export function Video(props) {
|
|
|
18
18
|
if (!(source?.url && source?.mimeType)) {
|
|
19
19
|
throw new Error(`<Video/> needs 'source.url' and 'source.mimeType'`);
|
|
20
20
|
}
|
|
21
|
-
return (React.createElement("source", { key: source.url, src: source.url, type: source.mimeType }));
|
|
21
|
+
return (React.createElement("source", { ...sourceProps, key: source.url, src: source.url, type: source.mimeType }));
|
|
22
22
|
})));
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Video } from './Video';
|
|
1
|
+
export { Video } from './Video.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Video } from './Video';
|
|
1
|
+
export { Video } from './Video.js';
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export { Link } from './Link';
|
|
2
|
-
export { MediaFile } from './MediaFile';
|
|
3
|
-
export { Video } from './Video';
|
|
4
|
-
export { Image } from './Image';
|
|
5
|
-
export { ExternalVideo } from './ExternalVideo';
|
|
6
|
-
export { AddToCartButton } from './AddToCartButton';
|
|
7
|
-
export { ModelViewer } from './ModelViewer';
|
|
8
|
-
export { Money } from './Money';
|
|
9
|
-
export { Metafield } from './Metafield';
|
|
10
|
-
export type { MetafieldType } from './Metafield';
|
|
11
|
-
export { CartLineProvider, useCartLine } from './CartLineProvider';
|
|
12
|
-
export { CartLineImage } from './CartLineImage';
|
|
13
|
-
export { CartLinePrice } from './CartLinePrice';
|
|
14
|
-
export { CartLineProductTitle } from './CartLineProductTitle';
|
|
15
|
-
export { CartLineQuantity } from './CartLineQuantity';
|
|
16
|
-
export { CartLineQuantityAdjustButton } from './CartLineQuantityAdjustButton';
|
|
17
|
-
export { CartLines } from './CartLines';
|
|
18
|
-
export { CartCheckoutButton } from './CartCheckoutButton';
|
|
19
|
-
export { CartShopPayButton } from './CartShopPayButton';
|
|
20
|
-
export { CartCost } from './CartCost';
|
|
21
|
-
export { CartProvider, useCart, useInstantCheckout } from './CartProvider';
|
|
22
|
-
export type { State, Status, Cart, CartWithActions, CartAction, } from './CartProvider';
|
|
23
|
-
export { ProductOptionsProvider } from './ProductOptionsProvider';
|
|
24
|
-
export { ProductPrice } from './ProductPrice';
|
|
25
|
-
export { BuyNowButton } from './BuyNowButton';
|
|
26
|
-
export { ShopPayButton } from './ShopPayButton';
|
|
27
|
-
export { Seo } from './Seo';
|
|
1
|
+
export { Link } from './Link/index.js';
|
|
2
|
+
export { MediaFile } from './MediaFile/index.js';
|
|
3
|
+
export { Video } from './Video/index.js';
|
|
4
|
+
export { Image } from './Image/index.js';
|
|
5
|
+
export { ExternalVideo } from './ExternalVideo/index.js';
|
|
6
|
+
export { AddToCartButton } from './AddToCartButton/index.js';
|
|
7
|
+
export { ModelViewer } from './ModelViewer/index.js';
|
|
8
|
+
export { Money } from './Money/index.js';
|
|
9
|
+
export { Metafield } from './Metafield/index.js';
|
|
10
|
+
export type { MetafieldType } from './Metafield/index.js';
|
|
11
|
+
export { CartLineProvider, useCartLine } from './CartLineProvider/index.js';
|
|
12
|
+
export { CartLineImage } from './CartLineImage/index.js';
|
|
13
|
+
export { CartLinePrice } from './CartLinePrice/index.js';
|
|
14
|
+
export { CartLineProductTitle } from './CartLineProductTitle/index.js';
|
|
15
|
+
export { CartLineQuantity } from './CartLineQuantity/index.js';
|
|
16
|
+
export { CartLineQuantityAdjustButton } from './CartLineQuantityAdjustButton/index.js';
|
|
17
|
+
export { CartLines } from './CartLines/index.js';
|
|
18
|
+
export { CartCheckoutButton } from './CartCheckoutButton/index.js';
|
|
19
|
+
export { CartShopPayButton } from './CartShopPayButton/index.js';
|
|
20
|
+
export { CartCost } from './CartCost/index.js';
|
|
21
|
+
export { CartProvider, useCart, useInstantCheckout, } from './CartProvider/index.js';
|
|
22
|
+
export type { State, Status, Cart, CartWithActions, CartAction, } from './CartProvider/index.js';
|
|
23
|
+
export { ProductOptionsProvider } from './ProductOptionsProvider/index.js';
|
|
24
|
+
export { ProductPrice } from './ProductPrice/index.js';
|
|
25
|
+
export { BuyNowButton } from './BuyNowButton/index.js';
|
|
26
|
+
export { ShopPayButton } from './ShopPayButton/index.js';
|
|
27
|
+
export { Seo } from './Seo/index.js';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export { Link } from './Link';
|
|
2
|
-
export { MediaFile } from './MediaFile';
|
|
3
|
-
export { Video } from './Video';
|
|
4
|
-
export { Image } from './Image';
|
|
5
|
-
export { ExternalVideo } from './ExternalVideo';
|
|
6
|
-
export { AddToCartButton } from './AddToCartButton';
|
|
7
|
-
export { ModelViewer } from './ModelViewer';
|
|
8
|
-
export { Money } from './Money';
|
|
9
|
-
export { Metafield } from './Metafield';
|
|
10
|
-
export { CartLineProvider, useCartLine } from './CartLineProvider';
|
|
11
|
-
export { CartLineImage } from './CartLineImage';
|
|
12
|
-
export { CartLinePrice } from './CartLinePrice';
|
|
13
|
-
export { CartLineProductTitle } from './CartLineProductTitle';
|
|
14
|
-
export { CartLineQuantity } from './CartLineQuantity';
|
|
15
|
-
export { CartLineQuantityAdjustButton } from './CartLineQuantityAdjustButton';
|
|
16
|
-
export { CartLines } from './CartLines';
|
|
17
|
-
export { CartCheckoutButton } from './CartCheckoutButton';
|
|
18
|
-
export { CartShopPayButton } from './CartShopPayButton';
|
|
19
|
-
export { CartCost } from './CartCost';
|
|
20
|
-
export { CartProvider, useCart, useInstantCheckout } from './CartProvider';
|
|
21
|
-
export { ProductOptionsProvider } from './ProductOptionsProvider';
|
|
22
|
-
export { ProductPrice } from './ProductPrice';
|
|
23
|
-
export { BuyNowButton } from './BuyNowButton';
|
|
24
|
-
export { ShopPayButton } from './ShopPayButton';
|
|
25
|
-
export { Seo } from './Seo';
|
|
1
|
+
export { Link } from './Link/index.js';
|
|
2
|
+
export { MediaFile } from './MediaFile/index.js';
|
|
3
|
+
export { Video } from './Video/index.js';
|
|
4
|
+
export { Image } from './Image/index.js';
|
|
5
|
+
export { ExternalVideo } from './ExternalVideo/index.js';
|
|
6
|
+
export { AddToCartButton } from './AddToCartButton/index.js';
|
|
7
|
+
export { ModelViewer } from './ModelViewer/index.js';
|
|
8
|
+
export { Money } from './Money/index.js';
|
|
9
|
+
export { Metafield } from './Metafield/index.js';
|
|
10
|
+
export { CartLineProvider, useCartLine } from './CartLineProvider/index.js';
|
|
11
|
+
export { CartLineImage } from './CartLineImage/index.js';
|
|
12
|
+
export { CartLinePrice } from './CartLinePrice/index.js';
|
|
13
|
+
export { CartLineProductTitle } from './CartLineProductTitle/index.js';
|
|
14
|
+
export { CartLineQuantity } from './CartLineQuantity/index.js';
|
|
15
|
+
export { CartLineQuantityAdjustButton } from './CartLineQuantityAdjustButton/index.js';
|
|
16
|
+
export { CartLines } from './CartLines/index.js';
|
|
17
|
+
export { CartCheckoutButton } from './CartCheckoutButton/index.js';
|
|
18
|
+
export { CartShopPayButton } from './CartShopPayButton/index.js';
|
|
19
|
+
export { CartCost } from './CartCost/index.js';
|
|
20
|
+
export { CartProvider, useCart, useInstantCheckout, } from './CartProvider/index.js';
|
|
21
|
+
export { ProductOptionsProvider } from './ProductOptionsProvider/index.js';
|
|
22
|
+
export { ProductPrice } from './ProductPrice/index.js';
|
|
23
|
+
export { BuyNowButton } from './BuyNowButton/index.js';
|
|
24
|
+
export { ShopPayButton } from './ShopPayButton/index.js';
|
|
25
|
+
export { Seo } from './Seo/index.js';
|
package/dist/esnext/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InlineHydrogenConfig } from './types';
|
|
1
|
+
import type { InlineHydrogenConfig } from './types.js';
|
|
2
2
|
export declare const defineConfig: (params: InlineHydrogenConfig) => InlineHydrogenConfig;
|
|
3
3
|
export type { InlineHydrogenConfig as HydrogenConfig };
|
|
4
|
-
export { ShopifyServerAnalyticsConnector } from './foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector';
|
|
5
|
-
export { PerformanceMetricsServerAnalyticsConnector } from './foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector';
|
|
6
|
-
export { CookieSessionStorage } from './foundation/CookieSessionStorage/CookieSessionStorage';
|
|
7
|
-
export { MemorySessionStorage } from './foundation/MemorySessionStorage/MemorySessionStorage';
|
|
4
|
+
export { ShopifyServerAnalyticsConnector } from './foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js';
|
|
5
|
+
export { PerformanceMetricsServerAnalyticsConnector } from './foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js';
|
|
6
|
+
export { CookieSessionStorage } from './foundation/CookieSessionStorage/CookieSessionStorage.js';
|
|
7
|
+
export { MemorySessionStorage } from './foundation/MemorySessionStorage/MemorySessionStorage.js';
|
package/dist/esnext/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const defineConfig = (params) => params;
|
|
2
|
-
export { ShopifyServerAnalyticsConnector } from './foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector';
|
|
3
|
-
export { PerformanceMetricsServerAnalyticsConnector } from './foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector';
|
|
4
|
-
export { CookieSessionStorage } from './foundation/CookieSessionStorage/CookieSessionStorage';
|
|
5
|
-
export { MemorySessionStorage } from './foundation/MemorySessionStorage/MemorySessionStorage';
|
|
2
|
+
export { ShopifyServerAnalyticsConnector } from './foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js';
|
|
3
|
+
export { PerformanceMetricsServerAnalyticsConnector } from './foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js';
|
|
4
|
+
export { CookieSessionStorage } from './foundation/CookieSessionStorage/CookieSessionStorage.js';
|
|
5
|
+
export { MemorySessionStorage } from './foundation/MemorySessionStorage/MemorySessionStorage.js';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import React, { Suspense, useState, StrictMode, Fragment, } from 'react';
|
|
1
|
+
import React, { Suspense, useState, StrictMode, Fragment, useEffect, } from 'react';
|
|
2
2
|
import { hydrateRoot } from 'react-dom/client';
|
|
3
3
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
4
|
import { createFromFetch, createFromReadableStream,
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
} from '@shopify/hydrogen/vendor/react-server-dom-vite';
|
|
7
|
-
import { RSC_PATHNAME } from './constants';
|
|
8
|
-
import { ServerPropsProvider } from './foundation/ServerPropsProvider';
|
|
9
|
-
import { ClientAnalytics } from './foundation/Analytics/';
|
|
7
|
+
import { RSC_PATHNAME } from './constants.js';
|
|
8
|
+
import { ServerPropsProvider } from './foundation/ServerPropsProvider/index.js';
|
|
9
|
+
import { ClientAnalytics } from './foundation/Analytics/index.js';
|
|
10
|
+
// @ts-expect-error
|
|
11
|
+
import CustomErrorPage from 'virtual__error.jsx';
|
|
10
12
|
let rscReader;
|
|
11
13
|
const cache = new Map();
|
|
12
14
|
// Hydrate an SSR response from <meta> tags placed in the DOM.
|
|
@@ -93,7 +95,9 @@ const renderHydrogen = async (ClientWrapper) => {
|
|
|
93
95
|
const ServerRequestProviderMock = () => null;
|
|
94
96
|
hydrateRoot(root, React.createElement(RootComponent, null,
|
|
95
97
|
React.createElement(ServerRequestProviderMock, null),
|
|
96
|
-
React.createElement(ErrorBoundary, { FallbackComponent:
|
|
98
|
+
React.createElement(ErrorBoundary, { FallbackComponent: CustomErrorPage
|
|
99
|
+
? ({ error }) => (React.createElement(CustomErrorWrapper, { error: error, errorPage: CustomErrorPage }))
|
|
100
|
+
: DefaultError },
|
|
97
101
|
React.createElement(Suspense, { fallback: null },
|
|
98
102
|
React.createElement(Content, { clientWrapper: ClientWrapper })))));
|
|
99
103
|
};
|
|
@@ -103,16 +107,28 @@ function Content({ clientWrapper: ClientWrapper = ({ children }) => children, })
|
|
|
103
107
|
pathname: window.location.pathname,
|
|
104
108
|
search: window.location.search,
|
|
105
109
|
});
|
|
106
|
-
const
|
|
107
|
-
|
|
110
|
+
const [rscResponseFromApiRoute, setRscResponseFromApiRoute] = useState(null);
|
|
111
|
+
const response = useServerResponse(serverProps, rscResponseFromApiRoute);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
// If server props ever change, then use a fresh
|
|
114
|
+
// _rsc request and ignore any response from API routes.
|
|
115
|
+
setRscResponseFromApiRoute(null);
|
|
116
|
+
}, [serverProps]);
|
|
117
|
+
return (React.createElement(ServerPropsProvider, { initialServerProps: serverProps, setServerPropsForRsc: setServerProps, setRscResponseFromApiRoute: setRscResponseFromApiRoute },
|
|
108
118
|
React.createElement(ClientWrapper, null, response.readRoot())));
|
|
109
119
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
function CustomErrorWrapper({ error, errorPage, }) {
|
|
121
|
+
const Error = React.lazy(errorPage);
|
|
122
|
+
return (React.createElement(ErrorBoundary, { FallbackComponent: ({ error: errorRenderingCustomPage }) => {
|
|
123
|
+
if (import.meta.env.DEV) {
|
|
124
|
+
console.error('Error rendering custom error page:\n' + errorRenderingCustomPage);
|
|
125
|
+
}
|
|
126
|
+
return React.createElement(DefaultError, { error: error });
|
|
127
|
+
} },
|
|
128
|
+
React.createElement(Suspense, { fallback: null },
|
|
129
|
+
React.createElement(Error, { error: error }))));
|
|
130
|
+
}
|
|
131
|
+
function DefaultError({ error }) {
|
|
116
132
|
return (React.createElement("div", { style: {
|
|
117
133
|
padding: '2em',
|
|
118
134
|
textAlign: 'center',
|
|
@@ -126,8 +142,13 @@ function Error({ error }) {
|
|
|
126
142
|
React.createElement("a", { href: "/", style: { textDecoration: 'underline' } }, "home page"),
|
|
127
143
|
"."))));
|
|
128
144
|
}
|
|
129
|
-
function useServerResponse(state) {
|
|
145
|
+
function useServerResponse(state, apiRouteRscResponse) {
|
|
130
146
|
const key = JSON.stringify(state);
|
|
147
|
+
if (apiRouteRscResponse) {
|
|
148
|
+
cache.clear();
|
|
149
|
+
cache.set(apiRouteRscResponse.url, apiRouteRscResponse.response);
|
|
150
|
+
return apiRouteRscResponse.response;
|
|
151
|
+
}
|
|
131
152
|
let response = cache.get(key);
|
|
132
153
|
if (response) {
|
|
133
154
|
return response;
|