next 15.2.0-canary.65 → 15.2.0-canary.66
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +5 -1
- package/dist/bin/next.map +1 -1
- package/dist/build/entries.d.ts +1 -0
- package/dist/build/entries.js +12 -1
- package/dist/build/entries.js.map +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/config/blocks/base.js +3 -1
- package/dist/build/webpack/config/blocks/base.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/index.js +3 -1
- package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/loaders/client.js +3 -1
- package/dist/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
- package/dist/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
- package/dist/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-loader/index.js +8 -2
- package/dist/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
- package/dist/build/webpack/loaders/utils.js +1 -1
- package/dist/build/webpack/loaders/utils.js.map +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin.d.ts +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin.js +13 -4
- package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/flight-client-entry-plugin.d.ts +1 -1
- package/dist/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
- package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/flight-manifest-plugin.js +3 -3
- package/dist/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/middleware-plugin.js +6 -3
- package/dist/build/webpack/plugins/middleware-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
- package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
- package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.d.ts +36 -0
- package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
- package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
- package/dist/build/webpack/plugins/rspack-profiling-plugin.d.ts +9 -0
- package/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
- package/dist/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
- package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
- package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
- package/dist/build/webpack/utils.js +6 -2
- package/dist/build/webpack/utils.js.map +1 -1
- package/dist/build/webpack-config.js +37 -5
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/app-dir/link.js +2 -0
- package/dist/client/app-dir/link.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js +41 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.d.ts +2 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +72 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.d.ts +2 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +82 -31
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +20 -21
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.d.ts +8 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +80 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.d.ts +9 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +158 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.d.ts +8 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +212 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.d.ts +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +34 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
- package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +2 -2
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
- package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-response.d.ts +9 -0
- package/dist/client/components/react-dev-overlay/server/middleware-response.js +46 -0
- package/dist/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +13 -12
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +12 -11
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -7
- package/dist/client/components/react-dev-overlay/server/shared.js +1 -51
- package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
- package/dist/client/components/react-dev-overlay/shared.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/shared.js +2 -0
- package/dist/client/components/react-dev-overlay/shared.js.map +1 -1
- package/dist/client/index.js +2 -3
- package/dist/client/index.js.map +1 -1
- package/dist/client/link.js.map +1 -1
- package/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js +8 -44
- package/dist/compiled/@next/font/dist/google/fetch-font-file.d.ts +2 -1
- package/dist/compiled/@next/font/dist/google/fetch-font-file.js +6 -20
- package/dist/compiled/@next/font/dist/google/fetch-resource.d.ts +6 -0
- package/dist/compiled/@next/font/dist/google/fetch-resource.js +46 -0
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +2 -2
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/compiled/node-fetch/index.js +1 -1
- package/dist/compiled/sass-loader/cjs.js +1 -1
- package/dist/compiled/webpack/webpack.js +23 -1
- package/dist/esm/build/entries.js +9 -2
- package/dist/esm/build/entries.js.map +1 -1
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/config/blocks/base.js +3 -1
- package/dist/esm/build/webpack/config/blocks/base.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js +3 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/loaders/client.js +3 -1
- package/dist/esm/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
- package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
- package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-loader/index.js +8 -2
- package/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
- package/dist/esm/build/webpack/loaders/utils.js +1 -1
- package/dist/esm/build/webpack/loaders/utils.js.map +1 -1
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +14 -5
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
- package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js +3 -3
- package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/middleware-plugin.js +6 -3
- package/dist/esm/build/webpack/plugins/middleware-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
- package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
- package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
- package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js +87 -0
- package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
- package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js +40 -0
- package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
- package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
- package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
- package/dist/esm/build/webpack/utils.js +6 -2
- package/dist/esm/build/webpack/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +37 -5
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/app-dir/link.js +2 -0
- package/dist/esm/client/app-dir/link.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js +25 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +54 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +83 -31
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +13 -14
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +52 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +130 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +184 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +18 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
- package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js +30 -0
- package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +14 -13
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -12
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/shared.js +0 -26
- package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/shared.js +2 -0
- package/dist/esm/client/components/react-dev-overlay/shared.js.map +1 -1
- package/dist/esm/client/index.js +2 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/link.js.map +1 -1
- package/dist/esm/server/base-server.js +15 -15
- package/dist/esm/server/base-server.js.map +1 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +4 -2
- package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +4 -2
- package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/get-rspack.js +32 -0
- package/dist/esm/shared/lib/get-rspack.js.map +1 -0
- package/dist/server/base-server.js +15 -15
- package/dist/server/base-server.js.map +1 -1
- package/dist/server/config-shared.d.ts +3 -3
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +4 -2
- package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +4 -2
- package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/get-rspack.d.ts +2 -0
- package/dist/shared/lib/get-rspack.js +54 -0
- package/dist/shared/lib/get-rspack.js.map +1 -0
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/dist/trace/trace-uploader.js +1 -2
- package/dist/trace/trace-uploader.js.map +1 -1
- package/package.json +15 -15
- package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.d.ts +0 -3
- package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -43
- package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
- package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -27
- package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin.ts"],"sourcesContent":["import type { BloomFilter } from '../../../shared/lib/bloom-filter'\nimport type { Rewrite, CustomRoutes } from '../../../lib/load-custom-routes'\nimport devalue from 'next/dist/compiled/devalue'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n BUILD_MANIFEST,\n MIDDLEWARE_BUILD_MANIFEST,\n CLIENT_STATIC_FILES_PATH,\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n SYSTEM_ENTRYPOINTS,\n} from '../../../shared/lib/constants'\nimport type { BuildManifest } from '../../../server/get-page-files'\nimport getRouteFromEntrypoint from '../../../server/get-route-from-entrypoint'\nimport { ampFirstEntryNamesMap } from './next-drop-client-page-plugin'\nimport { getSortedRoutes } from '../../../shared/lib/router/utils'\nimport { spans } from './profiling-plugin'\nimport { Span } from '../../../trace'\n\ntype DeepMutable<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> }\n\nexport type ClientBuildManifest = {\n [key: string]: string[]\n}\n\n// Add the runtime ssg manifest file as a lazy-loaded file dependency.\n// We also stub this file out for development mode (when it is not\n// generated).\nexport const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`\n\n// nodejs: '/static/<build id>/low-priority.js'\nfunction buildNodejsLowPriorityPath(filename: string, buildId: string) {\n return `${CLIENT_STATIC_FILES_PATH}/${buildId}/${filename}`\n}\n\nfunction createEdgeRuntimeManifest(originAssetMap: BuildManifest): string {\n const manifestFilenames = ['_buildManifest.js', '_ssgManifest.js']\n\n const assetMap: BuildManifest = {\n ...originAssetMap,\n lowPriorityFiles: [],\n }\n\n // we use globalThis here because middleware can be node\n // which doesn't have \"self\"\n const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(\n assetMap,\n null,\n 2\n )};\\n`\n // edge lowPriorityFiles item: '\"/static/\" + process.env.__NEXT_BUILD_ID + \"/low-priority.js\"'.\n // Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.\n const lowPriorityFilesCode =\n `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\\n` +\n manifestFilenames\n .map((filename) => {\n return `\"/static/\" + process.env.__NEXT_BUILD_ID + \"/${filename}\",\\n`\n })\n .join(',') +\n `\\n];`\n\n return manifestDefCode + lowPriorityFilesCode\n}\n\nfunction normalizeRewrite(item: {\n source: string\n destination: string\n has?: any\n}): CustomRoutes['rewrites']['beforeFiles'][0] {\n return {\n has: item.has,\n source: item.source,\n destination: item.destination,\n }\n}\n\nexport function normalizeRewritesForBuildManifest(\n rewrites: CustomRoutes['rewrites']\n): CustomRoutes['rewrites'] {\n return {\n afterFiles: rewrites.afterFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n beforeFiles: rewrites.beforeFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n fallback: rewrites.fallback\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n }\n}\n\n// This function takes the asset map generated in BuildManifestPlugin and creates a\n// reduced version to send to the client.\nexport function generateClientManifest(\n assetMap: BuildManifest,\n rewrites: CustomRoutes['rewrites'],\n clientRouterFilters?: {\n staticFilter: ReturnType<BloomFilter['export']>\n dynamicFilter: ReturnType<BloomFilter['export']>\n },\n compiler?: any,\n compilation?: any\n): string | undefined {\n const compilationSpan = compilation\n ? spans.get(compilation)\n : compiler\n ? spans.get(compiler)\n : new Span({ name: 'client-manifest' })\n\n const genClientManifestSpan = compilationSpan?.traceChild(\n 'NextJsBuildManifest-generateClientManifest'\n )\n\n return genClientManifestSpan?.traceFn(() => {\n const clientManifest: ClientBuildManifest = {\n __rewrites: normalizeRewritesForBuildManifest(rewrites) as any,\n __routerFilterStatic: clientRouterFilters?.staticFilter as any,\n __routerFilterDynamic: clientRouterFilters?.dynamicFilter as any,\n }\n const appDependencies = new Set(assetMap.pages['/_app'])\n const sortedPageKeys = getSortedRoutes(Object.keys(assetMap.pages))\n\n sortedPageKeys.forEach((page) => {\n const dependencies = assetMap.pages[page]\n\n if (page === '/_app') return\n // Filter out dependencies in the _app entry, because those will have already\n // been loaded by the client prior to a navigation event\n const filteredDeps = dependencies.filter(\n (dep) => !appDependencies.has(dep)\n )\n\n // The manifest can omit the page if it has no requirements\n if (filteredDeps.length) {\n clientManifest[page] = filteredDeps\n }\n })\n // provide the sorted pages as an array so we don't rely on the object's keys\n // being in order and we don't slow down look-up time for page assets\n clientManifest.sortedPages = sortedPageKeys\n\n return devalue(clientManifest)\n })\n}\n\nexport function getEntrypointFiles(entrypoint: any): string[] {\n return (\n entrypoint\n ?.getFiles()\n .filter((file: string) => {\n // We don't want to include `.hot-update.js` files into the initial page\n return /(?<!\\.hot-update)\\.(js|css)($|\\?)/.test(file)\n })\n .map((file: string) => file.replace(/\\\\/g, '/')) ?? []\n )\n}\n\nexport const processRoute = (r: Rewrite) => {\n const rewrite = { ...r }\n\n // omit external rewrite destinations since these aren't\n // handled client-side\n if (!rewrite?.destination?.startsWith('/')) {\n delete (rewrite as any).destination\n }\n return rewrite\n}\n\n// This plugin creates a build-manifest.json for all assets that are being output\n// It has a mapping of \"entry\" filename to real filename. Because the real filename can be hashed in production\nexport default class BuildManifestPlugin {\n private buildId: string\n private rewrites: CustomRoutes['rewrites']\n private isDevFallback: boolean\n private appDirEnabled: boolean\n private clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n\n constructor(options: {\n buildId: string\n rewrites: CustomRoutes['rewrites']\n isDevFallback?: boolean\n appDirEnabled: boolean\n clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n }) {\n this.buildId = options.buildId\n this.isDevFallback = !!options.isDevFallback\n this.rewrites = {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n }\n this.appDirEnabled = options.appDirEnabled\n this.clientRouterFilters = options.clientRouterFilters\n this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute)\n this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute)\n this.rewrites.fallback = options.rewrites.fallback.map(processRoute)\n }\n\n createAssets(compiler: any, compilation: any) {\n const compilationSpan = spans.get(compilation) || spans.get(compiler)\n const createAssetsSpan = compilationSpan?.traceChild(\n 'NextJsBuildManifest-createassets'\n )\n return createAssetsSpan?.traceFn(() => {\n const entrypoints: Map<string, any> = compilation.entrypoints\n const assetMap: DeepMutable<BuildManifest> = {\n polyfillFiles: [],\n devFiles: [],\n ampDevFiles: [],\n lowPriorityFiles: [],\n rootMainFiles: [],\n rootMainFilesTree: {},\n pages: { '/_app': [] },\n ampFirstPages: [],\n }\n\n const ampFirstEntryNames = ampFirstEntryNamesMap.get(compilation)\n if (ampFirstEntryNames) {\n for (const entryName of ampFirstEntryNames) {\n const pagePath = getRouteFromEntrypoint(entryName)\n if (!pagePath) {\n continue\n }\n\n assetMap.ampFirstPages.push(pagePath)\n }\n }\n\n const mainFiles = new Set(\n getEntrypointFiles(entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN))\n )\n\n if (this.appDirEnabled) {\n assetMap.rootMainFiles = [\n ...new Set(\n getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN_APP)\n )\n ),\n ]\n }\n\n const compilationAssets: {\n name: string\n source: typeof sources.RawSource\n info: object\n }[] = compilation.getAssets()\n\n assetMap.polyfillFiles = compilationAssets\n .filter((p) => {\n // Ensure only .js files are passed through\n if (!p.name.endsWith('.js')) {\n return false\n }\n\n return (\n p.info && CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL in p.info\n )\n })\n .map((v) => v.name)\n\n assetMap.devFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH)\n ).filter((file) => !mainFiles.has(file))\n\n assetMap.ampDevFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_AMP)\n )\n\n for (const entrypoint of compilation.entrypoints.values()) {\n if (SYSTEM_ENTRYPOINTS.has(entrypoint.name)) continue\n const pagePath = getRouteFromEntrypoint(entrypoint.name)\n\n if (!pagePath) {\n continue\n }\n\n const filesForPage = getEntrypointFiles(entrypoint)\n\n assetMap.pages[pagePath] = [...new Set([...mainFiles, ...filesForPage])]\n }\n\n if (!this.isDevFallback) {\n // Add the runtime build manifest file (generated later in this file)\n // as a dependency for the app. If the flag is false, the file won't be\n // downloaded by the client.\n const buildManifestPath = buildNodejsLowPriorityPath(\n '_buildManifest.js',\n this.buildId\n )\n const ssgManifestPath = buildNodejsLowPriorityPath(\n '_ssgManifest.js',\n this.buildId\n )\n assetMap.lowPriorityFiles.push(buildManifestPath, ssgManifestPath)\n compilation.emitAsset(\n ssgManifestPath,\n new sources.RawSource(srcEmptySsgManifest)\n )\n }\n\n assetMap.pages = Object.keys(assetMap.pages)\n .sort()\n .reduce(\n // eslint-disable-next-line\n (a, c) => ((a[c] = assetMap.pages[c]), a),\n {} as typeof assetMap.pages\n )\n\n let buildManifestName = BUILD_MANIFEST\n\n if (this.isDevFallback) {\n buildManifestName = `fallback-${BUILD_MANIFEST}`\n }\n\n compilation.emitAsset(\n buildManifestName,\n new sources.RawSource(JSON.stringify(assetMap, null, 2))\n )\n\n compilation.emitAsset(\n `server/${MIDDLEWARE_BUILD_MANIFEST}.js`,\n new sources.RawSource(`${createEdgeRuntimeManifest(assetMap)}`)\n )\n\n if (!this.isDevFallback) {\n compilation.emitAsset(\n `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`,\n new sources.RawSource(\n `self.__BUILD_MANIFEST = ${generateClientManifest(\n assetMap,\n this.rewrites,\n this.clientRouterFilters,\n compiler,\n compilation\n )};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()`\n )\n )\n }\n })\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.make.tap('NextJsBuildManifest', (compilation) => {\n compilation.hooks.processAssets.tap(\n {\n name: 'NextJsBuildManifest',\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n () => {\n this.createAssets(compiler, compilation)\n }\n )\n })\n return\n }\n}\n"],"names":["BuildManifestPlugin","generateClientManifest","getEntrypointFiles","normalizeRewritesForBuildManifest","processRoute","srcEmptySsgManifest","buildNodejsLowPriorityPath","filename","buildId","CLIENT_STATIC_FILES_PATH","createEdgeRuntimeManifest","originAssetMap","manifestFilenames","assetMap","lowPriorityFiles","manifestDefCode","JSON","stringify","lowPriorityFilesCode","map","join","normalizeRewrite","item","has","source","destination","rewrites","afterFiles","beforeFiles","fallback","clientRouterFilters","compiler","compilation","compilationSpan","spans","get","Span","name","genClientManifestSpan","traceChild","traceFn","clientManifest","__rewrites","__routerFilterStatic","staticFilter","__routerFilterDynamic","dynamicFilter","appDependencies","Set","pages","sortedPageKeys","getSortedRoutes","Object","keys","forEach","page","dependencies","filteredDeps","filter","dep","length","sortedPages","devalue","entrypoint","getFiles","file","test","replace","r","rewrite","startsWith","constructor","options","isDevFallback","appDirEnabled","createAssets","createAssetsSpan","entrypoints","polyfillFiles","devFiles","ampDevFiles","rootMainFiles","rootMainFilesTree","ampFirstPages","ampFirstEntryNames","ampFirstEntryNamesMap","entryName","pagePath","getRouteFromEntrypoint","push","mainFiles","CLIENT_STATIC_FILES_RUNTIME_MAIN","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","compilationAssets","getAssets","p","endsWith","info","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL","v","CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH","CLIENT_STATIC_FILES_RUNTIME_AMP","values","SYSTEM_ENTRYPOINTS","filesForPage","buildManifestPath","ssgManifestPath","emitAsset","sources","RawSource","sort","reduce","a","c","buildManifestName","BUILD_MANIFEST","MIDDLEWARE_BUILD_MANIFEST","apply","hooks","make","tap","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_ADDITIONS"],"mappings":";;;;;;;;;;;;;;;;;;;IA4KA,iFAAiF;IACjF,+GAA+G;IAC/G,OA0LC;eA1LoBA;;IA7ELC,sBAAsB;eAAtBA;;IAoDAC,kBAAkB;eAAlBA;;IAtEAC,iCAAiC;eAAjCA;;IAkFHC,YAAY;eAAZA;;IAlIAC,mBAAmB;eAAnBA;;;gEA7BO;yBACa;2BAW1B;+EAE4B;0CACG;uBACN;iCACV;uBACD;;;;;;AAWd,MAAMA,sBAAsB,CAAC,4EAA4E,CAAC;AAEjH,+CAA+C;AAC/C,SAASC,2BAA2BC,QAAgB,EAAEC,OAA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,YAAY2E,SAAS,CACnB,GAAGlG,mCAAwB,CAAC,CAAC,EAAE,IAAI,CAACD,OAAO,CAAC,kBAAkB,CAAC,EAC/D,IAAIoG,gBAAO,CAACC,SAAS,CACnB,CAAC,wBAAwB,EAAE5G,uBACzBY,UACA,IAAI,CAACa,QAAQ,EACb,IAAI,CAACI,mBAAmB,EACxBC,UACAC,aACA,uDAAuD,CAAC;YAGhE;QACF;IACF;IAEAqF,MAAMtF,QAA0B,EAAE;QAChCA,SAASuF,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,uBAAuB,CAACxF;YAC9CA,YAAYsF,KAAK,CAACG,aAAa,CAACD,GAAG,CACjC;gBACEnF,MAAM;gBACNqF,OAAOC,gBAAO,CAACC,WAAW,CAACC,8BAA8B;YAC3D,GACA;gBACE,IAAI,CAAClD,YAAY,CAAC5C,UAAUC;YAC9B;QAEJ;QACA;IACF;AACF"}
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin.ts"],"sourcesContent":["import type { BloomFilter } from '../../../shared/lib/bloom-filter'\nimport type { Rewrite, CustomRoutes } from '../../../lib/load-custom-routes'\nimport devalue from 'next/dist/compiled/devalue'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n BUILD_MANIFEST,\n MIDDLEWARE_BUILD_MANIFEST,\n CLIENT_STATIC_FILES_PATH,\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n SYSTEM_ENTRYPOINTS,\n} from '../../../shared/lib/constants'\nimport type { BuildManifest } from '../../../server/get-page-files'\nimport getRouteFromEntrypoint from '../../../server/get-route-from-entrypoint'\nimport { ampFirstEntryNamesMap } from './next-drop-client-page-plugin'\nimport { getSortedRoutes } from '../../../shared/lib/router/utils'\nimport { spans as webpackSpans } from './profiling-plugin'\nimport { compilationSpans as rspackSpans } from './rspack-profiling-plugin'\nimport { Span } from '../../../trace'\n\nconst compilationSpans = process.env.NEXT_RSPACK ? rspackSpans : webpackSpans\n\ntype DeepMutable<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> }\n\nexport type ClientBuildManifest = {\n [key: string]: string[]\n}\n\n// Add the runtime ssg manifest file as a lazy-loaded file dependency.\n// We also stub this file out for development mode (when it is not\n// generated).\nexport const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`\n\n// nodejs: '/static/<build id>/low-priority.js'\nfunction buildNodejsLowPriorityPath(filename: string, buildId: string) {\n return `${CLIENT_STATIC_FILES_PATH}/${buildId}/${filename}`\n}\n\nfunction createEdgeRuntimeManifest(originAssetMap: BuildManifest): string {\n const manifestFilenames = ['_buildManifest.js', '_ssgManifest.js']\n\n const assetMap: BuildManifest = {\n ...originAssetMap,\n lowPriorityFiles: [],\n }\n\n // we use globalThis here because middleware can be node\n // which doesn't have \"self\"\n const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(\n assetMap,\n null,\n 2\n )};\\n`\n // edge lowPriorityFiles item: '\"/static/\" + process.env.__NEXT_BUILD_ID + \"/low-priority.js\"'.\n // Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.\n const lowPriorityFilesCode =\n `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\\n` +\n manifestFilenames\n .map((filename) => {\n return `\"/static/\" + process.env.__NEXT_BUILD_ID + \"/${filename}\",\\n`\n })\n .join(',') +\n `\\n];`\n\n return manifestDefCode + lowPriorityFilesCode\n}\n\nfunction normalizeRewrite(item: {\n source: string\n destination: string\n has?: any\n}): CustomRoutes['rewrites']['beforeFiles'][0] {\n return {\n has: item.has,\n source: item.source,\n destination: item.destination,\n }\n}\n\nexport function normalizeRewritesForBuildManifest(\n rewrites: CustomRoutes['rewrites']\n): CustomRoutes['rewrites'] {\n return {\n afterFiles: rewrites.afterFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n beforeFiles: rewrites.beforeFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n fallback: rewrites.fallback\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n }\n}\n\n// This function takes the asset map generated in BuildManifestPlugin and creates a\n// reduced version to send to the client.\nexport function generateClientManifest(\n assetMap: BuildManifest,\n rewrites: CustomRoutes['rewrites'],\n clientRouterFilters?: {\n staticFilter: ReturnType<BloomFilter['export']>\n dynamicFilter: ReturnType<BloomFilter['export']>\n },\n compiler?: any,\n compilation?: any\n): string | undefined {\n const compilationSpan = compilation\n ? compilationSpans.get(compilation)\n : compiler\n ? compilationSpans.get(compiler)\n : new Span({ name: 'client-manifest' })\n\n const genClientManifestSpan = compilationSpan?.traceChild(\n 'NextJsBuildManifest-generateClientManifest'\n )\n\n return genClientManifestSpan?.traceFn(() => {\n const clientManifest: ClientBuildManifest = {\n __rewrites: normalizeRewritesForBuildManifest(rewrites) as any,\n __routerFilterStatic: clientRouterFilters?.staticFilter as any,\n __routerFilterDynamic: clientRouterFilters?.dynamicFilter as any,\n }\n const appDependencies = new Set(assetMap.pages['/_app'])\n const sortedPageKeys = getSortedRoutes(Object.keys(assetMap.pages))\n\n sortedPageKeys.forEach((page) => {\n const dependencies = assetMap.pages[page]\n\n if (page === '/_app') return\n // Filter out dependencies in the _app entry, because those will have already\n // been loaded by the client prior to a navigation event\n const filteredDeps = dependencies.filter(\n (dep) => !appDependencies.has(dep)\n )\n\n // The manifest can omit the page if it has no requirements\n if (filteredDeps.length) {\n clientManifest[page] = filteredDeps\n }\n })\n // provide the sorted pages as an array so we don't rely on the object's keys\n // being in order and we don't slow down look-up time for page assets\n clientManifest.sortedPages = sortedPageKeys\n\n return devalue(clientManifest)\n })\n}\n\nexport function getEntrypointFiles(entrypoint: any): string[] {\n return (\n entrypoint\n ?.getFiles()\n .filter((file: string) => {\n // We don't want to include `.hot-update.js` files into the initial page\n return /(?<!\\.hot-update)\\.(js|css)($|\\?)/.test(file)\n })\n .map((file: string) => file.replace(/\\\\/g, '/')) ?? []\n )\n}\n\nexport const processRoute = (r: Rewrite) => {\n const rewrite = { ...r }\n\n // omit external rewrite destinations since these aren't\n // handled client-side\n if (!rewrite?.destination?.startsWith('/')) {\n delete (rewrite as any).destination\n }\n return rewrite\n}\n\n// This plugin creates a build-manifest.json for all assets that are being output\n// It has a mapping of \"entry\" filename to real filename. Because the real filename can be hashed in production\nexport default class BuildManifestPlugin {\n private buildId: string\n private rewrites: CustomRoutes['rewrites']\n private isDevFallback: boolean\n private appDirEnabled: boolean\n private clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n\n constructor(options: {\n buildId: string\n rewrites: CustomRoutes['rewrites']\n isDevFallback?: boolean\n appDirEnabled: boolean\n clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n }) {\n this.buildId = options.buildId\n this.isDevFallback = !!options.isDevFallback\n this.rewrites = {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n }\n this.appDirEnabled = options.appDirEnabled\n this.clientRouterFilters = options.clientRouterFilters\n this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute)\n this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute)\n this.rewrites.fallback = options.rewrites.fallback.map(processRoute)\n }\n\n createAssets(compiler: any, compilation: any) {\n const compilationSpan =\n compilationSpans.get(compilation) ?? compilationSpans.get(compiler)\n if (!compilationSpan) {\n throw new Error('No span found for compilation')\n }\n\n const createAssetsSpan = compilationSpan.traceChild(\n 'NextJsBuildManifest-createassets'\n )\n\n return createAssetsSpan.traceFn(() => {\n const entrypoints: Map<string, any> = compilation.entrypoints\n const assetMap: DeepMutable<BuildManifest> = {\n polyfillFiles: [],\n devFiles: [],\n ampDevFiles: [],\n lowPriorityFiles: [],\n rootMainFiles: [],\n rootMainFilesTree: {},\n pages: { '/_app': [] },\n ampFirstPages: [],\n }\n\n const ampFirstEntryNames = ampFirstEntryNamesMap.get(compilation)\n if (ampFirstEntryNames) {\n for (const entryName of ampFirstEntryNames) {\n const pagePath = getRouteFromEntrypoint(entryName)\n if (!pagePath) {\n continue\n }\n\n assetMap.ampFirstPages.push(pagePath)\n }\n }\n\n const mainFiles = new Set(\n getEntrypointFiles(entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN))\n )\n\n if (this.appDirEnabled) {\n assetMap.rootMainFiles = [\n ...new Set(\n getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN_APP)\n )\n ),\n ]\n }\n\n const compilationAssets: {\n name: string\n source: typeof sources.RawSource\n info: object\n }[] = compilation.getAssets()\n\n assetMap.polyfillFiles = compilationAssets\n .filter((p) => {\n // Ensure only .js files are passed through\n if (!p.name.endsWith('.js')) {\n return false\n }\n\n return (\n p.info && CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL in p.info\n )\n })\n .map((v) => v.name)\n\n assetMap.devFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH)\n ).filter((file) => !mainFiles.has(file))\n\n assetMap.ampDevFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_AMP)\n )\n\n for (const entrypoint of compilation.entrypoints.values()) {\n if (SYSTEM_ENTRYPOINTS.has(entrypoint.name)) continue\n const pagePath = getRouteFromEntrypoint(entrypoint.name)\n\n if (!pagePath) {\n continue\n }\n\n const filesForPage = getEntrypointFiles(entrypoint)\n\n assetMap.pages[pagePath] = [...new Set([...mainFiles, ...filesForPage])]\n }\n\n if (!this.isDevFallback) {\n // Add the runtime build manifest file (generated later in this file)\n // as a dependency for the app. If the flag is false, the file won't be\n // downloaded by the client.\n const buildManifestPath = buildNodejsLowPriorityPath(\n '_buildManifest.js',\n this.buildId\n )\n const ssgManifestPath = buildNodejsLowPriorityPath(\n '_ssgManifest.js',\n this.buildId\n )\n assetMap.lowPriorityFiles.push(buildManifestPath, ssgManifestPath)\n compilation.emitAsset(\n ssgManifestPath,\n new sources.RawSource(srcEmptySsgManifest)\n )\n }\n\n assetMap.pages = Object.keys(assetMap.pages)\n .sort()\n .reduce(\n // eslint-disable-next-line\n (a, c) => ((a[c] = assetMap.pages[c]), a),\n {} as typeof assetMap.pages\n )\n\n let buildManifestName = BUILD_MANIFEST\n\n if (this.isDevFallback) {\n buildManifestName = `fallback-${BUILD_MANIFEST}`\n }\n\n compilation.emitAsset(\n buildManifestName,\n new sources.RawSource(JSON.stringify(assetMap, null, 2))\n )\n\n compilation.emitAsset(\n `server/${MIDDLEWARE_BUILD_MANIFEST}.js`,\n new sources.RawSource(`${createEdgeRuntimeManifest(assetMap)}`)\n )\n\n if (!this.isDevFallback) {\n compilation.emitAsset(\n `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`,\n new sources.RawSource(\n `self.__BUILD_MANIFEST = ${generateClientManifest(\n assetMap,\n this.rewrites,\n this.clientRouterFilters,\n compiler,\n compilation\n )};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()`\n )\n )\n }\n })\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.make.tap('NextJsBuildManifest', (compilation: any) => {\n compilation.hooks.processAssets.tap(\n {\n name: 'NextJsBuildManifest',\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n () => {\n this.createAssets(compiler, compilation)\n }\n )\n })\n return\n }\n}\n"],"names":["BuildManifestPlugin","generateClientManifest","getEntrypointFiles","normalizeRewritesForBuildManifest","processRoute","srcEmptySsgManifest","compilationSpans","process","env","NEXT_RSPACK","rspackSpans","webpackSpans","buildNodejsLowPriorityPath","filename","buildId","CLIENT_STATIC_FILES_PATH","createEdgeRuntimeManifest","originAssetMap","manifestFilenames","assetMap","lowPriorityFiles","manifestDefCode","JSON","stringify","lowPriorityFilesCode","map","join","normalizeRewrite","item","has","source","destination","rewrites","afterFiles","beforeFiles","fallback","clientRouterFilters","compiler","compilation","compilationSpan","get","Span","name","genClientManifestSpan","traceChild","traceFn","clientManifest","__rewrites","__routerFilterStatic","staticFilter","__routerFilterDynamic","dynamicFilter","appDependencies","Set","pages","sortedPageKeys","getSortedRoutes","Object","keys","forEach","page","dependencies","filteredDeps","filter","dep","length","sortedPages","devalue","entrypoint","getFiles","file","test","replace","r","rewrite","startsWith","constructor","options","isDevFallback","appDirEnabled","createAssets","Error","createAssetsSpan","entrypoints","polyfillFiles","devFiles","ampDevFiles","rootMainFiles","rootMainFilesTree","ampFirstPages","ampFirstEntryNames","ampFirstEntryNamesMap","entryName","pagePath","getRouteFromEntrypoint","push","mainFiles","CLIENT_STATIC_FILES_RUNTIME_MAIN","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","compilationAssets","getAssets","p","endsWith","info","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL","v","CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH","CLIENT_STATIC_FILES_RUNTIME_AMP","values","SYSTEM_ENTRYPOINTS","filesForPage","buildManifestPath","ssgManifestPath","emitAsset","sources","RawSource","sort","reduce","a","c","buildManifestName","BUILD_MANIFEST","MIDDLEWARE_BUILD_MANIFEST","apply","hooks","make","tap","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_ADDITIONS"],"mappings":";;;;;;;;;;;;;;;;;;;IA+KA,iFAAiF;IACjF,+GAA+G;IAC/G,OAgMC;eAhMoBA;;IA7ELC,sBAAsB;eAAtBA;;IAoDAC,kBAAkB;eAAlBA;;IAtEAC,iCAAiC;eAAjCA;;IAkFHC,YAAY;eAAZA;;IAlIAC,mBAAmB;eAAnBA;;;gEAhCO;yBACa;2BAW1B;+EAE4B;0CACG;uBACN;iCACM;uCACU;uBAC3B;;;;;;AAErB,MAAMC,mBAAmBC,QAAQC,GAAG,CAACC,WAAW,GAAG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,SAAS,CAAC7F,KAAKC,SAAS,CAACJ,UAAU,MAAM;YAGvDmB,YAAY2E,SAAS,CACnB,CAAC,OAAO,EAAES,oCAAyB,CAAC,GAAG,CAAC,EACxC,IAAIR,gBAAO,CAACC,SAAS,CAAC,GAAGnG,0BAA0BG,WAAW;YAGhE,IAAI,CAAC,IAAI,CAAC2D,aAAa,EAAE;gBACvBxC,YAAY2E,SAAS,CACnB,GAAGlG,mCAAwB,CAAC,CAAC,EAAE,IAAI,CAACD,OAAO,CAAC,kBAAkB,CAAC,EAC/D,IAAIoG,gBAAO,CAACC,SAAS,CACnB,CAAC,wBAAwB,EAAElH,uBACzBkB,UACA,IAAI,CAACa,QAAQ,EACb,IAAI,CAACI,mBAAmB,EACxBC,UACAC,aACA,uDAAuD,CAAC;YAGhE;QACF;IACF;IAEAqF,MAAMtF,QAA0B,EAAE;QAChCA,SAASuF,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,uBAAuB,CAACxF;YAC9CA,YAAYsF,KAAK,CAACG,aAAa,CAACD,GAAG,CACjC;gBACEpF,MAAM;gBACNsF,OAAOC,gBAAO,CAACC,WAAW,CAACC,8BAA8B;YAC3D,GACA;gBACE,IAAI,CAACnD,YAAY,CAAC3C,UAAUC;YAC9B;QAEJ;QACA;IACF;AACF"}
|
@@ -77,7 +77,7 @@ export declare class FlightClientEntryPlugin {
|
|
77
77
|
createdActionIds: Set<string>;
|
78
78
|
fromClient?: boolean;
|
79
79
|
}): Promise<any>;
|
80
|
-
addEntry(compilation:
|
80
|
+
addEntry(compilation: webpack.Compilation, context: string, dependency: webpack.Dependency, options: webpack.EntryOptions): Promise<any>;
|
81
81
|
createActionAssets(compilation: webpack.Compilation): Promise<void>;
|
82
82
|
}
|
83
83
|
export {};
|
@@ -601,24 +601,34 @@ class FlightClientEntryPlugin {
|
|
601
601
|
}
|
602
602
|
addEntry(compilation, context, dependency, options) /* Promise<module> */ {
|
603
603
|
return new Promise((resolve, reject)=>{
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
604
|
+
if ('rspack' in compilation.compiler) {
|
605
|
+
compilation.addInclude(context, dependency, options, (err, module)=>{
|
606
|
+
if (err) {
|
607
|
+
return reject(err);
|
608
|
+
}
|
609
|
+
compilation.moduleGraph.getExportsInfo(module).setUsedInUnknownWay(this.isEdgeServer ? _constants1.EDGE_RUNTIME_WEBPACK : _constants1.DEFAULT_RUNTIME_WEBPACK);
|
610
|
+
return resolve(module);
|
611
|
+
});
|
612
|
+
} else {
|
613
|
+
const entry = compilation.entries.get(options.name);
|
614
|
+
entry.includeDependencies.push(dependency);
|
615
|
+
compilation.hooks.addEntry.call(entry, options);
|
616
|
+
compilation.addModuleTree({
|
617
|
+
context,
|
618
|
+
dependency,
|
619
|
+
contextInfo: {
|
620
|
+
issuerLayer: options.layer
|
621
|
+
}
|
622
|
+
}, (err, module)=>{
|
623
|
+
if (err) {
|
624
|
+
compilation.hooks.failedEntry.call(dependency, options, err);
|
625
|
+
return reject(err);
|
626
|
+
}
|
627
|
+
compilation.hooks.succeedEntry.call(dependency, options, module);
|
628
|
+
compilation.moduleGraph.getExportsInfo(module).setUsedInUnknownWay(this.isEdgeServer ? _constants1.EDGE_RUNTIME_WEBPACK : _constants1.DEFAULT_RUNTIME_WEBPACK);
|
629
|
+
return resolve(module);
|
630
|
+
});
|
631
|
+
}
|
622
632
|
});
|
623
633
|
}
|
624
634
|
async createActionAssets(compilation) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/build/webpack/plugins/flight-client-entry-plugin.ts"],"sourcesContent":["import type {\n CssImports,\n ClientComponentImports,\n} from '../loaders/next-flight-client-entry-loader'\n\nimport { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { parse, stringify } from 'querystring'\nimport path from 'path'\nimport { sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n getInvalidator,\n getEntries,\n EntryTypes,\n getEntryKey,\n} from '../../../server/dev/on-demand-entry-handler'\nimport {\n WEBPACK_LAYERS,\n WEBPACK_RESOURCE_QUERIES,\n} from '../../../lib/constants'\nimport {\n APP_CLIENT_INTERNALS,\n BARREL_OPTIMIZATION_PREFIX,\n COMPILER_NAMES,\n DEFAULT_RUNTIME_WEBPACK,\n EDGE_RUNTIME_WEBPACK,\n SERVER_REFERENCE_MANIFEST,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../../../shared/lib/constants'\nimport {\n isClientComponentEntryModule,\n isCSSMod,\n regexCSS,\n} from '../loaders/utils'\nimport {\n traverseModules,\n forEachEntryModule,\n formatBarrelOptimizedResource,\n getModuleReferencesInOrder,\n} from '../utils'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { getProxiedPluginState } from '../../build-context'\nimport { PAGE_TYPES } from '../../../lib/page-types'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getAssumedSourceType } from '../loaders/next-flight-loader'\nimport { isAppRouteRoute } from '../../../lib/is-app-route-route'\nimport { isMetadataRoute } from '../../../lib/metadata/is-metadata-route'\nimport type { MetadataRouteLoaderOptions } from '../loaders/next-metadata-route-loader'\nimport type { FlightActionEntryLoaderActions } from '../loaders/next-flight-action-entry-loader'\n\ninterface Options {\n dev: boolean\n appDir: string\n isEdgeServer: boolean\n encryptionKey: string\n}\n\nconst PLUGIN_NAME = 'FlightClientEntryPlugin'\n\ntype Actions = {\n [actionId: string]: {\n workers: {\n [name: string]: { moduleId: string | number; async: boolean }\n }\n // Record which layer the action is in (rsc or sc_action), in the specific entry.\n layer: {\n [name: string]: string\n }\n }\n}\n\ntype ActionIdNamePair = { id: string; exportedName: string }\n\nexport type ActionManifest = {\n // Assign a unique encryption key during production build.\n encryptionKey: string\n node: Actions\n edge: Actions\n}\n\nexport interface ModuleInfo {\n moduleId: string | number\n async: boolean\n}\n\nconst pluginState = getProxiedPluginState({\n // A map to track \"action\" -> \"list of bundles\".\n serverActions: {} as ActionManifest['node'],\n edgeServerActions: {} as ActionManifest['edge'],\n\n serverActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n edgeServerActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n ssrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n edgeSsrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n\n rscModules: {} as { [rscModuleId: string]: ModuleInfo },\n edgeRscModules: {} as { [rscModuleId: string]: ModuleInfo },\n\n injectedClientEntries: {} as Record<string, string>,\n})\n\nfunction deduplicateCSSImportsForEntry(mergedCSSimports: CssImports) {\n // If multiple entry module connections are having the same CSS import,\n // we only need to have one module to keep track of that CSS import.\n // It is based on the fact that if a page or a layout is rendered in the\n // given entry, all its parent layouts are always rendered too.\n // This can avoid duplicate CSS imports in the generated CSS manifest,\n // for example, if a page and its parent layout are both using the same\n // CSS import, we only need to have the layout to keep track of that CSS\n // import.\n // To achieve this, we need to first collect all the CSS imports from\n // every connection, and deduplicate them in the order of layers from\n // top to bottom. The implementation can be generally described as:\n // - Sort by number of `/` in the request path (the more `/`, the deeper)\n // - When in the same depth, sort by the filename (template < layout < page and others)\n\n // Sort the connections as described above.\n const sortedCSSImports = Object.entries(mergedCSSimports).sort((a, b) => {\n const [aPath] = a\n const [bPath] = b\n\n const aDepth = aPath.split('/').length\n const bDepth = bPath.split('/').length\n\n if (aDepth !== bDepth) {\n return aDepth - bDepth\n }\n\n const aName = path.parse(aPath).name\n const bName = path.parse(bPath).name\n\n const indexA = ['template', 'layout'].indexOf(aName)\n const indexB = ['template', 'layout'].indexOf(bName)\n\n if (indexA === -1) return 1\n if (indexB === -1) return -1\n return indexA - indexB\n })\n\n const dedupedCSSImports: CssImports = {}\n const trackedCSSImports = new Set<string>()\n for (const [entryName, cssImports] of sortedCSSImports) {\n for (const cssImport of cssImports) {\n if (trackedCSSImports.has(cssImport)) continue\n\n // Only track CSS imports that are in files that can inherit CSS.\n const filename = path.parse(entryName).name\n if (['template', 'layout'].includes(filename)) {\n trackedCSSImports.add(cssImport)\n }\n\n if (!dedupedCSSImports[entryName]) {\n dedupedCSSImports[entryName] = []\n }\n dedupedCSSImports[entryName].push(cssImport)\n }\n }\n\n return dedupedCSSImports\n}\n\nexport class FlightClientEntryPlugin {\n dev: boolean\n appDir: string\n encryptionKey: string\n isEdgeServer: boolean\n assetPrefix: string\n webpackRuntime: string\n\n constructor(options: Options) {\n this.dev = options.dev\n this.appDir = options.appDir\n this.isEdgeServer = options.isEdgeServer\n this.assetPrefix = !this.dev && !this.isEdgeServer ? '../' : ''\n this.encryptionKey = options.encryptionKey\n this.webpackRuntime = this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, (compilation) =>\n this.createClientEntries(compiler, compilation)\n )\n\n compiler.hooks.afterCompile.tap(PLUGIN_NAME, (compilation) => {\n const recordModule = (modId: string, mod: any) => {\n // Match Resource is undefined unless an import is using the inline match resource syntax\n // https://webpack.js.org/api/loaders/#inline-matchresource\n const modPath = mod.matchResource || mod.resourceResolveData?.path\n const modQuery = mod.resourceResolveData?.query || ''\n // query is already part of mod.resource\n // so it's only necessary to add it for matchResource or mod.resourceResolveData\n const modResource = modPath\n ? modPath.startsWith(BARREL_OPTIMIZATION_PREFIX)\n ? formatBarrelOptimizedResource(mod.resource, modPath)\n : modPath + modQuery\n : mod.resource\n\n if (typeof modId !== 'undefined' && modResource) {\n if (mod.layer === WEBPACK_LAYERS.reactServerComponents) {\n const key = path\n .relative(compiler.context, modResource)\n .replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeRscModules[key] = moduleInfo\n } else {\n pluginState.rscModules[key] = moduleInfo\n }\n }\n }\n\n if (mod.layer !== WEBPACK_LAYERS.serverSideRendering) {\n return\n }\n\n // Check mod resource to exclude the empty resource module like virtual module created by next-flight-client-entry-loader\n if (typeof modId !== 'undefined' && modResource) {\n // Note that this isn't that reliable as webpack is still possible to assign\n // additional queries to make sure there's no conflict even using the `named`\n // module ID strategy.\n let ssrNamedModuleId = path.relative(compiler.context, modResource)\n\n if (!ssrNamedModuleId.startsWith('.')) {\n // TODO use getModuleId instead\n ssrNamedModuleId = `./${normalizePathSep(ssrNamedModuleId)}`\n }\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeSsrModules[\n ssrNamedModuleId.replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n ] = moduleInfo\n } else {\n pluginState.ssrModules[ssrNamedModuleId] = moduleInfo\n }\n }\n }\n\n traverseModules(compilation, (mod, _chunk, _chunkGroup, modId) => {\n if (modId) recordModule(modId, mod)\n })\n })\n\n compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,\n },\n () => this.createActionAssets(compilation)\n )\n })\n }\n\n async createClientEntries(\n compiler: webpack.Compiler,\n compilation: webpack.Compilation\n ) {\n const addClientEntryAndSSRModulesList: Array<\n ReturnType<typeof this.injectClientEntryAndSSRModules>\n > = []\n const createdSSRDependenciesForEntry: Record<\n string,\n ReturnType<typeof this.injectClientEntryAndSSRModules>[3][]\n > = {}\n\n const addActionEntryList: Array<ReturnType<typeof this.injectActionEntry>> =\n []\n const actionMapsPerEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n const createdActionIds = new Set<string>()\n\n // For each SC server compilation entry, we need to create its corresponding\n // client component entry.\n forEachEntryModule(compilation, ({ name, entryModule }) => {\n const internalClientComponentEntryImports: ClientComponentImports = {}\n const actionEntryImports = new Map<string, ActionIdNamePair[]>()\n const clientEntriesToInject = []\n const mergedCSSimports: CssImports = {}\n\n for (const connection of getModuleReferencesInOrder(\n entryModule,\n compilation.moduleGraph\n )) {\n // Entry can be any user defined entry files such as layout, page, error, loading, etc.\n let entryRequest = (\n connection.dependency as unknown as webpack.NormalModule\n ).request\n\n if (entryRequest.endsWith(WEBPACK_RESOURCE_QUERIES.metadataRoute)) {\n const { filePath, isDynamicRouteExtension } =\n getMetadataRouteResource(entryRequest)\n\n if (isDynamicRouteExtension === '1') {\n entryRequest = filePath\n }\n }\n\n const { clientComponentImports, actionImports, cssImports } =\n this.collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule: connection.resolvedModule,\n })\n\n actionImports.forEach(([dep, actions]) =>\n actionEntryImports.set(dep, actions)\n )\n\n const isAbsoluteRequest = path.isAbsolute(entryRequest)\n\n // Next.js internals are put into a separate entry.\n if (!isAbsoluteRequest) {\n Object.keys(clientComponentImports).forEach(\n (value) => (internalClientComponentEntryImports[value] = new Set())\n )\n continue\n }\n\n // TODO-APP: Enable these lines. This ensures no entrypoint is created for layout/page when there are no client components.\n // Currently disabled because it causes test failures in CI.\n // if (clientImports.length === 0 && actionImports.length === 0) {\n // continue\n // }\n\n const relativeRequest = isAbsoluteRequest\n ? path.relative(compilation.options.context!, entryRequest)\n : entryRequest\n\n // Replace file suffix as `.js` will be added.\n let bundlePath = normalizePathSep(\n relativeRequest.replace(/\\.[^.\\\\/]+$/, '').replace(/^src[\\\\/]/, '')\n )\n\n // For metadata routes, the entry name can be used as the bundle path,\n // as it has been normalized already.\n if (isMetadataRoute(bundlePath)) {\n bundlePath = name\n }\n\n Object.assign(mergedCSSimports, cssImports)\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports,\n bundlePath,\n absolutePagePath: entryRequest,\n })\n\n // The webpack implementation of writing the client reference manifest relies on all entrypoints writing a page.js even when there is no client components in the page.\n // It needs the file in order to write the reference manifest for the path in the `.next/server` folder.\n // TODO-APP: This could be better handled, however Turbopack does not have the same problem as we resolve client components in a single graph.\n if (\n name === `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}` &&\n bundlePath === 'app/not-found'\n ) {\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports: {},\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n absolutePagePath: entryRequest,\n })\n }\n }\n\n // Make sure CSS imports are deduplicated before injecting the client entry\n // and SSR modules.\n const dedupedCSSImports = deduplicateCSSImportsForEntry(mergedCSSimports)\n for (const clientEntryToInject of clientEntriesToInject) {\n const injected = this.injectClientEntryAndSSRModules({\n ...clientEntryToInject,\n clientImports: {\n ...clientEntryToInject.clientComponentImports,\n ...(\n dedupedCSSImports[clientEntryToInject.absolutePagePath] || []\n ).reduce<ClientComponentImports>((res, curr) => {\n res[curr] = new Set()\n return res\n }, {}),\n },\n })\n\n // Track all created SSR dependencies for each entry from the server layer.\n if (!createdSSRDependenciesForEntry[clientEntryToInject.entryName]) {\n createdSSRDependenciesForEntry[clientEntryToInject.entryName] = []\n }\n createdSSRDependenciesForEntry[clientEntryToInject.entryName].push(\n injected[3]\n )\n\n addClientEntryAndSSRModulesList.push(injected)\n }\n\n if (!isAppRouteRoute(name)) {\n // Create internal app\n addClientEntryAndSSRModulesList.push(\n this.injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName: name,\n clientImports: { ...internalClientComponentEntryImports },\n bundlePath: APP_CLIENT_INTERNALS,\n })\n )\n }\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerEntry[name]) {\n actionMapsPerEntry[name] = new Map()\n }\n actionMapsPerEntry[name] = new Map([\n ...actionMapsPerEntry[name],\n ...actionEntryImports,\n ])\n }\n })\n\n for (const [name, actionEntryImports] of Object.entries(\n actionMapsPerEntry\n )) {\n addActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: actionEntryImports,\n entryName: name,\n bundlePath: name,\n createdActionIds,\n })\n )\n }\n\n // Invalidate in development to trigger recompilation\n const invalidator = getInvalidator(compiler.outputPath)\n // Check if any of the entry injections need an invalidation\n if (\n invalidator &&\n addClientEntryAndSSRModulesList.some(\n ([shouldInvalidate]) => shouldInvalidate === true\n )\n ) {\n invalidator.invalidate([COMPILER_NAMES.client])\n }\n\n // Client compiler is invalidated before awaiting the compilation of the SSR\n // and RSC client component entries so that the client compiler is running\n // in parallel to the server compiler.\n await Promise.all(\n addClientEntryAndSSRModulesList.flatMap((addClientEntryAndSSRModules) => [\n addClientEntryAndSSRModules[1],\n addClientEntryAndSSRModules[2],\n ])\n )\n\n // Wait for action entries to be added.\n await Promise.all(addActionEntryList)\n\n const addedClientActionEntryList: Promise<any>[] = []\n const actionMapsPerClientEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n\n // We need to create extra action entries that are created from the\n // client layer.\n // Start from each entry's created SSR dependency from our previous step.\n for (const [name, ssrEntryDependencies] of Object.entries(\n createdSSRDependenciesForEntry\n )) {\n // Collect from all entries, e.g. layout.js, page.js, loading.js, ...\n // add aggregate them.\n const actionEntryImports = this.collectClientActionsFromDependencies({\n compilation,\n dependencies: ssrEntryDependencies,\n })\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerClientEntry[name]) {\n actionMapsPerClientEntry[name] = new Map()\n }\n actionMapsPerClientEntry[name] = new Map([\n ...actionMapsPerClientEntry[name],\n ...actionEntryImports,\n ])\n }\n }\n\n for (const [entryName, actionEntryImports] of Object.entries(\n actionMapsPerClientEntry\n )) {\n // If an action method is already created in the server layer, we don't\n // need to create it again in the action layer.\n // This is to avoid duplicate action instances and make sure the module\n // state is shared.\n let remainingClientImportedActions = false\n const remainingActionEntryImports = new Map<string, ActionIdNamePair[]>()\n for (const [dep, actions] of actionEntryImports) {\n const remainingActionNames = []\n for (const action of actions) {\n if (!createdActionIds.has(entryName + '@' + action.id)) {\n remainingActionNames.push(action)\n }\n }\n if (remainingActionNames.length > 0) {\n remainingActionEntryImports.set(dep, remainingActionNames)\n remainingClientImportedActions = true\n }\n }\n\n if (remainingClientImportedActions) {\n addedClientActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: remainingActionEntryImports,\n entryName,\n bundlePath: entryName,\n fromClient: true,\n createdActionIds,\n })\n )\n }\n }\n\n await Promise.all(addedClientActionEntryList)\n }\n\n collectClientActionsFromDependencies({\n compilation,\n dependencies,\n }: {\n compilation: webpack.Compilation\n dependencies: ReturnType<typeof webpack.EntryPlugin.createDependency>[]\n }) {\n // action file path -> action names\n const collectedActions = new Map<string, ActionIdNamePair[]>()\n\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedModule = new Set<string>()\n const visitedEntry = new Set<string>()\n\n const collectActions = ({\n entryRequest,\n resolvedModule,\n }: {\n entryRequest: string\n resolvedModule: any\n }) => {\n const collectActionsInDep = (mod: webpack.NormalModule): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n\n if (visitedModule.has(modResource)) return\n visitedModule.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n collectedActions.set(\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n }))\n )\n }\n\n // Collect used exported actions transversely.\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n collectActionsInDep(\n connection.resolvedModule as webpack.NormalModule\n )\n }\n )\n }\n\n // Don't traverse the module graph anymore once hitting the action layer.\n if (\n entryRequest &&\n !entryRequest.includes('next-flight-action-entry-loader')\n ) {\n // Traverse the module graph to find all client components.\n collectActionsInDep(resolvedModule)\n }\n }\n\n for (const entryDependency of dependencies) {\n const ssrEntryModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)!\n for (const connection of getModuleReferencesInOrder(\n ssrEntryModule,\n compilation.moduleGraph\n )) {\n const depModule = connection.dependency\n const request = (depModule as unknown as webpack.NormalModule).request\n\n // It is possible that the same entry is added multiple times in the\n // connection graph. We can just skip these to speed up the process.\n if (visitedEntry.has(request)) continue\n visitedEntry.add(request)\n\n collectActions({\n entryRequest: request,\n resolvedModule: connection.resolvedModule,\n })\n }\n }\n\n return collectedActions\n }\n\n collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule,\n }: {\n entryRequest: string\n compilation: webpack.Compilation\n resolvedModule: any /* Dependency */\n }): {\n cssImports: CssImports\n clientComponentImports: ClientComponentImports\n actionImports: [string, ActionIdNamePair[]][]\n } {\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedOfClientComponentsTraverse = new Set()\n\n // Info to collect.\n const clientComponentImports: ClientComponentImports = {}\n const actionImports: [string, ActionIdNamePair[]][] = []\n const CSSImports = new Set<string>()\n\n const filterClientComponents = (\n mod: webpack.NormalModule,\n importedIdentifiers: string[]\n ): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n if (visitedOfClientComponentsTraverse.has(modResource)) {\n if (clientComponentImports[modResource]) {\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n false\n )\n }\n return\n }\n visitedOfClientComponentsTraverse.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n actionImports.push([\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n })),\n ])\n }\n\n if (isCSSMod(mod)) {\n const sideEffectFree =\n mod.factoryMeta && (mod.factoryMeta as any).sideEffectFree\n\n if (sideEffectFree) {\n const unused = !compilation.moduleGraph\n .getExportsInfo(mod)\n .isModuleUsed(this.webpackRuntime)\n\n if (unused) return\n }\n\n CSSImports.add(modResource)\n } else if (isClientComponentEntryModule(mod)) {\n if (!clientComponentImports[modResource]) {\n clientComponentImports[modResource] = new Set()\n }\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n true\n )\n\n return\n }\n\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n let dependencyIds: string[] = []\n\n // `ids` are the identifiers that are imported from the dependency,\n // if it's present, it's an array of strings.\n if (connection.dependency?.ids) {\n dependencyIds.push(...connection.dependency.ids)\n } else {\n dependencyIds = ['*']\n }\n\n filterClientComponents(connection.resolvedModule, dependencyIds)\n }\n )\n }\n\n // Traverse the module graph to find all client components.\n filterClientComponents(resolvedModule, [])\n\n return {\n clientComponentImports,\n cssImports: CSSImports.size\n ? {\n [entryRequest]: Array.from(CSSImports),\n }\n : {},\n actionImports,\n }\n }\n\n injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName,\n clientImports,\n bundlePath,\n absolutePagePath,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n entryName: string\n clientImports: ClientComponentImports\n bundlePath: string\n absolutePagePath?: string\n }): [\n shouldInvalidate: boolean,\n addSSREntryPromise: Promise<void>,\n addRSCEntryPromise: Promise<void>,\n ssrDep: ReturnType<typeof webpack.EntryPlugin.createDependency>,\n ] {\n let shouldInvalidate = false\n\n const modules = Object.keys(clientImports)\n .sort((a, b) => (regexCSS.test(b) ? 1 : a.localeCompare(b)))\n .map((clientImportPath) => ({\n request: clientImportPath,\n ids: [...clientImports[clientImportPath]],\n }))\n\n // For the client entry, we always use the CJS build of Next.js. If the\n // server is using the ESM build (when using the Edge runtime), we need to\n // replace them.\n const clientBrowserLoader = `next-flight-client-entry-loader?${stringify({\n modules: (this.isEdgeServer\n ? modules.map(({ request, ids }) => ({\n request: request.replace(\n /[\\\\/]next[\\\\/]dist[\\\\/]esm[\\\\/]/,\n '/next/dist/'.replace(/\\//g, path.sep)\n ),\n ids,\n }))\n : modules\n ).map((x) => JSON.stringify(x)),\n server: false,\n })}!`\n\n const clientServerLoader = `next-flight-client-entry-loader?${stringify({\n modules: modules.map((x) => JSON.stringify(x)),\n server: true,\n })}!`\n\n // Add for the client compilation\n // Inject the entry to the client compiler.\n if (this.dev) {\n const entries = getEntries(compiler.outputPath)\n const pageKey = getEntryKey(\n COMPILER_NAMES.client,\n PAGE_TYPES.APP,\n bundlePath\n )\n\n if (!entries[pageKey]) {\n entries[pageKey] = {\n type: EntryTypes.CHILD_ENTRY,\n parentEntries: new Set([entryName]),\n absoluteEntryFilePath: absolutePagePath,\n bundlePath,\n request: clientBrowserLoader,\n dispose: false,\n lastActiveTime: Date.now(),\n }\n shouldInvalidate = true\n } else {\n const entryData = entries[pageKey]\n // New version of the client loader\n if (entryData.request !== clientBrowserLoader) {\n entryData.request = clientBrowserLoader\n shouldInvalidate = true\n }\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n entryData.parentEntries.add(entryName)\n }\n entryData.dispose = false\n entryData.lastActiveTime = Date.now()\n }\n } else {\n pluginState.injectedClientEntries[bundlePath] = clientBrowserLoader\n }\n\n const clientComponentSSREntryDep = webpack.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n const clientComponentRSCEntryDep = webpack.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n return [\n shouldInvalidate,\n // Add the entries to the server compiler for the SSR and RSC layers. The\n // promises are awaited later using `Promise.all` in order to parallelize\n // adding the entries.\n this.addEntry(compilation, compiler.context, clientComponentSSREntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.serverSideRendering,\n }),\n this.addEntry(compilation, compiler.context, clientComponentRSCEntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.reactServerComponents,\n }),\n clientComponentSSREntryDep,\n ]\n }\n\n injectActionEntry({\n compiler,\n compilation,\n actions,\n entryName,\n bundlePath,\n fromClient,\n createdActionIds,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n actions: Map<string, ActionIdNamePair[]>\n entryName: string\n bundlePath: string\n createdActionIds: Set<string>\n fromClient?: boolean\n }) {\n const actionsArray = Array.from(actions.entries())\n for (const [, actionsFromModule] of actions) {\n for (const { id } of actionsFromModule) {\n createdActionIds.add(entryName + '@' + id)\n }\n }\n\n if (actionsArray.length === 0) {\n return Promise.resolve()\n }\n\n const actionLoader = `next-flight-action-entry-loader?${stringify({\n actions: JSON.stringify(\n actionsArray satisfies FlightActionEntryLoaderActions\n ),\n __client_imported__: fromClient,\n })}!`\n\n const currentCompilerServerActions = this.isEdgeServer\n ? pluginState.edgeServerActions\n : pluginState.serverActions\n\n for (const [, actionsFromModule] of actionsArray) {\n for (const { id } of actionsFromModule) {\n if (typeof currentCompilerServerActions[id] === 'undefined') {\n currentCompilerServerActions[id] = {\n workers: {},\n layer: {},\n }\n }\n currentCompilerServerActions[id].workers[bundlePath] = {\n moduleId: '', // TODO: What's the meaning of this?\n async: false,\n }\n\n currentCompilerServerActions[id].layer[bundlePath] = fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents\n }\n }\n\n // Inject the entry to the server compiler\n const actionEntryDep = webpack.EntryPlugin.createDependency(actionLoader, {\n name: bundlePath,\n })\n\n return this.addEntry(\n compilation,\n // Reuse compilation context.\n compiler.context,\n actionEntryDep,\n {\n name: entryName,\n layer: fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents,\n }\n )\n }\n\n addEntry(\n compilation: any,\n context: string,\n dependency: webpack.Dependency,\n options: webpack.EntryOptions\n ): Promise<any> /* Promise<module> */ {\n return new Promise((resolve, reject) => {\n const entry = compilation.entries.get(options.name)\n entry.includeDependencies.push(dependency)\n compilation.hooks.addEntry.call(entry, options)\n compilation.addModuleTree(\n {\n context,\n dependency,\n contextInfo: { issuerLayer: options.layer },\n },\n (err: Error | undefined, module: any) => {\n if (err) {\n compilation.hooks.failedEntry.call(dependency, options, err)\n return reject(err)\n }\n\n compilation.hooks.succeedEntry.call(dependency, options, module)\n\n compilation.moduleGraph\n .getExportsInfo(module)\n .setUsedInUnknownWay(\n this.isEdgeServer ? EDGE_RUNTIME_WEBPACK : DEFAULT_RUNTIME_WEBPACK\n )\n\n return resolve(module)\n }\n )\n })\n }\n\n async createActionAssets(compilation: webpack.Compilation) {\n const serverActions: ActionManifest['node'] = {}\n const edgeServerActions: ActionManifest['edge'] = {}\n\n traverseModules(compilation, (mod, _chunk, chunkGroup, modId) => {\n // Go through all action entries and record the module ID for each entry.\n if (\n chunkGroup.name &&\n mod.request &&\n modId &&\n /next-flight-action-entry-loader/.test(mod.request)\n ) {\n const fromClient = /&__client_imported__=true/.test(mod.request)\n\n const mapping = this.isEdgeServer\n ? pluginState.edgeServerActionModules\n : pluginState.serverActionModules\n\n if (!mapping[chunkGroup.name]) {\n mapping[chunkGroup.name] = {}\n }\n mapping[chunkGroup.name][fromClient ? 'client' : 'server'] = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n }\n })\n\n for (let id in pluginState.serverActions) {\n const action = pluginState.serverActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.serverActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n serverActions[id] = action\n }\n\n for (let id in pluginState.edgeServerActions) {\n const action = pluginState.edgeServerActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.edgeServerActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n edgeServerActions[id] = action\n }\n\n const serverManifest = {\n node: serverActions,\n edge: edgeServerActions,\n encryptionKey: this.encryptionKey,\n }\n const edgeServerManifest = {\n ...serverManifest,\n encryptionKey: 'process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY',\n }\n\n const json = JSON.stringify(serverManifest, null, this.dev ? 2 : undefined)\n const edgeJson = JSON.stringify(\n edgeServerManifest,\n null,\n this.dev ? 2 : undefined\n )\n\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.js`,\n new sources.RawSource(\n `self.__RSC_SERVER_MANIFEST=${JSON.stringify(edgeJson)}`\n ) as unknown as webpack.sources.RawSource\n )\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.json`,\n new sources.RawSource(json) as unknown as webpack.sources.RawSource\n )\n }\n}\n\nfunction addClientImport(\n mod: webpack.NormalModule,\n modRequest: string,\n clientComponentImports: ClientComponentImports,\n importedIdentifiers: string[],\n isFirstVisitModule: boolean\n) {\n const clientEntryType = getModuleBuildInfo(mod).rsc?.clientEntryType\n const isCjsModule = clientEntryType === 'cjs'\n const assumedSourceType = getAssumedSourceType(\n mod,\n isCjsModule ? 'commonjs' : 'auto'\n )\n\n const clientImportsSet = clientComponentImports[modRequest]\n\n if (importedIdentifiers[0] === '*') {\n // If there's collected import path with named import identifiers,\n // or there's nothing in collected imports are empty.\n // we should include the whole module.\n if (!isFirstVisitModule && [...clientImportsSet][0] !== '*') {\n clientComponentImports[modRequest] = new Set(['*'])\n }\n } else {\n const isAutoModuleSourceType = assumedSourceType === 'auto'\n if (isAutoModuleSourceType) {\n clientComponentImports[modRequest] = new Set(['*'])\n } else {\n // If it's not analyzed as named ESM exports, e.g. if it's mixing `export *` with named exports,\n // We'll include all modules since it's not able to do tree-shaking.\n for (const name of importedIdentifiers) {\n // For cjs module default import, we include the whole module since\n const isCjsDefaultImport = isCjsModule && name === 'default'\n\n // Always include __esModule along with cjs module default export,\n // to make sure it work with client module proxy from React.\n if (isCjsDefaultImport) {\n clientComponentImports[modRequest].add('__esModule')\n }\n\n clientComponentImports[modRequest].add(name)\n }\n }\n }\n}\n\nfunction getModuleResource(mod: webpack.NormalModule): string {\n const modPath: string = mod.resourceResolveData?.path || ''\n const modQuery = mod.resourceResolveData?.query || ''\n // We have to always use the resolved request here to make sure the\n // server and client are using the same module path (required by RSC), as\n // the server compiler and client compiler have different resolve configs.\n let modResource: string = modPath + modQuery\n\n // Context modules don't have a resource path, we use the identifier instead.\n if (mod.constructor.name === 'ContextModule') {\n modResource = mod.identifier()\n }\n\n // For the barrel optimization, we need to use the match resource instead\n // because there will be 2 modules for the same file (same resource path)\n // but they're different modules and can't be deduped via `visitedModule`.\n // The first module is a virtual re-export module created by the loader.\n if (mod.matchResource?.startsWith(BARREL_OPTIMIZATION_PREFIX)) {\n modResource = mod.matchResource + ':' + modResource\n }\n\n if (mod.resource === `?${WEBPACK_RESOURCE_QUERIES.metadataRoute}`) {\n return getMetadataRouteResource(mod.rawRequest).filePath\n }\n\n return modResource\n}\n\nfunction getMetadataRouteResource(request: string): MetadataRouteLoaderOptions {\n // e.g. next-metadata-route-loader?filePath=<some-url-encoded-path>&isDynamicRouteExtension=1!?__next_metadata_route__\n const query = request.split('!')[0].split('next-metadata-route-loader?')[1]\n\n return parse(query) as MetadataRouteLoaderOptions\n}\n"],"names":["FlightClientEntryPlugin","PLUGIN_NAME","pluginState","getProxiedPluginState","serverActions","edgeServerActions","serverActionModules","edgeServerActionModules","ssrModules","edgeSsrModules","rscModules","edgeRscModules","injectedClientEntries","deduplicateCSSImportsForEntry","mergedCSSimports","sortedCSSImports","Object","entries","sort","a","b","aPath","bPath","aDepth","split","length","bDepth","aName","path","parse","name","bName","indexA","indexOf","indexB","dedupedCSSImports","trackedCSSImports","Set","entryName","cssImports","cssImport","has","filename","includes","add","push","constructor","options","dev","appDir","isEdgeServer","assetPrefix","encryptionKey","webpackRuntime","EDGE_RUNTIME_WEBPACK","DEFAULT_RUNTIME_WEBPACK","apply","compiler","hooks","finishMake","tapPromise","compilation","createClientEntries","afterCompile","tap","recordModule","modId","mod","modPath","matchResource","resourceResolveData","modQuery","query","modResource","startsWith","BARREL_OPTIMIZATION_PREFIX","formatBarrelOptimizedResource","resource","layer","WEBPACK_LAYERS","reactServerComponents","key","relative","context","replace","moduleInfo","moduleId","async","moduleGraph","isAsync","serverSideRendering","ssrNamedModuleId","normalizePathSep","traverseModules","_chunk","_chunkGroup","make","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_HASH","createActionAssets","addClientEntryAndSSRModulesList","createdSSRDependenciesForEntry","addActionEntryList","actionMapsPerEntry","createdActionIds","forEachEntryModule","entryModule","internalClientComponentEntryImports","actionEntryImports","Map","clientEntriesToInject","connection","getModuleReferencesInOrder","entryRequest","dependency","request","endsWith","WEBPACK_RESOURCE_QUERIES","metadataRoute","filePath","isDynamicRouteExtension","getMetadataRouteResource","clientComponentImports","actionImports","collectComponentInfoFromServerEntryDependency","resolvedModule","forEach","dep","actions","set","isAbsoluteRequest","isAbsolute","keys","value","relativeRequest","bundlePath","isMetadataRoute","assign","absolutePagePath","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","clientEntryToInject","injected","injectClientEntryAndSSRModules","clientImports","reduce","res","curr","isAppRouteRoute","APP_CLIENT_INTERNALS","size","injectActionEntry","invalidator","getInvalidator","outputPath","some","shouldInvalidate","invalidate","COMPILER_NAMES","client","Promise","all","flatMap","addClientEntryAndSSRModules","addedClientActionEntryList","actionMapsPerClientEntry","ssrEntryDependencies","collectClientActionsFromDependencies","dependencies","remainingClientImportedActions","remainingActionEntryImports","remainingActionNames","action","id","fromClient","collectedActions","visitedModule","visitedEntry","collectActions","collectActionsInDep","getModuleBuildInfo","getModuleResource","actionIds","rsc","map","exportedName","entryDependency","ssrEntryModule","getResolvedModule","depModule","visitedOfClientComponentsTraverse","CSSImports","filterClientComponents","importedIdentifiers","addClientImport","isCSSMod","sideEffectFree","factoryMeta","unused","getExportsInfo","isModuleUsed","isClientComponentEntryModule","dependencyIds","ids","Array","from","modules","regexCSS","test","localeCompare","clientImportPath","clientBrowserLoader","stringify","sep","x","JSON","server","clientServerLoader","getEntries","pageKey","getEntryKey","PAGE_TYPES","APP","type","EntryTypes","CHILD_ENTRY","parentEntries","absoluteEntryFilePath","dispose","lastActiveTime","Date","now","entryData","clientComponentSSREntryDep","EntryPlugin","createDependency","clientComponentRSCEntryDep","addEntry","actionsArray","actionsFromModule","resolve","actionLoader","__client_imported__","currentCompilerServerActions","workers","actionBrowser","actionEntryDep","reject","entry","get","includeDependencies","call","addModuleTree","contextInfo","issuerLayer","err","module","failedEntry","succeedEntry","setUsedInUnknownWay","chunkGroup","mapping","serverManifest","node","edge","edgeServerManifest","json","undefined","edgeJson","emitAsset","SERVER_REFERENCE_MANIFEST","sources","RawSource","modRequest","isFirstVisitModule","clientEntryType","isCjsModule","assumedSourceType","getAssumedSourceType","clientImportsSet","isAutoModuleSourceType","isCjsDefaultImport","identifier","rawRequest"],"mappings":";;;;+BAsKaA;;;eAAAA;;;yBAjKW;6BACS;6DAChB;sCAOV;2BAIA;4BASA;uBAKA;wBAMA;kCAC0B;8BACK;2BACX;oCACQ;kCACE;iCACL;iCACA;;;;;;AAWhC,MAAMC,cAAc;AA4BpB,MAAMC,cAAcC,IAAAA,mCAAqB,EAAC;IACxC,gDAAgD;IAChDC,eAAe,CAAC;IAChBC,mBAAmB,CAAC;IAEpBC,qBAAqB,CAAC;IAItBC,yBAAyB,CAAC;IAI1BC,YAAY,CAAC;IACbC,gBAAgB,CAAC;IAEjBC,YAAY,CAAC;IACbC,gBAAgB,CAAC;IAEjBC,uBAAuB,CAAC;AAC1B;AAEA,SAASC,8BAA8BC,gBAA4B;IACjE,uEAAuE;IACvE,oEAAoE;IACpE,wEAAwE;IACxE,+DAA+D;IAC/D,sEAAsE;IACtE,uEAAuE;IACvE,wEAAwE;IACxE,UAAU;IACV,qEAAqE;IACrE,qEAAqE;IACrE,mEAAmE;IACnE,yEAAyE;IACzE,uFAAuF;IAEvF,2CAA2C;IAC3C,MAAMC,mBAAmBC,OAAOC,OAAO,CAACH,kBAAkBI,IAAI,CAAC,CAACC,GAAGC;QACjE,MAAM,CAACC,MAAM,GAAGF;QAChB,MAAM,CAACG,MAAM,GAAGF;QAEhB,MAAMG,SAASF,MAAMG,KAAK,CAAC,KAAKC,MAAM;QACtC,MAAMC,SAASJ,MAAME,KAAK,CAAC,KAAKC,MAA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AAC2C;AACf"}
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/flight-client-entry-plugin.ts"],"sourcesContent":["import type {\n CssImports,\n ClientComponentImports,\n} from '../loaders/next-flight-client-entry-loader'\n\nimport { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { parse, stringify } from 'querystring'\nimport path from 'path'\nimport { sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n getInvalidator,\n getEntries,\n EntryTypes,\n getEntryKey,\n} from '../../../server/dev/on-demand-entry-handler'\nimport {\n WEBPACK_LAYERS,\n WEBPACK_RESOURCE_QUERIES,\n} from '../../../lib/constants'\nimport {\n APP_CLIENT_INTERNALS,\n BARREL_OPTIMIZATION_PREFIX,\n COMPILER_NAMES,\n DEFAULT_RUNTIME_WEBPACK,\n EDGE_RUNTIME_WEBPACK,\n SERVER_REFERENCE_MANIFEST,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../../../shared/lib/constants'\nimport {\n isClientComponentEntryModule,\n isCSSMod,\n regexCSS,\n} from '../loaders/utils'\nimport {\n traverseModules,\n forEachEntryModule,\n formatBarrelOptimizedResource,\n getModuleReferencesInOrder,\n} from '../utils'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { getProxiedPluginState } from '../../build-context'\nimport { PAGE_TYPES } from '../../../lib/page-types'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getAssumedSourceType } from '../loaders/next-flight-loader'\nimport { isAppRouteRoute } from '../../../lib/is-app-route-route'\nimport { isMetadataRoute } from '../../../lib/metadata/is-metadata-route'\nimport type { MetadataRouteLoaderOptions } from '../loaders/next-metadata-route-loader'\nimport type { FlightActionEntryLoaderActions } from '../loaders/next-flight-action-entry-loader'\n\ninterface Options {\n dev: boolean\n appDir: string\n isEdgeServer: boolean\n encryptionKey: string\n}\n\nconst PLUGIN_NAME = 'FlightClientEntryPlugin'\n\ntype Actions = {\n [actionId: string]: {\n workers: {\n [name: string]: { moduleId: string | number; async: boolean }\n }\n // Record which layer the action is in (rsc or sc_action), in the specific entry.\n layer: {\n [name: string]: string\n }\n }\n}\n\ntype ActionIdNamePair = { id: string; exportedName: string }\n\nexport type ActionManifest = {\n // Assign a unique encryption key during production build.\n encryptionKey: string\n node: Actions\n edge: Actions\n}\n\nexport interface ModuleInfo {\n moduleId: string | number\n async: boolean\n}\n\nconst pluginState = getProxiedPluginState({\n // A map to track \"action\" -> \"list of bundles\".\n serverActions: {} as ActionManifest['node'],\n edgeServerActions: {} as ActionManifest['edge'],\n\n serverActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n edgeServerActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n ssrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n edgeSsrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n\n rscModules: {} as { [rscModuleId: string]: ModuleInfo },\n edgeRscModules: {} as { [rscModuleId: string]: ModuleInfo },\n\n injectedClientEntries: {} as Record<string, string>,\n})\n\nfunction deduplicateCSSImportsForEntry(mergedCSSimports: CssImports) {\n // If multiple entry module connections are having the same CSS import,\n // we only need to have one module to keep track of that CSS import.\n // It is based on the fact that if a page or a layout is rendered in the\n // given entry, all its parent layouts are always rendered too.\n // This can avoid duplicate CSS imports in the generated CSS manifest,\n // for example, if a page and its parent layout are both using the same\n // CSS import, we only need to have the layout to keep track of that CSS\n // import.\n // To achieve this, we need to first collect all the CSS imports from\n // every connection, and deduplicate them in the order of layers from\n // top to bottom. The implementation can be generally described as:\n // - Sort by number of `/` in the request path (the more `/`, the deeper)\n // - When in the same depth, sort by the filename (template < layout < page and others)\n\n // Sort the connections as described above.\n const sortedCSSImports = Object.entries(mergedCSSimports).sort((a, b) => {\n const [aPath] = a\n const [bPath] = b\n\n const aDepth = aPath.split('/').length\n const bDepth = bPath.split('/').length\n\n if (aDepth !== bDepth) {\n return aDepth - bDepth\n }\n\n const aName = path.parse(aPath).name\n const bName = path.parse(bPath).name\n\n const indexA = ['template', 'layout'].indexOf(aName)\n const indexB = ['template', 'layout'].indexOf(bName)\n\n if (indexA === -1) return 1\n if (indexB === -1) return -1\n return indexA - indexB\n })\n\n const dedupedCSSImports: CssImports = {}\n const trackedCSSImports = new Set<string>()\n for (const [entryName, cssImports] of sortedCSSImports) {\n for (const cssImport of cssImports) {\n if (trackedCSSImports.has(cssImport)) continue\n\n // Only track CSS imports that are in files that can inherit CSS.\n const filename = path.parse(entryName).name\n if (['template', 'layout'].includes(filename)) {\n trackedCSSImports.add(cssImport)\n }\n\n if (!dedupedCSSImports[entryName]) {\n dedupedCSSImports[entryName] = []\n }\n dedupedCSSImports[entryName].push(cssImport)\n }\n }\n\n return dedupedCSSImports\n}\n\nexport class FlightClientEntryPlugin {\n dev: boolean\n appDir: string\n encryptionKey: string\n isEdgeServer: boolean\n assetPrefix: string\n webpackRuntime: string\n\n constructor(options: Options) {\n this.dev = options.dev\n this.appDir = options.appDir\n this.isEdgeServer = options.isEdgeServer\n this.assetPrefix = !this.dev && !this.isEdgeServer ? '../' : ''\n this.encryptionKey = options.encryptionKey\n this.webpackRuntime = this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, (compilation) =>\n this.createClientEntries(compiler, compilation)\n )\n\n compiler.hooks.afterCompile.tap(PLUGIN_NAME, (compilation) => {\n const recordModule = (modId: string, mod: any) => {\n // Match Resource is undefined unless an import is using the inline match resource syntax\n // https://webpack.js.org/api/loaders/#inline-matchresource\n const modPath = mod.matchResource || mod.resourceResolveData?.path\n const modQuery = mod.resourceResolveData?.query || ''\n // query is already part of mod.resource\n // so it's only necessary to add it for matchResource or mod.resourceResolveData\n const modResource = modPath\n ? modPath.startsWith(BARREL_OPTIMIZATION_PREFIX)\n ? formatBarrelOptimizedResource(mod.resource, modPath)\n : modPath + modQuery\n : mod.resource\n\n if (typeof modId !== 'undefined' && modResource) {\n if (mod.layer === WEBPACK_LAYERS.reactServerComponents) {\n const key = path\n .relative(compiler.context, modResource)\n .replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeRscModules[key] = moduleInfo\n } else {\n pluginState.rscModules[key] = moduleInfo\n }\n }\n }\n\n if (mod.layer !== WEBPACK_LAYERS.serverSideRendering) {\n return\n }\n\n // Check mod resource to exclude the empty resource module like virtual module created by next-flight-client-entry-loader\n if (typeof modId !== 'undefined' && modResource) {\n // Note that this isn't that reliable as webpack is still possible to assign\n // additional queries to make sure there's no conflict even using the `named`\n // module ID strategy.\n let ssrNamedModuleId = path.relative(compiler.context, modResource)\n\n if (!ssrNamedModuleId.startsWith('.')) {\n // TODO use getModuleId instead\n ssrNamedModuleId = `./${normalizePathSep(ssrNamedModuleId)}`\n }\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeSsrModules[\n ssrNamedModuleId.replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n ] = moduleInfo\n } else {\n pluginState.ssrModules[ssrNamedModuleId] = moduleInfo\n }\n }\n }\n\n traverseModules(compilation, (mod, _chunk, _chunkGroup, modId) => {\n if (modId) recordModule(modId, mod)\n })\n })\n\n compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,\n },\n () => this.createActionAssets(compilation)\n )\n })\n }\n\n async createClientEntries(\n compiler: webpack.Compiler,\n compilation: webpack.Compilation\n ) {\n const addClientEntryAndSSRModulesList: Array<\n ReturnType<typeof this.injectClientEntryAndSSRModules>\n > = []\n const createdSSRDependenciesForEntry: Record<\n string,\n ReturnType<typeof this.injectClientEntryAndSSRModules>[3][]\n > = {}\n\n const addActionEntryList: Array<ReturnType<typeof this.injectActionEntry>> =\n []\n const actionMapsPerEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n const createdActionIds = new Set<string>()\n\n // For each SC server compilation entry, we need to create its corresponding\n // client component entry.\n forEachEntryModule(compilation, ({ name, entryModule }) => {\n const internalClientComponentEntryImports: ClientComponentImports = {}\n const actionEntryImports = new Map<string, ActionIdNamePair[]>()\n const clientEntriesToInject = []\n const mergedCSSimports: CssImports = {}\n\n for (const connection of getModuleReferencesInOrder(\n entryModule,\n compilation.moduleGraph\n )) {\n // Entry can be any user defined entry files such as layout, page, error, loading, etc.\n let entryRequest = (\n connection.dependency as unknown as webpack.NormalModule\n ).request\n\n if (entryRequest.endsWith(WEBPACK_RESOURCE_QUERIES.metadataRoute)) {\n const { filePath, isDynamicRouteExtension } =\n getMetadataRouteResource(entryRequest)\n\n if (isDynamicRouteExtension === '1') {\n entryRequest = filePath\n }\n }\n\n const { clientComponentImports, actionImports, cssImports } =\n this.collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule: connection.resolvedModule,\n })\n\n actionImports.forEach(([dep, actions]) =>\n actionEntryImports.set(dep, actions)\n )\n\n const isAbsoluteRequest = path.isAbsolute(entryRequest)\n\n // Next.js internals are put into a separate entry.\n if (!isAbsoluteRequest) {\n Object.keys(clientComponentImports).forEach(\n (value) => (internalClientComponentEntryImports[value] = new Set())\n )\n continue\n }\n\n // TODO-APP: Enable these lines. This ensures no entrypoint is created for layout/page when there are no client components.\n // Currently disabled because it causes test failures in CI.\n // if (clientImports.length === 0 && actionImports.length === 0) {\n // continue\n // }\n\n const relativeRequest = isAbsoluteRequest\n ? path.relative(compilation.options.context!, entryRequest)\n : entryRequest\n\n // Replace file suffix as `.js` will be added.\n let bundlePath = normalizePathSep(\n relativeRequest.replace(/\\.[^.\\\\/]+$/, '').replace(/^src[\\\\/]/, '')\n )\n\n // For metadata routes, the entry name can be used as the bundle path,\n // as it has been normalized already.\n if (isMetadataRoute(bundlePath)) {\n bundlePath = name\n }\n\n Object.assign(mergedCSSimports, cssImports)\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports,\n bundlePath,\n absolutePagePath: entryRequest,\n })\n\n // The webpack implementation of writing the client reference manifest relies on all entrypoints writing a page.js even when there is no client components in the page.\n // It needs the file in order to write the reference manifest for the path in the `.next/server` folder.\n // TODO-APP: This could be better handled, however Turbopack does not have the same problem as we resolve client components in a single graph.\n if (\n name === `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}` &&\n bundlePath === 'app/not-found'\n ) {\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports: {},\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n absolutePagePath: entryRequest,\n })\n }\n }\n\n // Make sure CSS imports are deduplicated before injecting the client entry\n // and SSR modules.\n const dedupedCSSImports = deduplicateCSSImportsForEntry(mergedCSSimports)\n for (const clientEntryToInject of clientEntriesToInject) {\n const injected = this.injectClientEntryAndSSRModules({\n ...clientEntryToInject,\n clientImports: {\n ...clientEntryToInject.clientComponentImports,\n ...(\n dedupedCSSImports[clientEntryToInject.absolutePagePath] || []\n ).reduce<ClientComponentImports>((res, curr) => {\n res[curr] = new Set()\n return res\n }, {}),\n },\n })\n\n // Track all created SSR dependencies for each entry from the server layer.\n if (!createdSSRDependenciesForEntry[clientEntryToInject.entryName]) {\n createdSSRDependenciesForEntry[clientEntryToInject.entryName] = []\n }\n createdSSRDependenciesForEntry[clientEntryToInject.entryName].push(\n injected[3]\n )\n\n addClientEntryAndSSRModulesList.push(injected)\n }\n\n if (!isAppRouteRoute(name)) {\n // Create internal app\n addClientEntryAndSSRModulesList.push(\n this.injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName: name,\n clientImports: { ...internalClientComponentEntryImports },\n bundlePath: APP_CLIENT_INTERNALS,\n })\n )\n }\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerEntry[name]) {\n actionMapsPerEntry[name] = new Map()\n }\n actionMapsPerEntry[name] = new Map([\n ...actionMapsPerEntry[name],\n ...actionEntryImports,\n ])\n }\n })\n\n for (const [name, actionEntryImports] of Object.entries(\n actionMapsPerEntry\n )) {\n addActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: actionEntryImports,\n entryName: name,\n bundlePath: name,\n createdActionIds,\n })\n )\n }\n\n // Invalidate in development to trigger recompilation\n const invalidator = getInvalidator(compiler.outputPath)\n // Check if any of the entry injections need an invalidation\n if (\n invalidator &&\n addClientEntryAndSSRModulesList.some(\n ([shouldInvalidate]) => shouldInvalidate === true\n )\n ) {\n invalidator.invalidate([COMPILER_NAMES.client])\n }\n\n // Client compiler is invalidated before awaiting the compilation of the SSR\n // and RSC client component entries so that the client compiler is running\n // in parallel to the server compiler.\n await Promise.all(\n addClientEntryAndSSRModulesList.flatMap((addClientEntryAndSSRModules) => [\n addClientEntryAndSSRModules[1],\n addClientEntryAndSSRModules[2],\n ])\n )\n\n // Wait for action entries to be added.\n await Promise.all(addActionEntryList)\n\n const addedClientActionEntryList: Promise<any>[] = []\n const actionMapsPerClientEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n\n // We need to create extra action entries that are created from the\n // client layer.\n // Start from each entry's created SSR dependency from our previous step.\n for (const [name, ssrEntryDependencies] of Object.entries(\n createdSSRDependenciesForEntry\n )) {\n // Collect from all entries, e.g. layout.js, page.js, loading.js, ...\n // add aggregate them.\n const actionEntryImports = this.collectClientActionsFromDependencies({\n compilation,\n dependencies: ssrEntryDependencies,\n })\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerClientEntry[name]) {\n actionMapsPerClientEntry[name] = new Map()\n }\n actionMapsPerClientEntry[name] = new Map([\n ...actionMapsPerClientEntry[name],\n ...actionEntryImports,\n ])\n }\n }\n\n for (const [entryName, actionEntryImports] of Object.entries(\n actionMapsPerClientEntry\n )) {\n // If an action method is already created in the server layer, we don't\n // need to create it again in the action layer.\n // This is to avoid duplicate action instances and make sure the module\n // state is shared.\n let remainingClientImportedActions = false\n const remainingActionEntryImports = new Map<string, ActionIdNamePair[]>()\n for (const [dep, actions] of actionEntryImports) {\n const remainingActionNames = []\n for (const action of actions) {\n if (!createdActionIds.has(entryName + '@' + action.id)) {\n remainingActionNames.push(action)\n }\n }\n if (remainingActionNames.length > 0) {\n remainingActionEntryImports.set(dep, remainingActionNames)\n remainingClientImportedActions = true\n }\n }\n\n if (remainingClientImportedActions) {\n addedClientActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: remainingActionEntryImports,\n entryName,\n bundlePath: entryName,\n fromClient: true,\n createdActionIds,\n })\n )\n }\n }\n\n await Promise.all(addedClientActionEntryList)\n }\n\n collectClientActionsFromDependencies({\n compilation,\n dependencies,\n }: {\n compilation: webpack.Compilation\n dependencies: ReturnType<typeof webpack.EntryPlugin.createDependency>[]\n }) {\n // action file path -> action names\n const collectedActions = new Map<string, ActionIdNamePair[]>()\n\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedModule = new Set<string>()\n const visitedEntry = new Set<string>()\n\n const collectActions = ({\n entryRequest,\n resolvedModule,\n }: {\n entryRequest: string\n resolvedModule: any\n }) => {\n const collectActionsInDep = (mod: webpack.NormalModule): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n\n if (visitedModule.has(modResource)) return\n visitedModule.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n collectedActions.set(\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n }))\n )\n }\n\n // Collect used exported actions transversely.\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n collectActionsInDep(\n connection.resolvedModule as webpack.NormalModule\n )\n }\n )\n }\n\n // Don't traverse the module graph anymore once hitting the action layer.\n if (\n entryRequest &&\n !entryRequest.includes('next-flight-action-entry-loader')\n ) {\n // Traverse the module graph to find all client components.\n collectActionsInDep(resolvedModule)\n }\n }\n\n for (const entryDependency of dependencies) {\n const ssrEntryModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)!\n for (const connection of getModuleReferencesInOrder(\n ssrEntryModule,\n compilation.moduleGraph\n )) {\n const depModule = connection.dependency\n const request = (depModule as unknown as webpack.NormalModule).request\n\n // It is possible that the same entry is added multiple times in the\n // connection graph. We can just skip these to speed up the process.\n if (visitedEntry.has(request)) continue\n visitedEntry.add(request)\n\n collectActions({\n entryRequest: request,\n resolvedModule: connection.resolvedModule,\n })\n }\n }\n\n return collectedActions\n }\n\n collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule,\n }: {\n entryRequest: string\n compilation: webpack.Compilation\n resolvedModule: any /* Dependency */\n }): {\n cssImports: CssImports\n clientComponentImports: ClientComponentImports\n actionImports: [string, ActionIdNamePair[]][]\n } {\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedOfClientComponentsTraverse = new Set()\n\n // Info to collect.\n const clientComponentImports: ClientComponentImports = {}\n const actionImports: [string, ActionIdNamePair[]][] = []\n const CSSImports = new Set<string>()\n\n const filterClientComponents = (\n mod: webpack.NormalModule,\n importedIdentifiers: string[]\n ): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n if (visitedOfClientComponentsTraverse.has(modResource)) {\n if (clientComponentImports[modResource]) {\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n false\n )\n }\n return\n }\n visitedOfClientComponentsTraverse.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n actionImports.push([\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n })),\n ])\n }\n\n if (isCSSMod(mod)) {\n const sideEffectFree =\n mod.factoryMeta && (mod.factoryMeta as any).sideEffectFree\n\n if (sideEffectFree) {\n const unused = !compilation.moduleGraph\n .getExportsInfo(mod)\n .isModuleUsed(this.webpackRuntime)\n\n if (unused) return\n }\n\n CSSImports.add(modResource)\n } else if (isClientComponentEntryModule(mod)) {\n if (!clientComponentImports[modResource]) {\n clientComponentImports[modResource] = new Set()\n }\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n true\n )\n\n return\n }\n\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n let dependencyIds: string[] = []\n\n // `ids` are the identifiers that are imported from the dependency,\n // if it's present, it's an array of strings.\n if (connection.dependency?.ids) {\n dependencyIds.push(...connection.dependency.ids)\n } else {\n dependencyIds = ['*']\n }\n\n filterClientComponents(connection.resolvedModule, dependencyIds)\n }\n )\n }\n\n // Traverse the module graph to find all client components.\n filterClientComponents(resolvedModule, [])\n\n return {\n clientComponentImports,\n cssImports: CSSImports.size\n ? {\n [entryRequest]: Array.from(CSSImports),\n }\n : {},\n actionImports,\n }\n }\n\n injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName,\n clientImports,\n bundlePath,\n absolutePagePath,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n entryName: string\n clientImports: ClientComponentImports\n bundlePath: string\n absolutePagePath?: string\n }): [\n shouldInvalidate: boolean,\n addSSREntryPromise: Promise<void>,\n addRSCEntryPromise: Promise<void>,\n ssrDep: ReturnType<typeof webpack.EntryPlugin.createDependency>,\n ] {\n let shouldInvalidate = false\n\n const modules = Object.keys(clientImports)\n .sort((a, b) => (regexCSS.test(b) ? 1 : a.localeCompare(b)))\n .map((clientImportPath) => ({\n request: clientImportPath,\n ids: [...clientImports[clientImportPath]],\n }))\n\n // For the client entry, we always use the CJS build of Next.js. If the\n // server is using the ESM build (when using the Edge runtime), we need to\n // replace them.\n const clientBrowserLoader = `next-flight-client-entry-loader?${stringify({\n modules: (this.isEdgeServer\n ? modules.map(({ request, ids }) => ({\n request: request.replace(\n /[\\\\/]next[\\\\/]dist[\\\\/]esm[\\\\/]/,\n '/next/dist/'.replace(/\\//g, path.sep)\n ),\n ids,\n }))\n : modules\n ).map((x) => JSON.stringify(x)),\n server: false,\n })}!`\n\n const clientServerLoader = `next-flight-client-entry-loader?${stringify({\n modules: modules.map((x) => JSON.stringify(x)),\n server: true,\n })}!`\n\n // Add for the client compilation\n // Inject the entry to the client compiler.\n if (this.dev) {\n const entries = getEntries(compiler.outputPath)\n const pageKey = getEntryKey(\n COMPILER_NAMES.client,\n PAGE_TYPES.APP,\n bundlePath\n )\n\n if (!entries[pageKey]) {\n entries[pageKey] = {\n type: EntryTypes.CHILD_ENTRY,\n parentEntries: new Set([entryName]),\n absoluteEntryFilePath: absolutePagePath,\n bundlePath,\n request: clientBrowserLoader,\n dispose: false,\n lastActiveTime: Date.now(),\n }\n shouldInvalidate = true\n } else {\n const entryData = entries[pageKey]\n // New version of the client loader\n if (entryData.request !== clientBrowserLoader) {\n entryData.request = clientBrowserLoader\n shouldInvalidate = true\n }\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n entryData.parentEntries.add(entryName)\n }\n entryData.dispose = false\n entryData.lastActiveTime = Date.now()\n }\n } else {\n pluginState.injectedClientEntries[bundlePath] = clientBrowserLoader\n }\n\n const clientComponentSSREntryDep = webpack.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n const clientComponentRSCEntryDep = webpack.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n return [\n shouldInvalidate,\n // Add the entries to the server compiler for the SSR and RSC layers. The\n // promises are awaited later using `Promise.all` in order to parallelize\n // adding the entries.\n this.addEntry(compilation, compiler.context, clientComponentSSREntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.serverSideRendering,\n }),\n this.addEntry(compilation, compiler.context, clientComponentRSCEntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.reactServerComponents,\n }),\n clientComponentSSREntryDep,\n ]\n }\n\n injectActionEntry({\n compiler,\n compilation,\n actions,\n entryName,\n bundlePath,\n fromClient,\n createdActionIds,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n actions: Map<string, ActionIdNamePair[]>\n entryName: string\n bundlePath: string\n createdActionIds: Set<string>\n fromClient?: boolean\n }) {\n const actionsArray = Array.from(actions.entries())\n for (const [, actionsFromModule] of actions) {\n for (const { id } of actionsFromModule) {\n createdActionIds.add(entryName + '@' + id)\n }\n }\n\n if (actionsArray.length === 0) {\n return Promise.resolve()\n }\n\n const actionLoader = `next-flight-action-entry-loader?${stringify({\n actions: JSON.stringify(\n actionsArray satisfies FlightActionEntryLoaderActions\n ),\n __client_imported__: fromClient,\n })}!`\n\n const currentCompilerServerActions = this.isEdgeServer\n ? pluginState.edgeServerActions\n : pluginState.serverActions\n\n for (const [, actionsFromModule] of actionsArray) {\n for (const { id } of actionsFromModule) {\n if (typeof currentCompilerServerActions[id] === 'undefined') {\n currentCompilerServerActions[id] = {\n workers: {},\n layer: {},\n }\n }\n currentCompilerServerActions[id].workers[bundlePath] = {\n moduleId: '', // TODO: What's the meaning of this?\n async: false,\n }\n\n currentCompilerServerActions[id].layer[bundlePath] = fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents\n }\n }\n\n // Inject the entry to the server compiler\n const actionEntryDep = webpack.EntryPlugin.createDependency(actionLoader, {\n name: bundlePath,\n })\n\n return this.addEntry(\n compilation,\n // Reuse compilation context.\n compiler.context,\n actionEntryDep,\n {\n name: entryName,\n layer: fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents,\n }\n )\n }\n\n addEntry(\n compilation: webpack.Compilation,\n context: string,\n dependency: webpack.Dependency,\n options: webpack.EntryOptions\n ): Promise<any> /* Promise<module> */ {\n return new Promise((resolve, reject) => {\n if ('rspack' in compilation.compiler) {\n compilation.addInclude(context, dependency, options, (err, module) => {\n if (err) {\n return reject(err)\n }\n\n compilation.moduleGraph\n .getExportsInfo(module!)\n .setUsedInUnknownWay(\n this.isEdgeServer ? EDGE_RUNTIME_WEBPACK : DEFAULT_RUNTIME_WEBPACK\n )\n return resolve(module)\n })\n } else {\n const entry = compilation.entries.get(options.name!)!\n entry.includeDependencies.push(dependency)\n compilation.hooks.addEntry.call(entry as any, options)\n compilation.addModuleTree(\n {\n context,\n dependency,\n contextInfo: { issuerLayer: options.layer },\n },\n (err: any, module: any) => {\n if (err) {\n compilation.hooks.failedEntry.call(dependency, options, err)\n return reject(err)\n }\n\n compilation.hooks.succeedEntry.call(dependency, options, module)\n\n compilation.moduleGraph\n .getExportsInfo(module)\n .setUsedInUnknownWay(\n this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n )\n\n return resolve(module)\n }\n )\n }\n })\n }\n\n async createActionAssets(compilation: webpack.Compilation) {\n const serverActions: ActionManifest['node'] = {}\n const edgeServerActions: ActionManifest['edge'] = {}\n\n traverseModules(compilation, (mod, _chunk, chunkGroup, modId) => {\n // Go through all action entries and record the module ID for each entry.\n if (\n chunkGroup.name &&\n mod.request &&\n modId &&\n /next-flight-action-entry-loader/.test(mod.request)\n ) {\n const fromClient = /&__client_imported__=true/.test(mod.request)\n\n const mapping = this.isEdgeServer\n ? pluginState.edgeServerActionModules\n : pluginState.serverActionModules\n\n if (!mapping[chunkGroup.name]) {\n mapping[chunkGroup.name] = {}\n }\n mapping[chunkGroup.name][fromClient ? 'client' : 'server'] = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n }\n })\n\n for (let id in pluginState.serverActions) {\n const action = pluginState.serverActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.serverActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n serverActions[id] = action\n }\n\n for (let id in pluginState.edgeServerActions) {\n const action = pluginState.edgeServerActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.edgeServerActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n edgeServerActions[id] = action\n }\n\n const serverManifest = {\n node: serverActions,\n edge: edgeServerActions,\n encryptionKey: this.encryptionKey,\n }\n const edgeServerManifest = {\n ...serverManifest,\n encryptionKey: 'process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY',\n }\n\n const json = JSON.stringify(serverManifest, null, this.dev ? 2 : undefined)\n const edgeJson = JSON.stringify(\n edgeServerManifest,\n null,\n this.dev ? 2 : undefined\n )\n\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.js`,\n new sources.RawSource(\n `self.__RSC_SERVER_MANIFEST=${JSON.stringify(edgeJson)}`\n ) as unknown as webpack.sources.RawSource\n )\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.json`,\n new sources.RawSource(json) as unknown as webpack.sources.RawSource\n )\n }\n}\n\nfunction addClientImport(\n mod: webpack.NormalModule,\n modRequest: string,\n clientComponentImports: ClientComponentImports,\n importedIdentifiers: string[],\n isFirstVisitModule: boolean\n) {\n const clientEntryType = getModuleBuildInfo(mod).rsc?.clientEntryType\n const isCjsModule = clientEntryType === 'cjs'\n const assumedSourceType = getAssumedSourceType(\n mod,\n isCjsModule ? 'commonjs' : 'auto'\n )\n\n const clientImportsSet = clientComponentImports[modRequest]\n\n if (importedIdentifiers[0] === '*') {\n // If there's collected import path with named import identifiers,\n // or there's nothing in collected imports are empty.\n // we should include the whole module.\n if (!isFirstVisitModule && [...clientImportsSet][0] !== '*') {\n clientComponentImports[modRequest] = new Set(['*'])\n }\n } else {\n const isAutoModuleSourceType = assumedSourceType === 'auto'\n if (isAutoModuleSourceType) {\n clientComponentImports[modRequest] = new Set(['*'])\n } else {\n // If it's not analyzed as named ESM exports, e.g. if it's mixing `export *` with named exports,\n // We'll include all modules since it's not able to do tree-shaking.\n for (const name of importedIdentifiers) {\n // For cjs module default import, we include the whole module since\n const isCjsDefaultImport = isCjsModule && name === 'default'\n\n // Always include __esModule along with cjs module default export,\n // to make sure it work with client module proxy from React.\n if (isCjsDefaultImport) {\n clientComponentImports[modRequest].add('__esModule')\n }\n\n clientComponentImports[modRequest].add(name)\n }\n }\n }\n}\n\nfunction getModuleResource(mod: webpack.NormalModule): string {\n const modPath: string = mod.resourceResolveData?.path || ''\n const modQuery = mod.resourceResolveData?.query || ''\n // We have to always use the resolved request here to make sure the\n // server and client are using the same module path (required by RSC), as\n // the server compiler and client compiler have different resolve configs.\n let modResource: string = modPath + modQuery\n\n // Context modules don't have a resource path, we use the identifier instead.\n if (mod.constructor.name === 'ContextModule') {\n modResource = mod.identifier()\n }\n\n // For the barrel optimization, we need to use the match resource instead\n // because there will be 2 modules for the same file (same resource path)\n // but they're different modules and can't be deduped via `visitedModule`.\n // The first module is a virtual re-export module created by the loader.\n if (mod.matchResource?.startsWith(BARREL_OPTIMIZATION_PREFIX)) {\n modResource = mod.matchResource + ':' + modResource\n }\n\n if (mod.resource === `?${WEBPACK_RESOURCE_QUERIES.metadataRoute}`) {\n return getMetadataRouteResource(mod.rawRequest).filePath\n }\n\n return modResource\n}\n\nfunction getMetadataRouteResource(request: string): MetadataRouteLoaderOptions {\n // e.g. next-metadata-route-loader?filePath=<some-url-encoded-path>&isDynamicRouteExtension=1!?__next_metadata_route__\n const query = request.split('!')[0].split('next-metadata-route-loader?')[1]\n\n return parse(query) as MetadataRouteLoaderOptions\n}\n"],"names":["FlightClientEntryPlugin","PLUGIN_NAME","pluginState","getProxiedPluginState","serverActions","edgeServerActions","serverActionModules","edgeServerActionModules","ssrModules","edgeSsrModules","rscModules","edgeRscModules","injectedClientEntries","deduplicateCSSImportsForEntry","mergedCSSimports","sortedCSSImports","Object","entries","sort","a","b","aPath","bPath","aDepth","split","length","bDepth","aName","path","parse","name","bName","indexA","indexOf","indexB","dedupedCSSImports","trackedCSSImports","Set","entryName","cssImports","cssImport","has","filename","includes","add","push","constructor","options","dev","appDir","isEdgeServer","assetPrefix","encryptionKey","webpackRuntime","EDGE_RUNTIME_WEBPACK","DEFAULT_RUNTIME_WEBPACK","apply","compiler","hooks","finishMake","tapPromise","compilation","createClientEntries","afterCompile","tap","recordModule","modId","mod","modPath","matchResource","resourceResolveData","modQuery","query","modResource","startsWith","BARREL_OPTIMIZATION_PREFIX","formatBarrelOptimizedResource","resource","layer","WEBPACK_LAYERS","reactServerComponents","key","relative","context","replace","moduleInfo","moduleId","async","moduleGraph","isAsync","serverSideRendering","ssrNamedModuleId","normalizePathSep","traverseModules","_chunk","_chunkGroup","make","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_HASH","createActionAssets","addClientEntryAndSSRModulesList","createdSSRDependenciesForEntry","addActionEntryList","actionMapsPerEntry","createdActionIds","forEachEntryModule","entryModule","internalClientComponentEntryImports","actionEntryImports","Map","clientEntriesToInject","connection","getModuleReferencesInOrder","entryRequest","dependency","request","endsWith","WEBPACK_RESOURCE_QUERIES","metadataRoute","filePath","isDynamicRouteExtension","getMetadataRouteResource","clientComponentImports","actionImports","collectComponentInfoFromServerEntryDependency","resolvedModule","forEach","dep","actions","set","isAbsoluteRequest","isAbsolute","keys","value","relativeRequest","bundlePath","isMetadataRoute","assign","absolutePagePath","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","clientEntryToInject","injected","injectClientEntryAndSSRModules","clientImports","reduce","res","curr","isAppRouteRoute","APP_CLIENT_INTERNALS","size","injectActionEntry","invalidator","getInvalidator","outputPath","some","shouldInvalidate","invalidate","COMPILER_NAMES","client","Promise","all","flatMap","addClientEntryAndSSRModules","addedClientActionEntryList","actionMapsPerClientEntry","ssrEntryDependencies","collectClientActionsFromDependencies","dependencies","remainingClientImportedActions","remainingActionEntryImports","remainingActionNames","action","id","fromClient","collectedActions","visitedModule","visitedEntry","collectActions","collectActionsInDep","getModuleBuildInfo","getModuleResource","actionIds","rsc","map","exportedName","entryDependency","ssrEntryModule","getResolvedModule","depModule","visitedOfClientComponentsTraverse","CSSImports","filterClientComponents","importedIdentifiers","addClientImport","isCSSMod","sideEffectFree","factoryMeta","unused","getExportsInfo","isModuleUsed","isClientComponentEntryModule","dependencyIds","ids","Array","from","modules","regexCSS","test","localeCompare","clientImportPath","clientBrowserLoader","stringify","sep","x","JSON","server","clientServerLoader","getEntries","pageKey","getEntryKey","PAGE_TYPES","APP","type","EntryTypes","CHILD_ENTRY","parentEntries","absoluteEntryFilePath","dispose","lastActiveTime","Date","now","entryData","clientComponentSSREntryDep","EntryPlugin","createDependency","clientComponentRSCEntryDep","addEntry","actionsArray","actionsFromModule","resolve","actionLoader","__client_imported__","currentCompilerServerActions","workers","actionBrowser","actionEntryDep","reject","addInclude","err","module","setUsedInUnknownWay","entry","get","includeDependencies","call","addModuleTree","contextInfo","issuerLayer","failedEntry","succeedEntry","chunkGroup","mapping","serverManifest","node","edge","edgeServerManifest","json","undefined","edgeJson","emitAsset","SERVER_REFERENCE_MANIFEST","sources","RawSource","modRequest","isFirstVisitModule","clientEntryType","isCjsModule","assumedSourceType","getAssumedSourceType","clientImportsSet","isAutoModuleSourceType","isCjsDefaultImport","identifier","rawRequest"],"mappings":";;;;+BAsKaA;;;eAAAA;;;yBAjKW;6BACS;6DAChB;sCAOV;2BAIA;4BASA;uBAKA;wBAMA;kCAC0B;8BACK;2BACX;oCACQ;kCACE;iCACL;iCACA;;;;;;AAWhC,MAAMC,cAAc;AA4BpB,MAAMC,cAAcC,IAAAA,mCAAqB,EAAC;IACxC,gDAAgD;IAChDC,eAAe,CAAC;IAChBC,mBAAmB,CAAC;IAEpBC,qBAAqB,CAAC;IAItBC,yBAAyB,CAAC;IAI1BC,YAAY,CAAC;IACbC,gBAAgB,CAAC;IAEjBC,YAAY,CAAC;IACbC,gBAAgB,CAAC;IAEjBC,uBAAuB,CAAC;AAC1B;AAEA,SAASC,8BAA8BC,gBAA4B;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,4BAAAA,IAAIG,mBAAmB,qBAAvBH,0BAAyBK,KAAK,KAAI;IACnD,mEAAmE;IACnE,yEAAyE;IACzE,0EAA0E;IAC1E,IAAIC,cAAsBL,UAAUG;IAEpC,6EAA6E;IAC7E,IAAIJ,IAAIrB,WAAW,CAAChB,IAAI,KAAK,iBAAiB;QAC5C2C,cAAcN,IAAI0N,UAAU;IAC9B;IAEA,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,wEAAwE;IACxE,KAAI1N,qBAAAA,IAAIE,aAAa,qBAAjBF,mBAAmBO,UAAU,CAACC,sCAA0B,GAAG;QAC7DF,cAAcN,IAAIE,aAAa,GAAG,MAAMI;IAC1C;IAEA,IAAIN,IAAIU,QAAQ,KAAK,CAAC,CAAC,EAAE2C,mCAAwB,CAACC,aAAa,EAAE,EAAE;QACjE,OAAOG,yBAAyBzD,IAAI2N,UAAU,EAAEpK,QAAQ;IAC1D;IAEA,OAAOjD;AACT;AAEA,SAASmD,yBAAyBN,OAAe;IAC/C,sHAAsH;IACtH,MAAM9C,QAAQ8C,QAAQ9F,KAAK,CAAC,IAAI,CAAC,EAAE,CAACA,KAAK,CAAC,8BAA8B,CAAC,EAAE;IAE3E,OAAOK,IAAAA,kBAAK,EAAC2C;AACf"}
|
@@ -211,7 +211,7 @@ class ClientReferenceManifestPlugin {
|
|
211
211
|
const requiredChunks = getAppPathRequiredChunks(entrypoint, rootMainFiles);
|
212
212
|
const recordModule = (modId, mod)=>{
|
213
213
|
var _mod_resourceResolveData, _mod_resourceResolveData1, _mod_matchResource;
|
214
|
-
let resource = mod.type === 'css/mini-extract' ? mod.
|
214
|
+
let resource = mod.type === 'css/mini-extract' ? mod.identifier().slice(mod.identifier().lastIndexOf('!') + 1) : mod.resource;
|
215
215
|
if (!resource) {
|
216
216
|
return;
|
217
217
|
}
|
@@ -350,9 +350,9 @@ class ClientReferenceManifestPlugin {
|
|
350
350
|
if (modId !== null) {
|
351
351
|
recordModule(modId, clientEntryMod);
|
352
352
|
} else {
|
353
|
-
var _connection_module;
|
353
|
+
var _connection_module, _connection_module1;
|
354
354
|
// If this is a concatenation, register each child to the parent ID.
|
355
|
-
if (((_connection_module = connection.module) == null ? void 0 : _connection_module.constructor.name) === 'ConcatenatedModule') {
|
355
|
+
if (((_connection_module = connection.module) == null ? void 0 : _connection_module.constructor.name) === 'ConcatenatedModule' || Boolean(process.env.NEXT_RSPACK) && ((_connection_module1 = connection.module) == null ? void 0 : _connection_module1.constructorName) === 'ConcatenatedModule') {
|
356
356
|
const concatenatedMod = connection.module;
|
357
357
|
const concatenatedModId = compilation.chunkGraph.getModuleId(concatenatedMod);
|
358
358
|
if (concatenatedModId) {
|