@shopify/hydrogen 1.6.4 → 2.0.0-alpha.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/dist/{node/framework → build}/graphiql.js +21 -10
- package/dist/build/index.cjs +133 -0
- package/dist/build/index.cjs.map +1 -0
- package/dist/build/index.d.ts +6 -0
- package/dist/build/index.js +131 -0
- package/dist/build/index.js.map +1 -0
- package/dist/development/index.cjs +632 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +619 -0
- package/dist/development/index.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/production/index.cjs +32 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.d.ts +215 -0
- package/dist/production/index.js +19 -0
- package/dist/production/index.js.map +1 -0
- package/dist/templates/[route-manifest.json].jsx +41 -0
- package/dist/templates/admin.jsx +16 -0
- package/package.json +42 -145
- package/src/templates/routes/[route-manifest.json].tsx +54 -0
- package/src/templates/routes/admin.tsx +15 -0
- package/README.md +0 -29
- package/dist/esnext/FileSessionStorage.d.ts +0 -1
- package/dist/esnext/FileSessionStorage.js +0 -1
- package/dist/esnext/client.d.ts +0 -16
- package/dist/esnext/client.js +0 -16
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +0 -23
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +0 -49
- package/dist/esnext/components/AddToCartButton/index.d.ts +0 -1
- package/dist/esnext/components/AddToCartButton/index.js +0 -1
- package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +0 -16
- package/dist/esnext/components/BaseButton/BaseButton.client.js +0 -16
- package/dist/esnext/components/BaseButton/index.d.ts +0 -1
- package/dist/esnext/components/BaseButton/index.js +0 -1
- package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +0 -16
- package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +0 -27
- package/dist/esnext/components/BuyNowButton/index.d.ts +0 -1
- package/dist/esnext/components/BuyNowButton/index.js +0 -1
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +0 -11
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +0 -17
- package/dist/esnext/components/CartCheckoutButton/index.d.ts +0 -1
- package/dist/esnext/components/CartCheckoutButton/index.js +0 -1
- package/dist/esnext/components/CartCost/CartCost.client.d.ts +0 -14
- package/dist/esnext/components/CartCost/CartCost.client.js +0 -29
- package/dist/esnext/components/CartCost/index.d.ts +0 -1
- package/dist/esnext/components/CartCost/index.js +0 -1
- package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +0 -9
- package/dist/esnext/components/CartLineImage/CartLineImage.client.js +0 -11
- package/dist/esnext/components/CartLineImage/index.d.ts +0 -1
- package/dist/esnext/components/CartLineImage/index.js +0 -1
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +0 -12
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +0 -18
- package/dist/esnext/components/CartLinePrice/index.d.ts +0 -1
- package/dist/esnext/components/CartLinePrice/index.js +0 -1
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +0 -8
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +0 -12
- package/dist/esnext/components/CartLineProductTitle/index.d.ts +0 -1
- package/dist/esnext/components/CartLineProductTitle/index.js +0 -1
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +0 -11
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +0 -8
- package/dist/esnext/components/CartLineProvider/context.d.ts +0 -36
- package/dist/esnext/components/CartLineProvider/context.js +0 -2
- package/dist/esnext/components/CartLineProvider/index.d.ts +0 -2
- package/dist/esnext/components/CartLineProvider/index.js +0 -2
- package/dist/esnext/components/CartLineProvider/tests/fixtures.d.ts +0 -86
- package/dist/esnext/components/CartLineProvider/tests/fixtures.js +0 -34
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +0 -8
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +0 -12
- package/dist/esnext/components/CartLineQuantity/index.d.ts +0 -1
- package/dist/esnext/components/CartLineQuantity/index.js +0 -1
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +0 -12
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +0 -26
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +0 -1
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +0 -1
- package/dist/esnext/components/CartLines/CartLines.client.d.ts +0 -15
- package/dist/esnext/components/CartLines/CartLines.client.js +0 -17
- package/dist/esnext/components/CartLines/index.d.ts +0 -1
- package/dist/esnext/components/CartLines/index.js +0 -1
- package/dist/esnext/components/CartProvider/CartActions.client.d.ts +0 -61
- package/dist/esnext/components/CartProvider/CartActions.client.js +0 -132
- package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +0 -49
- package/dist/esnext/components/CartProvider/CartProvider.client.js +0 -435
- package/dist/esnext/components/CartProvider/cart-queries.d.ts +0 -10
- package/dist/esnext/components/CartProvider/cart-queries.js +0 -206
- package/dist/esnext/components/CartProvider/constants.d.ts +0 -2
- package/dist/esnext/components/CartProvider/constants.js +0 -2
- package/dist/esnext/components/CartProvider/context.d.ts +0 -2
- package/dist/esnext/components/CartProvider/context.js +0 -2
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +0 -95
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +0 -82
- package/dist/esnext/components/CartProvider/graphql/CartFragment.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +0 -91
- package/dist/esnext/components/CartProvider/graphql/CartQuery.js +0 -1
- package/dist/esnext/components/CartProvider/hooks.client.d.ts +0 -15
- package/dist/esnext/components/CartProvider/hooks.client.js +0 -71
- package/dist/esnext/components/CartProvider/index.d.ts +0 -4
- package/dist/esnext/components/CartProvider/index.js +0 -3
- package/dist/esnext/components/CartProvider/tests/fixtures.d.ts +0 -254
- package/dist/esnext/components/CartProvider/tests/fixtures.js +0 -53
- package/dist/esnext/components/CartProvider/types.d.ts +0 -275
- package/dist/esnext/components/CartProvider/types.js +0 -1
- package/dist/esnext/components/CartProvider/useCartAPIStateMachine.client.d.ts +0 -21
- package/dist/esnext/components/CartProvider/useCartAPIStateMachine.client.js +0 -266
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +0 -7
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +0 -17
- package/dist/esnext/components/CartShopPayButton/index.d.ts +0 -1
- package/dist/esnext/components/CartShopPayButton/index.js +0 -1
- package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +0 -21
- package/dist/esnext/components/ExternalVideo/ExternalVideo.js +0 -14
- package/dist/esnext/components/ExternalVideo/index.d.ts +0 -1
- package/dist/esnext/components/ExternalVideo/index.js +0 -1
- package/dist/esnext/components/Image/Image.d.ts +0 -105
- package/dist/esnext/components/Image/Image.js +0 -145
- package/dist/esnext/components/Image/index.d.ts +0 -2
- package/dist/esnext/components/Image/index.js +0 -1
- package/dist/esnext/components/Link/Link.client.d.ts +0 -27
- package/dist/esnext/components/Link/Link.client.js +0 -145
- package/dist/esnext/components/Link/index.d.ts +0 -1
- package/dist/esnext/components/Link/index.js +0 -1
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +0 -6
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +0 -5
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +0 -22
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +0 -23
- package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
- package/dist/esnext/components/LocalizationProvider/index.js +0 -1
- package/dist/esnext/components/MediaFile/MediaFile.d.ts +0 -19
- package/dist/esnext/components/MediaFile/MediaFile.js +0 -32
- package/dist/esnext/components/MediaFile/index.d.ts +0 -1
- package/dist/esnext/components/MediaFile/index.js +0 -1
- package/dist/esnext/components/Metafield/Metafield.client.d.ts +0 -17
- package/dist/esnext/components/Metafield/Metafield.client.js +0 -102
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +0 -12
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +0 -48
- package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +0 -1
- package/dist/esnext/components/Metafield/components/StarRating/index.js +0 -1
- package/dist/esnext/components/Metafield/components/index.d.ts +0 -1
- package/dist/esnext/components/Metafield/components/index.js +0 -1
- package/dist/esnext/components/Metafield/index.d.ts +0 -2
- package/dist/esnext/components/Metafield/index.js +0 -1
- package/dist/esnext/components/Metafield/types.d.ts +0 -4
- package/dist/esnext/components/Metafield/types.js +0 -1
- package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +0 -128
- package/dist/esnext/components/ModelViewer/ModelViewer.client.js +0 -104
- package/dist/esnext/components/ModelViewer/index.d.ts +0 -1
- package/dist/esnext/components/ModelViewer/index.js +0 -1
- package/dist/esnext/components/Money/Money.client.d.ts +0 -25
- package/dist/esnext/components/Money/Money.client.js +0 -39
- package/dist/esnext/components/Money/index.d.ts +0 -1
- package/dist/esnext/components/Money/index.js +0 -1
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +0 -21
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +0 -133
- package/dist/esnext/components/ProductOptionsProvider/context.d.ts +0 -2
- package/dist/esnext/components/ProductOptionsProvider/context.js +0 -2
- package/dist/esnext/components/ProductOptionsProvider/index.d.ts +0 -1
- package/dist/esnext/components/ProductOptionsProvider/index.js +0 -1
- package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +0 -18
- package/dist/esnext/components/ProductPrice/ProductPrice.client.js +0 -54
- package/dist/esnext/components/ProductPrice/index.d.ts +0 -1
- package/dist/esnext/components/ProductPrice/index.js +0 -1
- package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/CollectionSeo.client.js +0 -14
- package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/DefaultPageSeo.client.js +0 -18
- package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +0 -4
- package/dist/esnext/components/Seo/DescriptionSeo.client.js +0 -10
- package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +0 -2
- package/dist/esnext/components/Seo/HomePageSeo.client.js +0 -25
- package/dist/esnext/components/Seo/ImageSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/ImageSeo.client.js +0 -10
- package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/NoIndexSeo.client.js +0 -10
- package/dist/esnext/components/Seo/PageSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/PageSeo.client.js +0 -12
- package/dist/esnext/components/Seo/ProductSeo.client.d.ts +0 -5
- package/dist/esnext/components/Seo/ProductSeo.client.js +0 -62
- package/dist/esnext/components/Seo/Seo.client.d.ts +0 -30
- package/dist/esnext/components/Seo/Seo.client.js +0 -31
- package/dist/esnext/components/Seo/TitleSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/TitleSeo.client.js +0 -10
- package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +0 -2
- package/dist/esnext/components/Seo/TwitterSeo.client.js +0 -9
- package/dist/esnext/components/Seo/index.d.ts +0 -1
- package/dist/esnext/components/Seo/index.js +0 -1
- package/dist/esnext/components/Seo/seo-types.d.ts +0 -18
- package/dist/esnext/components/Seo/seo-types.js +0 -1
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +0 -40
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +0 -56
- package/dist/esnext/components/ShopPayButton/index.d.ts +0 -1
- package/dist/esnext/components/ShopPayButton/index.js +0 -1
- package/dist/esnext/components/Video/Video.d.ts +0 -19
- package/dist/esnext/components/Video/Video.js +0 -23
- package/dist/esnext/components/Video/index.d.ts +0 -1
- package/dist/esnext/components/Video/index.js +0 -1
- package/dist/esnext/components/index.d.ts +0 -27
- package/dist/esnext/components/index.js +0 -25
- package/dist/esnext/components/types.d.ts +0 -71
- package/dist/esnext/components/types.js +0 -10
- package/dist/esnext/config.d.ts +0 -7
- package/dist/esnext/config.js +0 -5
- package/dist/esnext/constants.d.ts +0 -14
- package/dist/esnext/constants.js +0 -14
- package/dist/esnext/entry-client.d.ts +0 -3
- package/dist/esnext/entry-client.js +0 -197
- package/dist/esnext/entry-server.d.ts +0 -6
- package/dist/esnext/entry-server.js +0 -642
- package/dist/esnext/experimental.d.ts +0 -2
- package/dist/esnext/experimental.js +0 -2
- package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/Analytics.client.js +0 -30
- package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/Analytics.server.js +0 -47
- package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +0 -27
- package/dist/esnext/foundation/Analytics/ClientAnalytics.js +0 -99
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +0 -4
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +0 -51
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +0 -7
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +0 -83
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +0 -23
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +0 -7
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +0 -7
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +0 -191
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +0 -49
- package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +0 -31
- package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +0 -54
- package/dist/esnext/foundation/Analytics/connectors/Shopify/customer-events.client.d.ts +0 -2
- package/dist/esnext/foundation/Analytics/connectors/Shopify/customer-events.client.js +0 -182
- package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +0 -6
- package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +0 -125
- package/dist/esnext/foundation/Analytics/const.d.ts +0 -9
- package/dist/esnext/foundation/Analytics/const.js +0 -9
- package/dist/esnext/foundation/Analytics/hook.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/hook.js +0 -9
- package/dist/esnext/foundation/Analytics/index.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/index.js +0 -1
- package/dist/esnext/foundation/Analytics/types.d.ts +0 -5
- package/dist/esnext/foundation/Analytics/types.js +0 -1
- package/dist/esnext/foundation/Analytics/utils.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/utils.js +0 -29
- package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +0 -4
- package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +0 -8
- package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +0 -2
- package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +0 -23
- package/dist/esnext/foundation/BuiltInRoutes/healthCheck.d.ts +0 -1
- package/dist/esnext/foundation/BuiltInRoutes/healthCheck.js +0 -3
- package/dist/esnext/foundation/Cache/cache-sub-request.d.ts +0 -17
- package/dist/esnext/foundation/Cache/cache-sub-request.js +0 -64
- package/dist/esnext/foundation/Cache/cache.d.ts +0 -17
- package/dist/esnext/foundation/Cache/cache.js +0 -126
- package/dist/esnext/foundation/Cache/strategies/index.d.ts +0 -7
- package/dist/esnext/foundation/Cache/strategies/index.js +0 -54
- package/dist/esnext/foundation/Cookie/Cookie.d.ts +0 -48
- package/dist/esnext/foundation/Cookie/Cookie.js +0 -72
- package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +0 -5
- package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +0 -32
- package/dist/esnext/foundation/DevTools/DevTools.client.d.ts +0 -3
- package/dist/esnext/foundation/DevTools/DevTools.client.js +0 -17
- package/dist/esnext/foundation/DevTools/DevTools.server.d.ts +0 -1
- package/dist/esnext/foundation/DevTools/DevTools.server.js +0 -15
- package/dist/esnext/foundation/DevTools/components/GraphQL.client.d.ts +0 -1
- package/dist/esnext/foundation/DevTools/components/GraphQL.client.js +0 -25
- package/dist/esnext/foundation/DevTools/components/Heading.d.ts +0 -5
- package/dist/esnext/foundation/DevTools/components/Heading.js +0 -12
- package/dist/esnext/foundation/DevTools/components/Interface.client.d.ts +0 -11
- package/dist/esnext/foundation/DevTools/components/Interface.client.js +0 -47
- package/dist/esnext/foundation/DevTools/components/Panels.d.ts +0 -8
- package/dist/esnext/foundation/DevTools/components/Panels.js +0 -66
- package/dist/esnext/foundation/DevTools/components/Performance.client.d.ts +0 -14
- package/dist/esnext/foundation/DevTools/components/Performance.client.js +0 -25
- package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +0 -8
- package/dist/esnext/foundation/DevTools/components/Settings.client.js +0 -17
- package/dist/esnext/foundation/DevTools/components/Table.d.ts +0 -9
- package/dist/esnext/foundation/DevTools/components/Table.js +0 -7
- package/dist/esnext/foundation/DevTools/components/icons.d.ts +0 -2
- package/dist/esnext/foundation/DevTools/components/icons.js +0 -13
- package/dist/esnext/foundation/DevTools/components/index.d.ts +0 -2
- package/dist/esnext/foundation/DevTools/components/index.js +0 -2
- package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +0 -22
- package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +0 -69
- package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +0 -6
- package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +0 -149
- package/dist/esnext/foundation/Form/Form.client.d.ts +0 -14
- package/dist/esnext/foundation/Form/Form.client.js +0 -51
- package/dist/esnext/foundation/Head/Head.client.d.ts +0 -5
- package/dist/esnext/foundation/Head/Head.client.js +0 -10
- package/dist/esnext/foundation/Head/index.d.ts +0 -1
- package/dist/esnext/foundation/Head/index.js +0 -1
- package/dist/esnext/foundation/Html/Html.d.ts +0 -13
- package/dist/esnext/foundation/Html/Html.js +0 -96
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +0 -78
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +0 -206
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +0 -23
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +0 -49
- package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +0 -5
- package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +0 -53
- package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +0 -5
- package/dist/esnext/foundation/Redirect/Redirect.client.js +0 -15
- package/dist/esnext/foundation/Route/Route.server.d.ts +0 -14
- package/dist/esnext/foundation/Route/Route.server.js +0 -28
- package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +0 -14
- package/dist/esnext/foundation/Router/BrowserRouter.client.js +0 -144
- package/dist/esnext/foundation/Router/Router.server.d.ts +0 -10
- package/dist/esnext/foundation/Router/Router.server.js +0 -8
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +0 -43
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +0 -65
- package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +0 -1
- package/dist/esnext/foundation/ServerPropsProvider/index.js +0 -1
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +0 -23
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +0 -125
- package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +0 -1
- package/dist/esnext/foundation/ServerRequestProvider/index.js +0 -1
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +0 -30
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +0 -59
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +0 -9
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +0 -10
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +0 -19
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +0 -94
- package/dist/esnext/foundation/ShopifyProvider/index.d.ts +0 -1
- package/dist/esnext/foundation/ShopifyProvider/index.js +0 -1
- package/dist/esnext/foundation/ShopifyProvider/types.d.ts +0 -35
- package/dist/esnext/foundation/ShopifyProvider/types.js +0 -1
- package/dist/esnext/foundation/constants.d.ts +0 -2
- package/dist/esnext/foundation/constants.js +0 -4
- package/dist/esnext/foundation/fetchSync/ResponseSync.d.ts +0 -15
- package/dist/esnext/foundation/fetchSync/ResponseSync.js +0 -50
- package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +0 -10
- package/dist/esnext/foundation/fetchSync/client/fetchSync.js +0 -23
- package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +0 -8
- package/dist/esnext/foundation/fetchSync/server/fetchSync.js +0 -39
- package/dist/esnext/foundation/index.d.ts +0 -3
- package/dist/esnext/foundation/index.js +0 -3
- package/dist/esnext/foundation/runtime.d.ts +0 -2
- package/dist/esnext/foundation/runtime.js +0 -6
- package/dist/esnext/foundation/session/session-types.d.ts +0 -15
- package/dist/esnext/foundation/session/session-types.js +0 -1
- package/dist/esnext/foundation/session/session.d.ts +0 -18
- package/dist/esnext/foundation/session/session.js +0 -53
- package/dist/esnext/foundation/ssr-interop.d.ts +0 -29
- package/dist/esnext/foundation/ssr-interop.js +0 -35
- package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +0 -17
- package/dist/esnext/foundation/useNavigate/useNavigate.js +0 -39
- package/dist/esnext/foundation/useQuery/hooks.d.ts +0 -41
- package/dist/esnext/foundation/useQuery/hooks.js +0 -105
- package/dist/esnext/foundation/useQuery/index.d.ts +0 -1
- package/dist/esnext/foundation/useQuery/index.js +0 -1
- package/dist/esnext/foundation/useRequestContext/index.d.ts +0 -15
- package/dist/esnext/foundation/useRequestContext/index.js +0 -23
- package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +0 -13
- package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +0 -12
- package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +0 -4
- package/dist/esnext/foundation/useRouteParams/useRouteParams.js +0 -9
- package/dist/esnext/foundation/useServerProps/index.d.ts +0 -1
- package/dist/esnext/foundation/useServerProps/index.js +0 -1
- package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +0 -21
- package/dist/esnext/foundation/useServerProps/use-server-props.js +0 -35
- package/dist/esnext/foundation/useSession/useSession.d.ts +0 -3
- package/dist/esnext/foundation/useSession/useSession.js +0 -20
- package/dist/esnext/foundation/useShop/index.d.ts +0 -1
- package/dist/esnext/foundation/useShop/index.js +0 -1
- package/dist/esnext/foundation/useShop/use-shop.d.ts +0 -6
- package/dist/esnext/foundation/useShop/use-shop.js +0 -14
- package/dist/esnext/foundation/useUrl/index.d.ts +0 -1
- package/dist/esnext/foundation/useUrl/index.js +0 -1
- package/dist/esnext/foundation/useUrl/useUrl.d.ts +0 -4
- package/dist/esnext/foundation/useUrl/useUrl.js +0 -29
- package/dist/esnext/framework/cache/in-memory.d.ts +0 -17
- package/dist/esnext/framework/cache/in-memory.js +0 -80
- package/dist/esnext/framework/graphiql.d.ts +0 -1
- package/dist/esnext/framework/graphiql.js +0 -34
- package/dist/esnext/framework/load-config.d.ts +0 -5
- package/dist/esnext/framework/load-config.js +0 -7
- package/dist/esnext/framework/middleware.d.ts +0 -21
- package/dist/esnext/framework/middleware.js +0 -97
- package/dist/esnext/framework/plugin.d.ts +0 -8
- package/dist/esnext/framework/plugin.js +0 -35
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.js +0 -12
- package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +0 -28
- package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +0 -101
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.js +0 -213
- package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +0 -41
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.js +0 -36
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +0 -4
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +0 -113
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +0 -11
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +0 -60
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +0 -23
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +0 -24
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +0 -7
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +0 -149
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +0 -112
- package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +0 -20
- package/dist/esnext/framework/types.d.ts +0 -20
- package/dist/esnext/framework/types.js +0 -1
- package/dist/esnext/framework/viteception.d.ts +0 -5
- package/dist/esnext/framework/viteception.js +0 -22
- package/dist/esnext/hooks/index.d.ts +0 -6
- package/dist/esnext/hooks/index.js +0 -6
- package/dist/esnext/hooks/useCart/index.d.ts +0 -1
- package/dist/esnext/hooks/useCart/index.js +0 -1
- package/dist/esnext/hooks/useCart/useCart.d.ts +0 -4
- package/dist/esnext/hooks/useCart/useCart.js +0 -12
- package/dist/esnext/hooks/useCartLine/index.d.ts +0 -1
- package/dist/esnext/hooks/useCartLine/index.js +0 -1
- package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +0 -39
- package/dist/esnext/hooks/useCartLine/useCartLine.js +0 -12
- package/dist/esnext/hooks/useDelay/useDelay.d.ts +0 -1
- package/dist/esnext/hooks/useDelay/useDelay.js +0 -17
- package/dist/esnext/hooks/useLoadScript/index.d.ts +0 -1
- package/dist/esnext/hooks/useLoadScript/index.js +0 -1
- package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +0 -8
- package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +0 -23
- package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +0 -4
- package/dist/esnext/hooks/useLocalization/useLocalization.js +0 -9
- package/dist/esnext/hooks/useMeasurement/hooks.d.ts +0 -9
- package/dist/esnext/hooks/useMeasurement/hooks.js +0 -13
- package/dist/esnext/hooks/useMeasurement/index.d.ts +0 -1
- package/dist/esnext/hooks/useMeasurement/index.js +0 -1
- package/dist/esnext/hooks/useMoney/hooks.d.ts +0 -54
- package/dist/esnext/hooks/useMoney/hooks.js +0 -80
- package/dist/esnext/hooks/useMoney/index.d.ts +0 -1
- package/dist/esnext/hooks/useMoney/index.js +0 -1
- package/dist/esnext/hooks/useProductOptions/helpers.d.ts +0 -6
- package/dist/esnext/hooks/useProductOptions/helpers.js +0 -36
- package/dist/esnext/hooks/useProductOptions/index.d.ts +0 -2
- package/dist/esnext/hooks/useProductOptions/index.js +0 -2
- package/dist/esnext/hooks/useProductOptions/types.d.ts +0 -44
- package/dist/esnext/hooks/useProductOptions/types.js +0 -1
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +0 -1
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +0 -9
- package/dist/esnext/hooks/useShopQuery/hooks.d.ts +0 -28
- package/dist/esnext/hooks/useShopQuery/hooks.js +0 -176
- package/dist/esnext/hooks/useShopQuery/index.d.ts +0 -1
- package/dist/esnext/hooks/useShopQuery/index.js +0 -1
- package/dist/esnext/index.d.ts +0 -45
- package/dist/esnext/index.js +0 -41
- package/dist/esnext/node.d.ts +0 -1
- package/dist/esnext/node.js +0 -1
- package/dist/esnext/platforms/index.d.ts +0 -1
- package/dist/esnext/platforms/index.js +0 -1
- package/dist/esnext/platforms/node.d.ts +0 -9
- package/dist/esnext/platforms/node.js +0 -35
- package/dist/esnext/platforms/virtual.d.ts +0 -8
- package/dist/esnext/platforms/virtual.js +0 -12
- package/dist/esnext/platforms/worker-event.d.ts +0 -1
- package/dist/esnext/platforms/worker-event.js +0 -3
- package/dist/esnext/platforms/worker.d.ts +0 -14
- package/dist/esnext/platforms/worker.js +0 -25
- package/dist/esnext/shared-types.d.ts +0 -31
- package/dist/esnext/shared-types.js +0 -4
- package/dist/esnext/storefront-api-types.d.ts +0 -6326
- package/dist/esnext/storefront-api-types.js +0 -1775
- package/dist/esnext/streaming.server.d.ts +0 -16
- package/dist/esnext/streaming.server.js +0 -24
- package/dist/esnext/testing.d.ts +0 -2
- package/dist/esnext/testing.js +0 -2
- package/dist/esnext/types.d.ts +0 -117
- package/dist/esnext/types.js +0 -1
- package/dist/esnext/utilities/apiRoutes.d.ts +0 -44
- package/dist/esnext/utilities/apiRoutes.js +0 -200
- package/dist/esnext/utilities/bot-ua.d.ts +0 -4
- package/dist/esnext/utilities/bot-ua.js +0 -65
- package/dist/esnext/utilities/defer.d.ts +0 -6
- package/dist/esnext/utilities/defer.js +0 -14
- package/dist/esnext/utilities/devtools.d.ts +0 -11
- package/dist/esnext/utilities/devtools.js +0 -11
- package/dist/esnext/utilities/empty-hydrogen-config.d.ts +0 -2
- package/dist/esnext/utilities/empty-hydrogen-config.js +0 -2
- package/dist/esnext/utilities/error.d.ts +0 -1
- package/dist/esnext/utilities/error.js +0 -6
- package/dist/esnext/utilities/fetch.d.ts +0 -9
- package/dist/esnext/utilities/fetch.js +0 -34
- package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +0 -7
- package/dist/esnext/utilities/flattenConnection/flattenConnection.js +0 -18
- package/dist/esnext/utilities/flattenConnection/index.d.ts +0 -1
- package/dist/esnext/utilities/flattenConnection/index.js +0 -1
- package/dist/esnext/utilities/graphql-tag.d.ts +0 -1
- package/dist/esnext/utilities/graphql-tag.js +0 -6
- package/dist/esnext/utilities/graphql-tracker.d.ts +0 -17
- package/dist/esnext/utilities/graphql-tracker.js +0 -121
- package/dist/esnext/utilities/hash.d.ts +0 -2
- package/dist/esnext/utilities/hash.js +0 -26
- package/dist/esnext/utilities/html-encoding.d.ts +0 -1
- package/dist/esnext/utilities/html-encoding.js +0 -8
- package/dist/esnext/utilities/image_size.d.ts +0 -34
- package/dist/esnext/utilities/image_size.js +0 -96
- package/dist/esnext/utilities/index.d.ts +0 -12
- package/dist/esnext/utilities/index.js +0 -12
- package/dist/esnext/utilities/isBrowser/index.d.ts +0 -1
- package/dist/esnext/utilities/isBrowser/index.js +0 -1
- package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +0 -4
- package/dist/esnext/utilities/isBrowser/isBrowser.js +0 -6
- package/dist/esnext/utilities/isServer/index.d.ts +0 -1
- package/dist/esnext/utilities/isServer/index.js +0 -1
- package/dist/esnext/utilities/isServer/isServer.d.ts +0 -4
- package/dist/esnext/utilities/isServer/isServer.js +0 -7
- package/dist/esnext/utilities/load_script.d.ts +0 -4
- package/dist/esnext/utilities/load_script.js +0 -28
- package/dist/esnext/utilities/locale/index.d.ts +0 -1
- package/dist/esnext/utilities/locale/index.js +0 -1
- package/dist/esnext/utilities/locale/locale.d.ts +0 -7
- package/dist/esnext/utilities/locale/locale.js +0 -22
- package/dist/esnext/utilities/log/index.d.ts +0 -4
- package/dist/esnext/utilities/log/index.js +0 -4
- package/dist/esnext/utilities/log/log-cache-api-status.d.ts +0 -1
- package/dist/esnext/utilities/log/log-cache-api-status.js +0 -17
- package/dist/esnext/utilities/log/log-cache-header.d.ts +0 -10
- package/dist/esnext/utilities/log/log-cache-header.js +0 -30
- package/dist/esnext/utilities/log/log-query-timeline.d.ts +0 -12
- package/dist/esnext/utilities/log/log-query-timeline.js +0 -105
- package/dist/esnext/utilities/log/log.d.ts +0 -28
- package/dist/esnext/utilities/log/log.js +0 -89
- package/dist/esnext/utilities/log/utils.d.ts +0 -3
- package/dist/esnext/utilities/log/utils.js +0 -11
- package/dist/esnext/utilities/matchPath.d.ts +0 -10
- package/dist/esnext/utilities/matchPath.js +0 -54
- package/dist/esnext/utilities/measurement.d.ts +0 -3
- package/dist/esnext/utilities/measurement.js +0 -98
- package/dist/esnext/utilities/object.d.ts +0 -5
- package/dist/esnext/utilities/object.js +0 -7
- package/dist/esnext/utilities/parse.d.ts +0 -2
- package/dist/esnext/utilities/parse.js +0 -28
- package/dist/esnext/utilities/parseMetafield/index.d.ts +0 -1
- package/dist/esnext/utilities/parseMetafield/index.js +0 -1
- package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +0 -15
- package/dist/esnext/utilities/parseMetafield/parseMetafield.js +0 -62
- package/dist/esnext/utilities/random.d.ts +0 -1
- package/dist/esnext/utilities/random.js +0 -11
- package/dist/esnext/utilities/storefrontApi.d.ts +0 -8
- package/dist/esnext/utilities/storefrontApi.js +0 -63
- package/dist/esnext/utilities/suspense.d.ts +0 -12
- package/dist/esnext/utilities/suspense.js +0 -58
- package/dist/esnext/utilities/template.d.ts +0 -10
- package/dist/esnext/utilities/template.js +0 -60
- package/dist/esnext/utilities/tests/MockedServerRequestProvider.server.d.ts +0 -6
- package/dist/esnext/utilities/tests/MockedServerRequestProvider.server.js +0 -9
- package/dist/esnext/utilities/tests/price.d.ts +0 -5
- package/dist/esnext/utilities/tests/price.js +0 -8
- package/dist/esnext/utilities/tests/provider-helpers.d.ts +0 -31
- package/dist/esnext/utilities/tests/provider-helpers.js +0 -36
- package/dist/esnext/utilities/timing.d.ts +0 -7
- package/dist/esnext/utilities/timing.js +0 -14
- package/dist/esnext/utilities/video_parameters.d.ts +0 -47
- package/dist/esnext/utilities/video_parameters.js +0 -22
- package/dist/esnext/utilities/vite.d.ts +0 -1
- package/dist/esnext/utilities/vite.js +0 -4
- package/dist/esnext/utilities/web-api-polyfill.d.ts +0 -1
- package/dist/esnext/utilities/web-api-polyfill.js +0 -25
- package/dist/esnext/version.d.ts +0 -1
- package/dist/esnext/version.js +0 -1
- package/dist/node/foundation/session/session-types.d.ts +0 -15
- package/dist/node/foundation/session/session-types.js +0 -2
- package/dist/node/framework/cache/in-memory.d.ts +0 -17
- package/dist/node/framework/cache/in-memory.js +0 -84
- package/dist/node/framework/graphiql.d.ts +0 -1
- package/dist/node/framework/load-config.d.ts +0 -5
- package/dist/node/framework/load-config.js +0 -11
- package/dist/node/framework/middleware.d.ts +0 -21
- package/dist/node/framework/middleware.js +0 -124
- package/dist/node/framework/plugin.d.ts +0 -5
- package/dist/node/framework/plugin.js +0 -40
- package/dist/node/framework/plugins/vite-plugin-assets-version.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-assets-version.js +0 -15
- package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-client-imports.js +0 -31
- package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +0 -107
- package/dist/node/framework/plugins/vite-plugin-css-rsc.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-css-rsc.js +0 -219
- package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +0 -46
- package/dist/node/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-hydrogen-client-components-cache.js +0 -38
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +0 -4
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +0 -118
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +0 -11
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +0 -66
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +0 -29
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +0 -26
- package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +0 -7
- package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +0 -155
- package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-platform-entry.js +0 -117
- package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +0 -22
- package/dist/node/framework/types.d.ts +0 -20
- package/dist/node/framework/types.js +0 -2
- package/dist/node/framework/viteception.d.ts +0 -5
- package/dist/node/framework/viteception.js +0 -26
- package/dist/node/shared-types.d.ts +0 -31
- package/dist/node/shared-types.js +0 -5
- package/dist/node/utilities/vite.d.ts +0 -1
- package/dist/node/utilities/vite.js +0 -30
- package/dist/node/utilities/web-api-polyfill.d.ts +0 -1
- package/dist/node/utilities/web-api-polyfill.js +0 -53
- package/vendor/react-server-dom-vite/LICENSE +0 -21
- package/vendor/react-server-dom-vite/README.md +0 -5
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +0 -632
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +0 -1884
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +0 -48
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +0 -1945
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +0 -49
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +0 -629
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +0 -19
- package/vendor/react-server-dom-vite/esm/package.json +0 -3
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +0 -83
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +0 -628
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +0 -1876
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +0 -1937
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +0 -619
- package/vendor/react-server-dom-vite/index.js +0 -7
- package/vendor/react-server-dom-vite/package.json +0 -67
- package/vendor/react-server-dom-vite/plugin.js +0 -3
- package/vendor/react-server-dom-vite/writer.browser.server.js +0 -7
- package/vendor/react-server-dom-vite/writer.node.server.js +0 -7
|
@@ -1,628 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-server-dom-vite-plugin.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { init, parse } from 'es-module-lexer';
|
|
12
|
-
import MagicString from 'magic-string';
|
|
13
|
-
import { promises } from 'fs';
|
|
14
|
-
import path from 'path';
|
|
15
|
-
import { version, normalizePath as normalizePath$1, transformWithEsbuild as transformWithEsbuild$1, createServer as createServer$1 } from 'vite';
|
|
16
|
-
|
|
17
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
18
|
-
if (!o) return;
|
|
19
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
20
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
21
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
22
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
23
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _arrayLikeToArray(arr, len) {
|
|
27
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
28
|
-
|
|
29
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
30
|
-
|
|
31
|
-
return arr2;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
35
|
-
var it;
|
|
36
|
-
|
|
37
|
-
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
38
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
39
|
-
if (it) o = it;
|
|
40
|
-
var i = 0;
|
|
41
|
-
|
|
42
|
-
var F = function () {};
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
s: F,
|
|
46
|
-
n: function () {
|
|
47
|
-
if (i >= o.length) return {
|
|
48
|
-
done: true
|
|
49
|
-
};
|
|
50
|
-
return {
|
|
51
|
-
done: false,
|
|
52
|
-
value: o[i++]
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
e: function (e) {
|
|
56
|
-
throw e;
|
|
57
|
-
},
|
|
58
|
-
f: F
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var normalCompletion = true,
|
|
66
|
-
didErr = false,
|
|
67
|
-
err;
|
|
68
|
-
return {
|
|
69
|
-
s: function () {
|
|
70
|
-
it = o[Symbol.iterator]();
|
|
71
|
-
},
|
|
72
|
-
n: function () {
|
|
73
|
-
var step = it.next();
|
|
74
|
-
normalCompletion = step.done;
|
|
75
|
-
return step;
|
|
76
|
-
},
|
|
77
|
-
e: function (e) {
|
|
78
|
-
didErr = true;
|
|
79
|
-
err = e;
|
|
80
|
-
},
|
|
81
|
-
f: function () {
|
|
82
|
-
try {
|
|
83
|
-
if (!normalCompletion && it.return != null) it.return();
|
|
84
|
-
} finally {
|
|
85
|
-
if (didErr) throw err;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var assign = Object.assign;
|
|
92
|
-
|
|
93
|
-
var normalizePath = normalizePath$1,
|
|
94
|
-
transformWithEsbuild = transformWithEsbuild$1,
|
|
95
|
-
createServer = createServer$1;
|
|
96
|
-
var isVite3 = version && version.startsWith('3.');
|
|
97
|
-
var rscViteFileRE = /\/react-server-dom-vite.js/;
|
|
98
|
-
var noProxyRE = /[&?]no-proxy($|&)/;
|
|
99
|
-
|
|
100
|
-
var isClientComponent = function (id) {
|
|
101
|
-
return /\.client\.[jt]sx?($|\?)/.test(id);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
function ReactFlightVitePlugin() {
|
|
105
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
106
|
-
serverBuildEntries = _ref.serverBuildEntries,
|
|
107
|
-
_ref$optimizeBoundari = _ref.optimizeBoundaries,
|
|
108
|
-
optimizeBoundaries = _ref$optimizeBoundari === void 0 ? 'build' : _ref$optimizeBoundari,
|
|
109
|
-
_ref$isServerComponen = _ref.isServerComponentImporterAllowed,
|
|
110
|
-
isServerComponentImporterAllowed = _ref$isServerComponen === void 0 ? function (importer) {
|
|
111
|
-
return false;
|
|
112
|
-
} : _ref$isServerComponen;
|
|
113
|
-
|
|
114
|
-
var config;
|
|
115
|
-
var server;
|
|
116
|
-
var resolveAlias;
|
|
117
|
-
var globImporterPath;
|
|
118
|
-
var allClientBoundaries = new Set();
|
|
119
|
-
|
|
120
|
-
function invalidateGlobImporter() {
|
|
121
|
-
if (globImporterPath && server) {
|
|
122
|
-
server.watcher.emit('change', globImporterPath);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
name: 'vite-plugin-react-server-components',
|
|
128
|
-
enforce: 'pre',
|
|
129
|
-
buildStart: function () {
|
|
130
|
-
// Let other plugins differentiate between pure SSR and RSC builds
|
|
131
|
-
if (config?.build?.ssr) process.env.VITE_RSC_BUILD = 'true';
|
|
132
|
-
},
|
|
133
|
-
buildEnd: function () {
|
|
134
|
-
if (config?.build?.ssr) delete process.env.VITE_RSC_BUILD;
|
|
135
|
-
},
|
|
136
|
-
configureServer: function (_server) {
|
|
137
|
-
server = _server;
|
|
138
|
-
var seenModules = {};
|
|
139
|
-
server.ws.on('rsc:cc404', function (data) {
|
|
140
|
-
if (!seenModules[data.id]) {
|
|
141
|
-
seenModules[data.id] = true;
|
|
142
|
-
invalidateGlobImporter();
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
configResolved: async function (_config) {
|
|
147
|
-
await init;
|
|
148
|
-
config = _config;
|
|
149
|
-
var aliasPlugin = config.plugins.find(function (plugin) {
|
|
150
|
-
return plugin.name === 'alias';
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
if (aliasPlugin) {
|
|
154
|
-
resolveAlias = aliasPlugin.resolveId.bind({
|
|
155
|
-
// Mock Rollup instance
|
|
156
|
-
resolve: function (id) {
|
|
157
|
-
return {
|
|
158
|
-
then: function () {
|
|
159
|
-
return id ? {
|
|
160
|
-
id: id
|
|
161
|
-
} : null;
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
} // By pushing this plugin at the end of the existing array,
|
|
167
|
-
// we enforce running it *after* Vite resolves import.meta.glob.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
config.plugins.push(hashImportsPlugin);
|
|
171
|
-
},
|
|
172
|
-
resolveId: function (source, importer) {
|
|
173
|
-
if (!importer) return null;
|
|
174
|
-
|
|
175
|
-
if (noProxyRE.test(source)) {
|
|
176
|
-
var _source$split = source.split('?'),
|
|
177
|
-
id = _source$split[0],
|
|
178
|
-
query = _source$split[1];
|
|
179
|
-
|
|
180
|
-
return this.resolve(id, importer, {
|
|
181
|
-
skipSelf: true
|
|
182
|
-
}).then(function (result) {
|
|
183
|
-
if (!result) return null;
|
|
184
|
-
return assign({}, result, {
|
|
185
|
-
id: result.id + (query ? "?" + query : ''),
|
|
186
|
-
moduleSideEffects: false
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Throw errors when non-Server Components try to load Server Components.
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (/\.server(\.[jt]sx?)?$/.test(source) && !(/(\.server\.[jt]sx?|index\.html)$/.test(importer) || isServerComponentImporterAllowed(importer, source))) {
|
|
196
|
-
throw new Error("Cannot import " + source + " from \"" + importer + "\". " + 'By react-server convention, .server.js files can only be imported from other .server.js files. ' + 'That way nobody accidentally sends these to the client by indirectly importing it.');
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
load: function (id) {
|
|
200
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
201
|
-
if (!options.ssr || !isClientComponent(id) || noProxyRE.test(id)) return;
|
|
202
|
-
|
|
203
|
-
if (server) {
|
|
204
|
-
var mod = server.moduleGraph.idToModuleMap.get(id.replace('/@fs', ''));
|
|
205
|
-
|
|
206
|
-
if (mod && mod.importers) {
|
|
207
|
-
if (Array.from(mod.importers).every(function (impMod) {
|
|
208
|
-
return noProxyRE.test(impMod.id);
|
|
209
|
-
})) {
|
|
210
|
-
// This module is only imported from client components
|
|
211
|
-
// so we don't need to create a module reference
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
} // Mark module as a client component.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var moduleNode = server.moduleGraph.getModuleById(id);
|
|
218
|
-
if (!moduleNode.meta) moduleNode.meta = {};
|
|
219
|
-
|
|
220
|
-
if (!moduleNode.meta.isClientComponent) {
|
|
221
|
-
moduleNode.meta.isClientComponent = true; // Invalidate glob importer file to account for the
|
|
222
|
-
// newly discovered client component.
|
|
223
|
-
|
|
224
|
-
invalidateGlobImporter();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return proxyClientComponent(id.split('?')[0]);
|
|
229
|
-
},
|
|
230
|
-
transform: function (code, id) {
|
|
231
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
232
|
-
|
|
233
|
-
// Add more information for this module in the graph.
|
|
234
|
-
// It will be used later to discover client boundaries.
|
|
235
|
-
if (server && options.ssr && /\.[jt]sx?($|\?)/.test(id)) {
|
|
236
|
-
augmentModuleGraph(server.moduleGraph, id, code, config.root, resolveAlias);
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* In order to allow dynamic component imports from RSC, we use Vite's import.meta.glob.
|
|
240
|
-
* This hook replaces the glob placeholders with resolved paths to all client components.
|
|
241
|
-
*
|
|
242
|
-
* NOTE: Glob import paths MUST be relative to the importer file in
|
|
243
|
-
* order to get the `?v=xxx` querystring from Vite added to the import URL.
|
|
244
|
-
* If the paths are relative to the root instead, Vite won't add the querystring
|
|
245
|
-
* and we will have duplicated files in the browser (with duplicated contexts, etc).
|
|
246
|
-
*/
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (rscViteFileRE.test(id)) {
|
|
250
|
-
var INJECTING_RE = /\{\s*__INJECTED_CLIENT_IMPORTERS__[:\s]*null[,\s]*\}\s*;/;
|
|
251
|
-
var s = new MagicString(code);
|
|
252
|
-
id = id.split('?')[0];
|
|
253
|
-
|
|
254
|
-
if (options && options.ssr) {
|
|
255
|
-
// In SSR, directly use components already discovered by RSC
|
|
256
|
-
// instead of globs to avoid bundling unused components.
|
|
257
|
-
s.replace(INJECTING_RE, 'globalThis.__COMPONENT_INDEX');
|
|
258
|
-
return {
|
|
259
|
-
code: s.toString(),
|
|
260
|
-
map: s.generateMap({
|
|
261
|
-
file: id,
|
|
262
|
-
source: id
|
|
263
|
-
})
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
var injectGlobs = function (clientComponents) {
|
|
268
|
-
var importerPath = path.dirname(id);
|
|
269
|
-
var importers = clientComponents.map(function (absolutePath) {
|
|
270
|
-
return normalizePath(path.relative(importerPath, absolutePath));
|
|
271
|
-
});
|
|
272
|
-
var injectedGlobs = "Object.assign(Object.create(null), " + importers.map(function (glob) {
|
|
273
|
-
return (// Mark the globs to modify the result after Vite resolves them.
|
|
274
|
-
"\n/* HASH_BEGIN */ " + ("import.meta.glob('" + normalizePath(glob) + "') /* HASH_END */")
|
|
275
|
-
);
|
|
276
|
-
}).join(', ') + ");";
|
|
277
|
-
s.replace(INJECTING_RE, injectedGlobs);
|
|
278
|
-
return {
|
|
279
|
-
code: s.toString(),
|
|
280
|
-
map: s.generateMap({
|
|
281
|
-
file: id,
|
|
282
|
-
source: id
|
|
283
|
-
})
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
if (config.command === 'serve') {
|
|
288
|
-
globImporterPath = id; // When mixing client and server components from the same
|
|
289
|
-
// facade file, the module graph can break and miss certain
|
|
290
|
-
// import connections (bug in Vite?) due to HMR. Instead of
|
|
291
|
-
// creating a new list of discovered components from scratch,
|
|
292
|
-
// reuse the already discovered ones and simply add new ones
|
|
293
|
-
// to the list without removing anything.
|
|
294
|
-
|
|
295
|
-
findClientBoundaries(server.moduleGraph, optimizeBoundaries === true).forEach(function (boundary) {
|
|
296
|
-
return allClientBoundaries.add(boundary);
|
|
297
|
-
});
|
|
298
|
-
return injectGlobs(Array.from(allClientBoundaries));
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (!serverBuildEntries) {
|
|
302
|
-
throw new Error('[react-server-dom-vite] Parameter serverBuildEntries is required for client build');
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return findClientBoundariesForClientBuild(serverBuildEntries, optimizeBoundaries !== false, config.root).then(injectGlobs);
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
handleHotUpdate: function (_ref2) {
|
|
309
|
-
var modules = _ref2.modules;
|
|
310
|
-
|
|
311
|
-
if (modules.some(function (mod) {
|
|
312
|
-
return mod.meta && mod.meta.isClientComponent;
|
|
313
|
-
})) {
|
|
314
|
-
return modules.filter(function (mod) {
|
|
315
|
-
return !mod.meta || !mod.meta.ssr;
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
return modules;
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
var btoa = function (hash) {
|
|
325
|
-
return (// eslint-disable-next-line react-internal/safe-string-coercion
|
|
326
|
-
Buffer.from(String(hash), 'binary').toString('base64')
|
|
327
|
-
);
|
|
328
|
-
}; // Quick, lossy hash function: https://stackoverflow.com/a/8831937/4468962
|
|
329
|
-
// Prevents leaking path information in the browser, and minifies RSC responses.
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
function hashCode(value) {
|
|
333
|
-
var hash = 0;
|
|
334
|
-
|
|
335
|
-
for (var i = 0; i < value.length; i++) {
|
|
336
|
-
var char = value.charCodeAt(i);
|
|
337
|
-
hash = (hash << 5) - hash + char;
|
|
338
|
-
hash &= hash;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
return btoa(hash).replace(/=+/, '');
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
var getComponentFilename = function (filepath) {
|
|
345
|
-
return filepath.split('/').pop().split('.').shift();
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
var getComponentId = function (filepath) {
|
|
349
|
-
return getComponentFilename(filepath) + "-" + hashCode(filepath);
|
|
350
|
-
};
|
|
351
|
-
async function proxyClientComponent(filepath, src) {
|
|
352
|
-
var DEFAULT_EXPORT = 'default'; // Modify the import ID to avoid infinite wraps
|
|
353
|
-
|
|
354
|
-
var importFrom = filepath + "?no-proxy";
|
|
355
|
-
await init;
|
|
356
|
-
|
|
357
|
-
if (!src) {
|
|
358
|
-
src = await promises.readFile(filepath, 'utf-8');
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
var _await$transformWithE = await transformWithEsbuild(src, filepath),
|
|
362
|
-
code = _await$transformWithE.code;
|
|
363
|
-
|
|
364
|
-
var _parse = parse(code),
|
|
365
|
-
exportStatements = _parse[1];
|
|
366
|
-
|
|
367
|
-
var proxyCode = "import {wrapInClientProxy} from 'react-server-dom-vite/client-proxy';\n" + ("import * as allImports from '" + importFrom + "';\n\n"); // Wrap components in Client Proxy
|
|
368
|
-
|
|
369
|
-
exportStatements.forEach(function (key) {
|
|
370
|
-
var isDefault = key === DEFAULT_EXPORT;
|
|
371
|
-
var componentName = isDefault ? getComponentFilename(filepath) : key;
|
|
372
|
-
proxyCode += "export " + (isDefault ? DEFAULT_EXPORT : "const " + componentName + " =") + " /* @__PURE__ */wrapInClientProxy({ name: '" + componentName + "', id: '" + getComponentId(filepath) + "', value: allImports['" + key + "'], isDefault: " + // eslint-disable-next-line react-internal/safe-string-coercion
|
|
373
|
-
String(isDefault) + " });\n";
|
|
374
|
-
});
|
|
375
|
-
return {
|
|
376
|
-
code: proxyCode,
|
|
377
|
-
moduleSideEffects: false
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function findClientBoundaries(moduleGraph) {
|
|
382
|
-
var optimizeBoundaries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
383
|
-
var clientBoundaries = []; // eslint-disable-next-line no-for-of-loops/no-for-of-loops
|
|
384
|
-
|
|
385
|
-
var _iterator = _createForOfIteratorHelper(moduleGraph.fileToModulesMap.values()),
|
|
386
|
-
_step;
|
|
387
|
-
|
|
388
|
-
try {
|
|
389
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
390
|
-
var set = _step.value;
|
|
391
|
-
var clientModule = Array.from(set).find(function (moduleNode) {
|
|
392
|
-
return moduleNode.meta && moduleNode.meta.isClientComponent;
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
if (clientModule && (!optimizeBoundaries || isDirectImportInServer(clientModule))) {
|
|
396
|
-
clientBoundaries.push(clientModule.file);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
} catch (err) {
|
|
400
|
-
_iterator.e(err);
|
|
401
|
-
} finally {
|
|
402
|
-
_iterator.f();
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
return clientBoundaries;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
async function findClientBoundariesForClientBuild(serverEntries, optimizeBoundaries, root) {
|
|
409
|
-
// Viteception
|
|
410
|
-
var server = await createServer({
|
|
411
|
-
root: root,
|
|
412
|
-
clearScreen: false,
|
|
413
|
-
server: {
|
|
414
|
-
middlewareMode: isVite3 ? true : 'ssr',
|
|
415
|
-
hmr: false
|
|
416
|
-
},
|
|
417
|
-
appType: 'custom'
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
try {
|
|
421
|
-
// Load server entries to discover client components
|
|
422
|
-
await Promise.all(serverEntries.map(server.ssrLoadModule));
|
|
423
|
-
} catch (error) {
|
|
424
|
-
error.message = 'Could not load server build entries: ' + error.message;
|
|
425
|
-
throw error;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
await server.close();
|
|
429
|
-
return findClientBoundaries(server.moduleGraph, optimizeBoundaries);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
var hashImportsPlugin = {
|
|
433
|
-
name: 'vite-plugin-react-server-components-hash-imports',
|
|
434
|
-
enforce: 'post',
|
|
435
|
-
transform: function (code, id) {
|
|
436
|
-
// Turn relative import paths to lossy hashes
|
|
437
|
-
if (rscViteFileRE.test(id)) {
|
|
438
|
-
var s = new MagicString(code);
|
|
439
|
-
s.replace(/\/\*\s*HASH_BEGIN\s*\*\/\s*([^]+?)\/\*\s*HASH_END\s*\*\//gm, function (_, imports) {
|
|
440
|
-
return imports.trim().replace(/"([^"]+?)":/gm, function (all, relativePath) {
|
|
441
|
-
if (relativePath === '__VITE_PRELOAD__') return all;
|
|
442
|
-
var absolutePath = path.resolve(path.dirname(id.split('?')[0]), relativePath);
|
|
443
|
-
return "\"" + getComponentId(normalizePath(absolutePath)) + "\":";
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
return {
|
|
447
|
-
code: s.toString(),
|
|
448
|
-
map: s.generateMap({
|
|
449
|
-
file: id,
|
|
450
|
-
source: id
|
|
451
|
-
})
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* A client module should behave as a client boundary
|
|
459
|
-
* if it is imported by the server before encountering
|
|
460
|
-
* another boundary in the process.
|
|
461
|
-
* This traverses the module graph upwards to find non client
|
|
462
|
-
* components that import the `originalMod`.
|
|
463
|
-
*
|
|
464
|
-
* The `accModInfo` represents the exported members from the
|
|
465
|
-
* `originalMod` but renamed accordingly to all the intermediate/facade
|
|
466
|
-
* files in the import chain from the `originalMod` to every parent importer.
|
|
467
|
-
*/
|
|
468
|
-
function isDirectImportInServer(originalMod, currentMod, accModInfo) {
|
|
469
|
-
// TODO: this should use recursion in any module that exports
|
|
470
|
-
// the original one, not only in full facade files.
|
|
471
|
-
if (!currentMod || (currentMod.meta || {}).isFacade) {
|
|
472
|
-
if (!accModInfo && originalMod.meta && originalMod.meta.namedExports) {
|
|
473
|
-
// First iteration in the recursion, initialize the
|
|
474
|
-
// acumulator with data from the original module.
|
|
475
|
-
accModInfo = {
|
|
476
|
-
file: originalMod.file,
|
|
477
|
-
exports: originalMod.meta.namedExports
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
if (currentMod && accModInfo) {
|
|
482
|
-
// Update accumulator in subsequent iterations with
|
|
483
|
-
// whatever the current module is re-exporting.
|
|
484
|
-
var lastModExports = accModInfo.exports;
|
|
485
|
-
var lastModImports = currentMod.meta.imports.filter(function (importMeta) {
|
|
486
|
-
return importMeta.action === 'export' && importMeta.from === accModInfo.file;
|
|
487
|
-
});
|
|
488
|
-
accModInfo = {
|
|
489
|
-
file: currentMod.file,
|
|
490
|
-
exports: []
|
|
491
|
-
};
|
|
492
|
-
lastModImports.forEach(function (mod) {
|
|
493
|
-
mod.variables.forEach(function (_ref3) {
|
|
494
|
-
var name = _ref3[0],
|
|
495
|
-
alias = _ref3[1];
|
|
496
|
-
|
|
497
|
-
if (name === '*' && !alias) {
|
|
498
|
-
var _accModInfo$exports;
|
|
499
|
-
|
|
500
|
-
(_accModInfo$exports = accModInfo.exports).push.apply(_accModInfo$exports, lastModExports);
|
|
501
|
-
} else {
|
|
502
|
-
accModInfo.exports.push(alias || name);
|
|
503
|
-
}
|
|
504
|
-
});
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
return Array.from((currentMod || originalMod).importers || []).some(function (importer) {
|
|
509
|
-
return (// eslint-disable-next-line no-unused-vars
|
|
510
|
-
isDirectImportInServer(originalMod, importer, accModInfo)
|
|
511
|
-
);
|
|
512
|
-
});
|
|
513
|
-
} // Not enough information: safer to assume it is
|
|
514
|
-
// imported in server to create a new boundary.
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
if (!currentMod.meta || !originalMod.meta) return true; // If current module is a client component, stop checking
|
|
518
|
-
// parents since this can be the actual boundary.
|
|
519
|
-
|
|
520
|
-
if (isClientComponent(currentMod.file)) return false; // If current module is not a client component, assume
|
|
521
|
-
// it is a server component on a shared component
|
|
522
|
-
// that will be imported in the server to be safe.
|
|
523
|
-
// However, due to the lack of tree-shaking in the dev module graph,
|
|
524
|
-
// we need to manually make sure this module is importing something from
|
|
525
|
-
// the original module before marking it as client boundary.
|
|
526
|
-
|
|
527
|
-
return currentMod.meta.imports.some(function (imp) {
|
|
528
|
-
return imp.from === accModInfo.file && (imp.variables || []).some(function (_ref4) {
|
|
529
|
-
var name = _ref4[0];
|
|
530
|
-
return accModInfo.exports.includes(name);
|
|
531
|
-
});
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
var RESOLVE_EXTENSIONS = ['', '.js', '.ts', '.jsx', '.tsx', '/index', '/index.js', '/index.ts', '/index.jsx', '/index.tsx']; // Resolve relative paths and aliases. Examples:
|
|
536
|
-
// - import {XYZ} from '~/components' => import {XYZ} from '<absolute>/src/components/index.ts'
|
|
537
|
-
// - import {XYZ} from '/src/component.client' => import {XYZ} from '<absolute>/src/component.client.jsx'`
|
|
538
|
-
|
|
539
|
-
function resolveModPath(modPath, dirname) {
|
|
540
|
-
var extensions = /\.[jt]sx?$/.test(modPath) ? [''] : RESOLVE_EXTENSIONS;
|
|
541
|
-
|
|
542
|
-
for (var i = 0; i < extensions.length; i++) {
|
|
543
|
-
var extension = extensions[i];
|
|
544
|
-
|
|
545
|
-
try {
|
|
546
|
-
var absolutePath = modPath.startsWith('.') ? normalizePath(path.resolve(dirname, modPath)) : modPath;
|
|
547
|
-
return normalizePath(require.resolve(absolutePath + extension));
|
|
548
|
-
} catch (error) {// Do not throw, this is likely a virtual module or another exception
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
function augmentModuleGraph(moduleGraph, id, code, root, resolveAlias) {
|
|
554
|
-
var currentModule = moduleGraph.getModuleById(id);
|
|
555
|
-
if (!currentModule) return;
|
|
556
|
-
|
|
557
|
-
var _id$split = id.split('?'),
|
|
558
|
-
source = _id$split[0];
|
|
559
|
-
|
|
560
|
-
var dirname = normalizePath(path.dirname(source));
|
|
561
|
-
|
|
562
|
-
var _parse2 = parse(code),
|
|
563
|
-
rawImports = _parse2[0],
|
|
564
|
-
namedExports = _parse2[1],
|
|
565
|
-
isFacade = _parse2[2]; // This is currently not used but it should be considered
|
|
566
|
-
// to improve the crawling in `isDirectImportInServer`.
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var imports = [];
|
|
570
|
-
rawImports.forEach(function (_ref5) {
|
|
571
|
-
var startMod = _ref5.s,
|
|
572
|
-
endMod = _ref5.e,
|
|
573
|
-
dynamicImportIndex = _ref5.d,
|
|
574
|
-
startStatement = _ref5.ss,
|
|
575
|
-
endStatement = _ref5.se;
|
|
576
|
-
if (dynamicImportIndex !== -1) return; // Skip dynamic imports for now
|
|
577
|
-
|
|
578
|
-
var rawModPath = code.slice(startMod, endMod);
|
|
579
|
-
var modPath = rawModPath.split('?')[0];
|
|
580
|
-
|
|
581
|
-
if (resolveAlias) {
|
|
582
|
-
var resolvedAliasPath = resolveAlias(modPath, 'rsc_importer', {});
|
|
583
|
-
|
|
584
|
-
if (resolvedAliasPath && resolvedAliasPath.id) {
|
|
585
|
-
modPath = resolvedAliasPath.id;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
if (modPath && modPath.startsWith('/src/')) {
|
|
590
|
-
// Vite default alias
|
|
591
|
-
modPath = normalizePath(path.join(root, modPath));
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
var resolvedPath = resolveModPath(modPath, dirname);
|
|
595
|
-
if (!resolvedPath) return; // Virtual modules or other exceptions
|
|
596
|
-
|
|
597
|
-
var _code$slice$split$0$s = code.slice(startStatement, endStatement).split(/\s+(from\s+)?['"]/m)[0].split(/\s+(.+)/m),
|
|
598
|
-
action = _code$slice$split$0$s[0],
|
|
599
|
-
_code$slice$split$0$s2 = _code$slice$split$0$s[1],
|
|
600
|
-
variables = _code$slice$split$0$s2 === void 0 ? '' : _code$slice$split$0$s2;
|
|
601
|
-
|
|
602
|
-
imports.push({
|
|
603
|
-
action: action,
|
|
604
|
-
// 'import' or 'export'
|
|
605
|
-
variables: variables // [['originalName', 'alias']]
|
|
606
|
-
.trim().replace(/^[^{*]/, 'default as $&').replace(/[{}]/gm, '').trim().split(/\s*,\s*/m).filter(Boolean).map(function (s) {
|
|
607
|
-
return s.split(/\s+as\s+/m);
|
|
608
|
-
}),
|
|
609
|
-
from: resolvedPath,
|
|
610
|
-
// '/absolute/path'
|
|
611
|
-
originalFrom: rawModPath // './path' or '3plib/subpath'
|
|
612
|
-
|
|
613
|
-
});
|
|
614
|
-
});
|
|
615
|
-
|
|
616
|
-
if (!currentModule.meta) {
|
|
617
|
-
currentModule.meta = {};
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
assign(currentModule.meta, {
|
|
621
|
-
isFacade: isFacade,
|
|
622
|
-
namedExports: namedExports,
|
|
623
|
-
imports: imports,
|
|
624
|
-
ssr: true
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
export default ReactFlightVitePlugin;
|