-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Turbopack: selective reads of defined env vars in module analysis #88759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sokra/equivalent-selective-read
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e6f15e9 to
4096331
Compare
8c6302c to
2494303
Compare
Equivalent keys
Failing test suitesCommit: 4096331 | About building and testing Next.js
Expand output● next-config-ts-type-error-esm › should throw with type error on build (ESM)
Expand output● next-config-ts-type-error-cjs › should throw with type error on build (CJS)
Expand output● next-config-ts-top-level-await-esm › should support top-level await (ESM)
Expand output● next-config-ts-node-api-cjs › should be able to use Node.js API (CJS)
Expand output● Unoptimized Image Tests › development mode - component › should not optimize any image ● Unoptimized Image Tests › production mode - component › should not optimize any image ● Unoptimized Image Tests › production mode - component › should build correct images-manifest.json ● Unoptimized Image Tests › development mode - getImageProps › should not optimize any image ● Unoptimized Image Tests › production mode - getImageProps › should not optimize any image ● Unoptimized Image Tests › production mode - getImageProps › should build correct images-manifest.json
Expand output● create-next-app --no-app (Pages Router) › should create JavaScript project with --js flag ● create-next-app --no-app (Pages Router) › should create TypeScript project with --ts flag ● create-next-app --no-app (Pages Router) › should create project inside "src" directory with --src-dir flag ● create-next-app --no-app (Pages Router) › should create TailwindCSS project with --tailwind flag ● create-next-app --no-app (Pages Router) › should create an empty project with --empty flag ● create-next-app --no-app (Pages Router) › should create an empty TailwindCSS project with --empty flag
Expand output● should handle unresolved files gracefully › production mode › should build correctly ● should handle unresolved files gracefully › production mode › should have correct file references in CSS output ● Data URLs › production mode › should compile successfully ● Data URLs › production mode › should have emitted expected files ● Ordering with Global CSS and Modules (dev) › useLightnincsss(true) › should have the correct color (css ordering) ● Ordering with Global CSS and Modules (dev) › useLightnincsss(true) › should have the correct color (css ordering) during hot reloads ● Ordering with Global CSS and Modules (dev) › useLightnincsss(true) › should have the correct color (css ordering) during hot reloads ● Ordering with Global CSS and Modules (dev) › useLightnincsss(true) › should have the correct color (css ordering) during hot reloads ● Ordering with Global CSS and Modules (dev) › useLightnincsss(false) › should have the correct color (css ordering) ● Ordering with Global CSS and Modules (dev) › useLightnincsss(false) › should have the correct color (css ordering) during hot reloads ● Ordering with Global CSS and Modules (dev) › useLightnincsss(false) › should have the correct color (css ordering) during hot reloads ● Ordering with Global CSS and Modules (dev) › useLightnincsss(false) › should have the correct color (css ordering) during hot reloads ● Ordering with Global CSS and Modules (prod) › production mode › useLightnincsss(true) › should have compiled successfully ● Ordering with Global CSS and Modules (prod) › production mode › useLightnincsss(true) › should have the correct color (css ordering) ● Ordering with Global CSS and Modules (prod) › production mode › useLightnincsss(false) › should have compiled successfully ● Ordering with Global CSS and Modules (prod) › production mode › useLightnincsss(false) › should have the correct color (css ordering)
Expand output● Auto Export › production mode › Supports commonjs 1 ● Auto Export › production mode › Supports commonjs 2 ● Auto Export › production mode › Refreshes query on mount ● Auto Export › production mode › should update asPath after mount ● Auto Export › production mode › should not replace URL with page name while asPath is delayed ● Auto Export › dev › Supports commonjs 1 ● Auto Export › dev › Supports commonjs 2 ● Auto Export › dev › Refreshes query on mount ● Auto Export › dev › should update asPath after mount ● Auto Export › dev › should not replace URL with page name while asPath is delayed ● Auto Export › dev › should not show hydration warning from mismatching asPath
Expand output● server-side dev errors › should show server-side error for gsp page correctly ● server-side dev errors › should show server-side error for gssp page correctly ● server-side dev errors › should show server-side error for dynamic gssp page correctly ● server-side dev errors › should show server-side error for api route correctly ● server-side dev errors › should show server-side error for dynamic api route correctly ● server-side dev errors › should show server-side error for uncaught rejection correctly ● server-side dev errors › should show server-side error for uncaught empty rejection correctly ● server-side dev errors › should show server-side error for uncaught exception correctly ● server-side dev errors › should show server-side error for uncaught empty exception correctly
Expand output● Read-only source HMR › should detect changes to a page ● Read-only source HMR › should handle page deletion and subsequent recreation ● Read-only source HMR › should detect a new page
Expand output● app fetch build cache › should render page with dependencies ● app fetch build cache › should bundle @aws-sdk/client-s3 as a transpiled package
Expand output● Middleware development errors › when middleware is removed › sends response correctly ● Middleware development errors › when middleware is removed and re-added › sends response correctly ● Middleware development errors › when middleware is added › sends response correctly ● Middleware development errors › when matcher is added › sends response correctly
Expand output● debug-build-paths › default fixture › explicit path formats › should build single page with pages/ prefix ● debug-build-paths › default fixture › explicit path formats › should build multiple pages routes ● debug-build-paths › default fixture › explicit path formats › should build dynamic route with literal [slug] path ● debug-build-paths › default fixture › glob pattern matching › should match app and pages routes with glob patterns ● debug-build-paths › default fixture › glob pattern matching › should match nested routes with app/blog/**/page.tsx pattern ● debug-build-paths › default fixture › glob pattern matching › should match dynamic routes with glob before brackets like app/**/[slug]/page.tsx ● debug-build-paths › default fixture › glob pattern matching › should match hybrid pattern with literal [slug] and glob ** ● debug-build-paths › default fixture › glob pattern matching › should match multiple app routes with explicit patterns ● debug-build-paths › default fixture › glob pattern matching › should exclude paths matching negation patterns ● debug-build-paths › default fixture › glob pattern matching › should exclude dynamic route paths with negation ● debug-build-paths › default fixture › glob pattern matching › should support multiple negation patterns ● debug-build-paths › default fixture › glob pattern matching › should build everything except excluded paths when only negation patterns are provided ● debug-build-paths › default fixture › typechecking with debug-build-paths › should skip typechecking for excluded app routes ● debug-build-paths › with-compile-error fixture › should skip compilation of excluded routes with compile errors
Expand output● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should append dpl query to all assets correctly for / ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should append dpl query to all assets correctly for /pages-edge ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should append dpl query to all assets correctly for /from-app ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should append dpl query to all assets correctly for /from-app/edge ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should have deployment id env available ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should have deployment id env available ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should contain deployment id in prefetch request ● deployment-id-handling enabled with NEXT_DEPLOYMENT_ID › should contain deployment id in RSC payload request headers ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should append dpl query to all assets correctly for / ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should append dpl query to all assets correctly for /pages-edge ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should append dpl query to all assets correctly for /from-app ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should append dpl query to all assets correctly for /from-app/edge ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should have deployment id env available ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should have deployment id env available ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should contain deployment id in prefetch request ● deployment-id-handling enabled with CUSTOM_DEPLOYMENT_ID › should contain deployment id in RSC payload request headers ● deployment-id-handling disabled › should not append dpl query to all assets for / ● deployment-id-handling disabled › should not append dpl query to all assets for /pages-edge ● deployment-id-handling disabled › should not append dpl query to all assets for /from-app ● deployment-id-handling disabled › should not append dpl query to all assets for /from-app/edge
Expand output● build-output-prerender › with a next config file › without --debug-prerender › shows only a single prerender error with a mangled stack ● build-output-prerender › with a next config file › with --debug-prerender › shows all prerender errors with readable stacks and code frames
Expand output● segment cache (deployment skew) › does not crash when prefetching a dynamic, non-PPR page on a different deployment ● segment cache (deployment skew) › does not crash when prefetching a dynamic, non-PPR page on a different deployment ● segment cache (deployment skew) › does not crash when prefetching a static page on a different deployment ● segment cache (deployment skew) › does not crash when prefetching a static page on a different deployment ● Test suite failed to run
Expand output● router.isReady with appGip › development mode › isReady should be true immediately for pages without getStaticProps ● router.isReady with appGip › development mode › isReady should be true immediately for pages without getStaticProps, with query ● router.isReady with appGip › development mode › isReady should be true immediately for getStaticProps page without query ● router.isReady with appGip › development mode › isReady should be true after query update for getStaticProps page with query
Expand output● parallel-routes-and-interception-basepath › should show parallel intercepted slot with basepath ● parallel-routes-and-interception-basepath › should show normal route via direct link with basepath when parallel intercepted slot exist
Expand output● Catch-all Route CSS Module Usage ({"sass": "1.54.0"}) › should render the module ● Catch-all Route CSS Module Usage ({"sass-embedded": "1.75.0"}) › should render the module |
Merging this PR will improve performance by ×6.4
Performance Changes
Comparing Footnotes
|
| } | ||
| } | ||
|
|
||
| #[turbo_tasks::value(transparent, cell = "keyed")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return Ok(()); | ||
| } | ||
| } | ||
| if let Some(name) = var.get_definable_name() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| analysis: &mut AnalyzeEcmascriptModuleResultBuilder, | ||
| ) -> Result<()> { | ||
| if let Some(prop) = prop.as_str() { | ||
| let prop_seg = DefinableNameSegment::Name(prop.into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **430 kB** → **430 kB** ✅ -130 B82 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
|

What?
Use selective reads to read defined env vars in module analysis.
This allows to add/remove env vars without invalidating all modules.