@shopify/hydrogen 1.1.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +13 -7
- package/dist/esnext/components/CartProvider/cart-queries.d.ts +1 -1
- package/dist/esnext/components/CartProvider/cart-queries.js +1 -0
- 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 +3 -3
- 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 +2 -2
- package/dist/esnext/components/Image/Image.js +5 -5
- 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/constants.d.ts +1 -0
- package/dist/esnext/constants.js +1 -0
- 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 +76 -51
- package/dist/esnext/experimental.d.ts +2 -0
- package/dist/esnext/experimental.js +2 -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 -4
- 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 +6 -5
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +5 -4
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +2 -4
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +4 -18
- 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 +4 -4
- 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 +15 -0
- package/dist/esnext/foundation/session/session-types.js +1 -0
- package/dist/esnext/foundation/session/session.d.ts +7 -16
- package/dist/esnext/foundation/session/session.js +17 -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 +4 -1
- package/dist/esnext/foundation/useQuery/hooks.js +5 -5
- 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.d.ts +1 -0
- package/dist/esnext/foundation/useSession/useSession.js +14 -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 +17 -15
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.d.ts +2 -0
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.js +8 -0
- 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 +108 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +2 -1
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +8 -4
- 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 +35 -7
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +1 -1
- package/dist/esnext/framework/types.d.ts +14 -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/storefront-api-types.d.ts +38 -31
- package/dist/esnext/storefront-api-types.js +4 -2
- 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 +51 -6
- package/dist/esnext/utilities/error.js +1 -1
- package/dist/esnext/utilities/fetch.js +5 -2
- 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 +10 -4
- package/dist/esnext/utilities/log/utils.d.ts +1 -1
- package/dist/esnext/utilities/log/utils.js +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 +15 -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 +26 -24
- package/dist/node/framework/plugins/vite-plugin-assets-version.d.ts +2 -0
- package/dist/node/framework/plugins/vite-plugin-assets-version.js +11 -0
- 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 +114 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +2 -1
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +11 -4
- 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 +35 -7
- package/dist/node/framework/plugins/vite-plugin-platform-entry.js +2 -2
- package/dist/node/framework/types.d.ts +14 -0
- package/dist/node/shared-types.d.ts +3 -0
- package/package.json +15 -3
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +10 -2
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +10 -2
- package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.js +0 -11
- package/dist/node/framework/plugins/vite-plugin-purge-query-cache.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-purge-query-cache.js +0 -16
|
@@ -3,4 +3,18 @@ export interface HydrogenVitePluginOptions {
|
|
|
3
3
|
purgeQueryCacheOnBuild?: boolean;
|
|
4
4
|
configPath?: string;
|
|
5
5
|
optimizeBoundaries?: boolean | 'build';
|
|
6
|
+
assetHashVersion?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Experimental features
|
|
9
|
+
*/
|
|
10
|
+
experimental?: {
|
|
11
|
+
/**
|
|
12
|
+
* CSS compatibility with React Server Components.
|
|
13
|
+
* - `global` inlines all the styles in the DOM and works for all types of CSS.
|
|
14
|
+
* - `modules-only` inlines the styles in RSC responses and only works for CSS Modules.
|
|
15
|
+
* @defaultValue `modules-only`
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
css: 'global' | 'modules-only';
|
|
19
|
+
};
|
|
6
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { useProductOptions } from './useProductOptions';
|
|
2
|
-
export * from './useProductOptions/types';
|
|
3
|
-
export { useMoney } from './useMoney';
|
|
4
|
-
export { useMeasurement } from './useMeasurement';
|
|
5
|
-
export { useLoadScript } from './useLoadScript';
|
|
6
|
-
export { useLocalization } from './useLocalization/useLocalization';
|
|
1
|
+
export { useProductOptions } from './useProductOptions/index.js';
|
|
2
|
+
export * from './useProductOptions/types.js';
|
|
3
|
+
export { useMoney } from './useMoney/index.js';
|
|
4
|
+
export { useMeasurement } from './useMeasurement/index.js';
|
|
5
|
+
export { useLoadScript } from './useLoadScript/index.js';
|
|
6
|
+
export { useLocalization } from './useLocalization/useLocalization.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { useProductOptions } from './useProductOptions';
|
|
2
|
-
export * from './useProductOptions/types';
|
|
3
|
-
export { useMoney } from './useMoney';
|
|
4
|
-
export { useMeasurement } from './useMeasurement';
|
|
5
|
-
export { useLoadScript } from './useLoadScript';
|
|
6
|
-
export { useLocalization } from './useLocalization/useLocalization';
|
|
1
|
+
export { useProductOptions } from './useProductOptions/index.js';
|
|
2
|
+
export * from './useProductOptions/types.js';
|
|
3
|
+
export { useMoney } from './useMoney/index.js';
|
|
4
|
+
export { useMeasurement } from './useMeasurement/index.js';
|
|
5
|
+
export { useLoadScript } from './useLoadScript/index.js';
|
|
6
|
+
export { useLocalization } from './useLocalization/useLocalization.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useCart } from './useCart';
|
|
1
|
+
export { useCart } from './useCart.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useCart } from './useCart';
|
|
1
|
+
export { useCart } from './useCart.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `useCart` hook provides access to the cart object. It must be a descendent of a `CartProvider` component.
|
|
3
3
|
*/
|
|
4
|
-
export declare function useCart(): import("
|
|
4
|
+
export declare function useCart(): import("../../client.js").CartWithActions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CartContext } from '../../components/CartProvider/context';
|
|
2
|
+
import { CartContext } from '../../components/CartProvider/context.js';
|
|
3
3
|
/**
|
|
4
4
|
* The `useCart` hook provides access to the cart object. It must be a descendent of a `CartProvider` component.
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useCartLine } from './useCartLine';
|
|
1
|
+
export { useCartLine } from './useCartLine.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useCartLine } from './useCartLine';
|
|
1
|
+
export { useCartLine } from './useCartLine.js';
|
|
@@ -3,37 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare function useCartLine(): {
|
|
5
5
|
__typename?: "CartLine" | undefined;
|
|
6
|
-
} & Pick<import("../../storefront-api-types").CartLine, "id" | "quantity"> & {
|
|
6
|
+
} & Pick<import("../../storefront-api-types.js").CartLine, "id" | "quantity"> & {
|
|
7
7
|
attributes: ({
|
|
8
8
|
__typename?: "Attribute" | undefined;
|
|
9
|
-
} & Pick<import("../../storefront-api-types").Attribute, "key" | "value">)[];
|
|
9
|
+
} & Pick<import("../../storefront-api-types.js").Attribute, "key" | "value">)[];
|
|
10
10
|
cost: {
|
|
11
11
|
__typename?: "CartLineCost" | undefined;
|
|
12
12
|
} & {
|
|
13
13
|
totalAmount: {
|
|
14
14
|
__typename?: "MoneyV2" | undefined;
|
|
15
|
-
} & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">;
|
|
16
|
-
compareAtAmountPerQuantity?: import("../../storefront-api-types").Maybe<{
|
|
15
|
+
} & Pick<import("../../storefront-api-types.js").MoneyV2, "currencyCode" | "amount">;
|
|
16
|
+
compareAtAmountPerQuantity?: import("../../storefront-api-types.js").Maybe<{
|
|
17
17
|
__typename?: "MoneyV2" | undefined;
|
|
18
|
-
} & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">> | undefined;
|
|
18
|
+
} & Pick<import("../../storefront-api-types.js").MoneyV2, "currencyCode" | "amount">> | undefined;
|
|
19
19
|
};
|
|
20
20
|
merchandise: {
|
|
21
21
|
__typename?: "ProductVariant" | undefined;
|
|
22
|
-
} & Pick<import("../../storefront-api-types").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
|
|
23
|
-
compareAtPriceV2?: import("../../storefront-api-types").Maybe<{
|
|
22
|
+
} & Pick<import("../../storefront-api-types.js").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
|
|
23
|
+
compareAtPriceV2?: import("../../storefront-api-types.js").Maybe<{
|
|
24
24
|
__typename?: "MoneyV2" | undefined;
|
|
25
|
-
} & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">> | undefined;
|
|
25
|
+
} & Pick<import("../../storefront-api-types.js").MoneyV2, "currencyCode" | "amount">> | undefined;
|
|
26
26
|
priceV2: {
|
|
27
27
|
__typename?: "MoneyV2" | undefined;
|
|
28
|
-
} & Pick<import("../../storefront-api-types").MoneyV2, "currencyCode" | "amount">;
|
|
29
|
-
image?: import("../../storefront-api-types").Maybe<{
|
|
28
|
+
} & Pick<import("../../storefront-api-types.js").MoneyV2, "currencyCode" | "amount">;
|
|
29
|
+
image?: import("../../storefront-api-types.js").Maybe<{
|
|
30
30
|
__typename?: "Image" | undefined;
|
|
31
|
-
} & Pick<import("../../storefront-api-types").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
|
|
31
|
+
} & Pick<import("../../storefront-api-types.js").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
|
|
32
32
|
product: {
|
|
33
33
|
__typename?: "Product" | undefined;
|
|
34
|
-
} & Pick<import("../../storefront-api-types").Product, "title" | "handle">;
|
|
34
|
+
} & Pick<import("../../storefront-api-types.js").Product, "title" | "handle">;
|
|
35
35
|
selectedOptions: ({
|
|
36
36
|
__typename?: "SelectedOption" | undefined;
|
|
37
|
-
} & Pick<import("../../storefront-api-types").SelectedOption, "name" | "value">)[];
|
|
37
|
+
} & Pick<import("../../storefront-api-types.js").SelectedOption, "name" | "value">)[];
|
|
38
38
|
};
|
|
39
39
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { CartLineContext } from '../../components/CartLineProvider/context';
|
|
2
|
+
import { CartLineContext } from '../../components/CartLineProvider/context.js';
|
|
3
3
|
/**
|
|
4
4
|
* The `useCartLine` hook provides access to the cart line object. It must be a descendent of a `CartProvider` component.
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useLoadScript } from './useLoadScript.client';
|
|
1
|
+
export { useLoadScript } from './useLoadScript.client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useLoadScript } from './useLoadScript.client';
|
|
1
|
+
export { useLoadScript } from './useLoadScript.client.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { LocalizationContextValue } from '../../foundation/ShopifyProvider/types';
|
|
2
|
-
import { CountryCode, LanguageCode } from '../../storefront-api-types';
|
|
1
|
+
import type { Locale, LocalizationContextValue } from '../../foundation/ShopifyProvider/types.js';
|
|
3
2
|
export declare function useLocalization(): LocalizationContextValue & {
|
|
4
|
-
locale:
|
|
3
|
+
locale: Locale;
|
|
5
4
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LocalizationContext } from '../../foundation/ShopifyProvider/ShopifyProvider.client';
|
|
2
|
-
import { useEnvContext } from '../../foundation/ssr-interop';
|
|
1
|
+
import { LocalizationContext } from '../../foundation/ShopifyProvider/ShopifyProvider.client.js';
|
|
2
|
+
import { useEnvContext } from '../../foundation/ssr-interop.js';
|
|
3
3
|
export function useLocalization() {
|
|
4
4
|
const localization = useEnvContext((req) => req.ctx.localization, LocalizationContext);
|
|
5
5
|
if (localization == null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useLocalization } from '../useLocalization/useLocalization';
|
|
3
|
-
import { getMeasurementAsParts, getMeasurementAsString } from '../../utilities';
|
|
2
|
+
import { useLocalization } from '../useLocalization/useLocalization.js';
|
|
3
|
+
import { getMeasurementAsParts, getMeasurementAsString, } from '../../utilities/index.js';
|
|
4
4
|
export function useMeasurement(measurement, options = {}) {
|
|
5
5
|
const { locale } = useLocalization();
|
|
6
6
|
return useMemo(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useMeasurement } from './hooks';
|
|
1
|
+
export { useMeasurement } from './hooks.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useMeasurement } from './hooks';
|
|
1
|
+
export { useMeasurement } from './hooks.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useLocalization } from '../useLocalization/useLocalization';
|
|
2
|
+
import { useLocalization } from '../useLocalization/useLocalization.js';
|
|
3
3
|
/**
|
|
4
4
|
* The `useMoney` hook takes a [MoneyV2 object](https://shopify.dev/api/storefront/reference/common-objects/moneyv2) and returns a
|
|
5
5
|
* default-formatted string of the amount with the correct currency indicator, along with some of the parts provided by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useMoney } from './hooks';
|
|
1
|
+
export { useMoney } from './hooks.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useMoney } from './hooks';
|
|
1
|
+
export { useMoney } from './hooks.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SelectedOptions, OptionWithValues } from './types';
|
|
2
|
-
import type { ProductVariant as ProductVariantType } from '../../storefront-api-types';
|
|
1
|
+
import { SelectedOptions, OptionWithValues } from './types.js';
|
|
2
|
+
import type { ProductVariant as ProductVariantType } from '../../storefront-api-types.js';
|
|
3
3
|
import type { PartialDeep } from 'type-fest';
|
|
4
4
|
export declare function getAllOptionValues(variants: ProductVariantType[], option: string): string[];
|
|
5
5
|
export declare function getSelectedVariant(variants: PartialDeep<ProductVariantType>[], choices: SelectedOptions): PartialDeep<ProductVariantType> | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useProductOptions } from './useProductOptions.client';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export { useProductOptions } from './useProductOptions.client.js';
|
|
2
|
+
export * from './types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useProductOptions } from './useProductOptions.client';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export { useProductOptions } from './useProductOptions.client.js';
|
|
2
|
+
export * from './types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SelectedOption as SelectedOptionType, ProductVariant as ProductVariantType, ProductVariantConnection, SellingPlan as SellingPlanType, SellingPlanAllocation as SellingPlanAllocationType, SellingPlanGroup as SellingPlanGroupType, SellingPlanGroupConnection } from '../../storefront-api-types';
|
|
1
|
+
import type { SelectedOption as SelectedOptionType, ProductVariant as ProductVariantType, ProductVariantConnection, SellingPlan as SellingPlanType, SellingPlanAllocation as SellingPlanAllocationType, SellingPlanGroup as SellingPlanGroupType, SellingPlanGroupConnection } from '../../storefront-api-types.js';
|
|
2
2
|
import type { PartialDeep } from 'type-fest';
|
|
3
3
|
export declare type SelectedOptions = {
|
|
4
4
|
[key: string]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useProductOptions(): import("./types").ProductOptionsHookValue;
|
|
1
|
+
export declare function useProductOptions(): import("./types.js").ProductOptionsHookValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { ProductOptionsContext } from '../../components/ProductOptionsProvider/context';
|
|
2
|
+
import { ProductOptionsContext } from '../../components/ProductOptionsProvider/context.js';
|
|
3
3
|
export function useProductOptions() {
|
|
4
4
|
const context = useContext(ProductOptionsContext);
|
|
5
5
|
if (!context) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useShop } from '../../foundation/useShop';
|
|
2
|
-
import { getLoggerWithContext } from '../../utilities/log';
|
|
3
|
-
import { graphqlRequestBody } from '../../utilities';
|
|
4
|
-
import { useServerRequest } from '../../foundation/ServerRequestProvider';
|
|
5
|
-
import { injectGraphQLTracker } from '../../utilities/graphql-tracker';
|
|
6
|
-
import { sendMessageToClient } from '../../utilities/devtools';
|
|
7
|
-
import { fetchSync } from '../../foundation/fetchSync/server/fetchSync';
|
|
8
|
-
import { META_ENV_SSR } from '../../foundation/ssr-interop';
|
|
9
|
-
import { getStorefrontApiRequestHeaders } from '../../utilities/storefrontApi';
|
|
10
|
-
import { parseJSON } from '../../utilities/parse';
|
|
1
|
+
import { useShop } from '../../foundation/useShop/index.js';
|
|
2
|
+
import { getLoggerWithContext } from '../../utilities/log/index.js';
|
|
3
|
+
import { graphqlRequestBody } from '../../utilities/index.js';
|
|
4
|
+
import { useServerRequest } from '../../foundation/ServerRequestProvider/index.js';
|
|
5
|
+
import { injectGraphQLTracker } from '../../utilities/graphql-tracker.js';
|
|
6
|
+
import { sendMessageToClient } from '../../utilities/devtools.js';
|
|
7
|
+
import { fetchSync } from '../../foundation/fetchSync/server/fetchSync.js';
|
|
8
|
+
import { META_ENV_SSR } from '../../foundation/ssr-interop.js';
|
|
9
|
+
import { getStorefrontApiRequestHeaders } from '../../utilities/storefrontApi.js';
|
|
10
|
+
import { parseJSON } from '../../utilities/parse.js';
|
|
11
11
|
// Check if the response body has GraphQL errors
|
|
12
12
|
// https://spec.graphql.org/June2018/#sec-Response-Format
|
|
13
13
|
const shouldCacheResponse = ([body]) => {
|
|
@@ -53,7 +53,12 @@ export function useShopQuery({ query, variables = {}, cache, preload = false, })
|
|
|
53
53
|
data = response.json();
|
|
54
54
|
}
|
|
55
55
|
catch (error) {
|
|
56
|
-
|
|
56
|
+
if (response.headers.get('content-length')) {
|
|
57
|
+
useQueryError = new Error(`Unable to parse response (x-request-id: ${response.headers.get('x-request-id')}):\n${text}`);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
useQueryError = new Error(`${response.status} ${response.statusText} (x-request-id: ${response.headers.get('x-request-id')})`);
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useShopQuery } from './hooks';
|
|
1
|
+
export { useShopQuery, type UseShopQueryResponse } from './hooks.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useShopQuery } from './hooks';
|
|
1
|
+
export { useShopQuery } from './hooks.js';
|
package/dist/esnext/index.d.ts
CHANGED
|
@@ -4,40 +4,40 @@
|
|
|
4
4
|
* inside client components during the client build only, but when the same components
|
|
5
5
|
* run during SSR, they reference this path.
|
|
6
6
|
*/
|
|
7
|
-
export * from './client';
|
|
7
|
+
export * from './client.js';
|
|
8
8
|
/**
|
|
9
9
|
* The following are exported from this file because they are intended to be available
|
|
10
10
|
* *only* on the server.
|
|
11
11
|
*/
|
|
12
|
-
export { ServerPropsProvider, ServerPropsContext, type ServerProps, type ServerPropsContextValue, } from './foundation/ServerPropsProvider';
|
|
13
|
-
export { useShop } from './foundation/useShop';
|
|
14
|
-
export { useUrl } from './foundation/useUrl';
|
|
15
|
-
export { useShopQuery, type UseShopQueryResponse, } from './hooks/useShopQuery/
|
|
16
|
-
export { useQuery, type HydrogenUseQueryOptions, } from './foundation/useQuery/hooks';
|
|
17
|
-
export { useServerProps } from './foundation/useServerProps';
|
|
18
|
-
export { FileRoutes } from './foundation/FileRoutes/FileRoutes.server';
|
|
19
|
-
export { Route } from './foundation/Route/Route.server';
|
|
20
|
-
export { Router } from './foundation/Router/Router.server';
|
|
21
|
-
export { log, type Logger } from './utilities/log';
|
|
22
|
-
export { LocalizationProvider } from './components/LocalizationProvider/LocalizationProvider.server';
|
|
23
|
-
export { ShopifyProvider } from './foundation/ShopifyProvider/ShopifyProvider.server';
|
|
24
|
-
export { generateCacheControlHeader, CacheNone, CacheShort, CacheLong, CacheCustom, } from './foundation/Cache/strategies';
|
|
25
|
-
export { useRequestContext } from './foundation/useRequestContext';
|
|
26
|
-
export { useServerAnalytics } from './foundation/Analytics/hook';
|
|
27
|
-
export { ShopifyAnalytics } from './foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server';
|
|
28
|
-
export { ShopifyAnalyticsConstants } from './foundation/Analytics/connectors/Shopify/const';
|
|
29
|
-
export { useSession } from './foundation/useSession/useSession';
|
|
30
|
-
export { Cookie } from './foundation/Cookie/Cookie';
|
|
12
|
+
export { ServerPropsProvider, ServerPropsContext, type ServerProps, type ServerPropsContextValue, } from './foundation/ServerPropsProvider/index.js';
|
|
13
|
+
export { useShop } from './foundation/useShop/index.js';
|
|
14
|
+
export { useUrl } from './foundation/useUrl/index.js';
|
|
15
|
+
export { useShopQuery, type UseShopQueryResponse, } from './hooks/useShopQuery/index.js';
|
|
16
|
+
export { useQuery, type HydrogenUseQueryOptions, } from './foundation/useQuery/hooks.js';
|
|
17
|
+
export { useServerProps } from './foundation/useServerProps/index.js';
|
|
18
|
+
export { FileRoutes } from './foundation/FileRoutes/FileRoutes.server.js';
|
|
19
|
+
export { Route } from './foundation/Route/Route.server.js';
|
|
20
|
+
export { Router } from './foundation/Router/Router.server.js';
|
|
21
|
+
export { log, type Logger } from './utilities/log/index.js';
|
|
22
|
+
export { LocalizationProvider } from './components/LocalizationProvider/LocalizationProvider.server.js';
|
|
23
|
+
export { ShopifyProvider } from './foundation/ShopifyProvider/ShopifyProvider.server.js';
|
|
24
|
+
export { generateCacheControlHeader, CacheNone, CacheShort, CacheLong, CacheCustom, } from './foundation/Cache/strategies/index.js';
|
|
25
|
+
export { useRequestContext } from './foundation/useRequestContext/index.js';
|
|
26
|
+
export { useServerAnalytics } from './foundation/Analytics/hook.js';
|
|
27
|
+
export { ShopifyAnalytics } from './foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js';
|
|
28
|
+
export { ShopifyAnalyticsConstants } from './foundation/Analytics/connectors/Shopify/const.js';
|
|
29
|
+
export { useSession } from './foundation/useSession/useSession.js';
|
|
30
|
+
export { Cookie } from './foundation/Cookie/Cookie.js';
|
|
31
31
|
/**
|
|
32
32
|
* Export server-only CartQuery here instead of `CartProvider.client` to prevent
|
|
33
33
|
* it from being bundled with other client components
|
|
34
34
|
*/
|
|
35
|
-
export { CartQuery } from './components/CartProvider/cart-queries';
|
|
35
|
+
export { CartQuery } from './components/CartProvider/cart-queries.js';
|
|
36
36
|
/**
|
|
37
37
|
* Override the client version of `fetchSync` with the server version.
|
|
38
38
|
*/
|
|
39
|
-
export { fetchSync } from './foundation/fetchSync/server/fetchSync';
|
|
40
|
-
export { type HydrogenRequest } from './foundation/HydrogenRequest/HydrogenRequest.server';
|
|
41
|
-
export { type HydrogenResponse } from './foundation/HydrogenResponse/HydrogenResponse.server';
|
|
42
|
-
export { type HydrogenRouteProps } from './types';
|
|
43
|
-
export { type ResourceGetter as HydrogenApiRoute, RequestOptions as HydrogenApiRouteOptions, } from './utilities/apiRoutes';
|
|
39
|
+
export { fetchSync } from './foundation/fetchSync/server/fetchSync.js';
|
|
40
|
+
export { type HydrogenRequest } from './foundation/HydrogenRequest/HydrogenRequest.server.js';
|
|
41
|
+
export { type HydrogenResponse } from './foundation/HydrogenResponse/HydrogenResponse.server.js';
|
|
42
|
+
export { type HydrogenRouteProps } from './types.js';
|
|
43
|
+
export { type ResourceGetter as HydrogenApiRoute, RequestOptions as HydrogenApiRouteOptions, } from './utilities/apiRoutes.js';
|
package/dist/esnext/index.js
CHANGED
|
@@ -4,36 +4,36 @@
|
|
|
4
4
|
* inside client components during the client build only, but when the same components
|
|
5
5
|
* run during SSR, they reference this path.
|
|
6
6
|
*/
|
|
7
|
-
export * from './client';
|
|
7
|
+
export * from './client.js';
|
|
8
8
|
/**
|
|
9
9
|
* The following are exported from this file because they are intended to be available
|
|
10
10
|
* *only* on the server.
|
|
11
11
|
*/
|
|
12
|
-
export { ServerPropsProvider, ServerPropsContext, } from './foundation/ServerPropsProvider';
|
|
13
|
-
export { useShop } from './foundation/useShop';
|
|
14
|
-
export { useUrl } from './foundation/useUrl';
|
|
15
|
-
export { useShopQuery, } from './hooks/useShopQuery/
|
|
16
|
-
export { useQuery, } from './foundation/useQuery/hooks';
|
|
17
|
-
export { useServerProps } from './foundation/useServerProps';
|
|
18
|
-
export { FileRoutes } from './foundation/FileRoutes/FileRoutes.server';
|
|
19
|
-
export { Route } from './foundation/Route/Route.server';
|
|
20
|
-
export { Router } from './foundation/Router/Router.server';
|
|
21
|
-
export { log } from './utilities/log';
|
|
22
|
-
export { LocalizationProvider } from './components/LocalizationProvider/LocalizationProvider.server';
|
|
23
|
-
export { ShopifyProvider } from './foundation/ShopifyProvider/ShopifyProvider.server';
|
|
24
|
-
export { generateCacheControlHeader, CacheNone, CacheShort, CacheLong, CacheCustom, } from './foundation/Cache/strategies';
|
|
25
|
-
export { useRequestContext } from './foundation/useRequestContext';
|
|
26
|
-
export { useServerAnalytics } from './foundation/Analytics/hook';
|
|
27
|
-
export { ShopifyAnalytics } from './foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server';
|
|
28
|
-
export { ShopifyAnalyticsConstants } from './foundation/Analytics/connectors/Shopify/const';
|
|
29
|
-
export { useSession } from './foundation/useSession/useSession';
|
|
30
|
-
export { Cookie } from './foundation/Cookie/Cookie';
|
|
12
|
+
export { ServerPropsProvider, ServerPropsContext, } from './foundation/ServerPropsProvider/index.js';
|
|
13
|
+
export { useShop } from './foundation/useShop/index.js';
|
|
14
|
+
export { useUrl } from './foundation/useUrl/index.js';
|
|
15
|
+
export { useShopQuery, } from './hooks/useShopQuery/index.js';
|
|
16
|
+
export { useQuery, } from './foundation/useQuery/hooks.js';
|
|
17
|
+
export { useServerProps } from './foundation/useServerProps/index.js';
|
|
18
|
+
export { FileRoutes } from './foundation/FileRoutes/FileRoutes.server.js';
|
|
19
|
+
export { Route } from './foundation/Route/Route.server.js';
|
|
20
|
+
export { Router } from './foundation/Router/Router.server.js';
|
|
21
|
+
export { log } from './utilities/log/index.js';
|
|
22
|
+
export { LocalizationProvider } from './components/LocalizationProvider/LocalizationProvider.server.js';
|
|
23
|
+
export { ShopifyProvider } from './foundation/ShopifyProvider/ShopifyProvider.server.js';
|
|
24
|
+
export { generateCacheControlHeader, CacheNone, CacheShort, CacheLong, CacheCustom, } from './foundation/Cache/strategies/index.js';
|
|
25
|
+
export { useRequestContext } from './foundation/useRequestContext/index.js';
|
|
26
|
+
export { useServerAnalytics } from './foundation/Analytics/hook.js';
|
|
27
|
+
export { ShopifyAnalytics } from './foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js';
|
|
28
|
+
export { ShopifyAnalyticsConstants } from './foundation/Analytics/connectors/Shopify/const.js';
|
|
29
|
+
export { useSession } from './foundation/useSession/useSession.js';
|
|
30
|
+
export { Cookie } from './foundation/Cookie/Cookie.js';
|
|
31
31
|
/**
|
|
32
32
|
* Export server-only CartQuery here instead of `CartProvider.client` to prevent
|
|
33
33
|
* it from being bundled with other client components
|
|
34
34
|
*/
|
|
35
|
-
export { CartQuery } from './components/CartProvider/cart-queries';
|
|
35
|
+
export { CartQuery } from './components/CartProvider/cart-queries.js';
|
|
36
36
|
/**
|
|
37
37
|
* Override the client version of `fetchSync` with the server version.
|
|
38
38
|
*/
|
|
39
|
-
export { fetchSync } from './foundation/fetchSync/server/fetchSync';
|
|
39
|
+
export { fetchSync } from './foundation/fetchSync/server/fetchSync.js';
|
package/dist/esnext/node.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FileSessionStorage } from './foundation/FileSessionStorage/FileSessionStorage';
|
|
1
|
+
export { FileSessionStorage } from './foundation/FileSessionStorage/FileSessionStorage.js';
|
package/dist/esnext/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FileSessionStorage } from './foundation/FileSessionStorage/FileSessionStorage';
|
|
1
|
+
export { FileSessionStorage } from './foundation/FileSessionStorage/FileSessionStorage.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './virtual';
|
|
1
|
+
export * from './virtual.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './virtual';
|
|
1
|
+
export * from './virtual.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import '../utilities/web-api-polyfill';
|
|
1
|
+
import '../utilities/web-api-polyfill.js';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { handleRequest, indexTemplate, relativeClientBuildPath } from './virtual';
|
|
4
|
-
import { hydrogenMiddleware } from '../framework/middleware';
|
|
3
|
+
import { handleRequest, indexTemplate, relativeClientBuildPath, } from './virtual.js';
|
|
4
|
+
import { hydrogenMiddleware } from '../framework/middleware.js';
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import serveStatic from 'serve-static';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import compression from 'compression';
|
|
9
9
|
import bodyParser from 'body-parser';
|
|
10
10
|
import connect from 'connect';
|
|
11
|
-
import { InMemoryCache } from '../framework/cache/in-memory';
|
|
11
|
+
import { InMemoryCache } from '../framework/cache/in-memory.js';
|
|
12
12
|
export async function createServer({ cache = new InMemoryCache(), } = {}) {
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
globalThis.Oxygen = { env: process.env };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RequestHandler } from '../shared-types';
|
|
1
|
+
import type { RequestHandler } from '../shared-types.js';
|
|
2
2
|
export declare const handleRequest: RequestHandler;
|
|
3
3
|
export { default as indexTemplate } from '__HYDROGEN_HTML_TEMPLATE__?raw';
|
|
4
4
|
export declare const assets: Set<string>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
// This file is modified by Vite at build time
|
|
2
2
|
// with user project information and re-exports it.
|
|
3
3
|
// @ts-ignore
|
|
4
|
-
// eslint-disable-next-line node/no-missing-import
|
|
5
4
|
import appEntry from '__HYDROGEN_ENTRY__';
|
|
6
5
|
export const handleRequest = appEntry;
|
|
7
|
-
// eslint-disable-next-line node/no-missing-import
|
|
8
6
|
export { default as indexTemplate } from '__HYDROGEN_HTML_TEMPLATE__?raw';
|
|
9
7
|
export const assets = new Set(['__HYDROGEN_ASSETS__']);
|
|
10
8
|
export const assetPrefix = '/__HYDROGEN_ASSETS_DIR__/';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handleRequest, indexTemplate, isAsset, assetBasePath } from './virtual';
|
|
1
|
+
import { handleRequest, indexTemplate, isAsset, assetBasePath, } from './virtual.js';
|
|
2
2
|
export default {
|
|
3
3
|
async fetch(request, env, context) {
|
|
4
4
|
// Proxy assets to the CDN. This should be removed
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
import type { SessionStorageAdapter } from './foundation/session/session-types';
|
|
3
4
|
export interface RuntimeContext {
|
|
4
5
|
waitUntil: (fn: Promise<any>) => void;
|
|
5
6
|
}
|
|
@@ -13,6 +14,8 @@ export interface RequestHandlerOptions {
|
|
|
13
14
|
context?: RuntimeContext;
|
|
14
15
|
nonce?: string;
|
|
15
16
|
buyerIpHeader?: string;
|
|
17
|
+
sessionApi?: SessionStorageAdapter;
|
|
18
|
+
headers?: Headers;
|
|
16
19
|
}
|
|
17
20
|
export interface RequestHandler {
|
|
18
21
|
(request: Request | IncomingMessage, options: RequestHandlerOptions): Promise<Response | undefined>;
|