next.js
18e7c84a - Remove JS size reporting from next build (#83815)

Commit
133 days ago
Remove JS size reporting from next build (#83815) ## What Remove the `First Used JS` and `Size` metrics from `next build` CLI output, as well as the manifest files that supported these metrics. ## Why A recent investigation has revealed a number of bugs and longstanding known issues in the implementation. * The metrics produced by Webpack builds for App Router don't account for layouts and parallel routes correctly. * Not only are they not accounted for in route sizes, they are treated as distinct routes for the 'uniqueness' computation which means dependencies of a widely shared layout wouldn't be treated as 'common chunks' * The `First Used JS by All` metric counts `.css` chunks as JS * This happened to predominately affect turbopack reporting due the above issue in webpack (css deps of layouts don't get treated as common deps) * In App router, client components are not accurately modeled by either toolchain * webpack doesn't account for client components at all. Leading to consistent undercounts * turbopack accumulates all referenced client components which is better but can be an overcount for conditionally rendered or mutually exclusive components. * In Pages router, `next/dynamic` dependencies can confuse these metrics Generally, if a server is using any non-trivial logic to decide what is rendered there is just no correct answer to the 'First Load JS size' question. These metrics originally came out of a collaboration with Chrome DevRel back in 2019 (maybe? first reference i think is https://github.com/vercel/next.js/pull/7194). Since then, the web has shifted to Core Web Vitals and indeed that is what we use to evaluate actual performance. We've decided to remove the metric instead as it's misleading at this point. See #83823 for docs updates
Author
Parents
Loading