-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
hot-reloader-turbopack refactors #61929
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @timneutkens and the rest of your teammates on Graphite |
Stats from current PRDefault BuildGeneral Overall increase
|
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
buildDuration | 12.9s | 12.8s | N/A |
buildDurationCached | 7.1s | 6.1s | N/A |
nodeModulesSize | 196 MB | 196 MB | |
nextStartRea..uration (ms) | 435ms | 436ms | N/A |
Client Bundles (main, webpack)
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
3f784ff6-HASH.js gzip | 53.5 kB | 53.5 kB | N/A |
423.HASH.js gzip | 185 B | 181 B | N/A |
68-HASH.js gzip | 29.6 kB | 29.6 kB | N/A |
framework-HASH.js gzip | 45.2 kB | 45.2 kB | ✓ |
main-app-HASH.js gzip | 238 B | 239 B | N/A |
main-HASH.js gzip | 31.9 kB | 31.9 kB | N/A |
webpack-HASH.js gzip | 1.7 kB | 1.7 kB | ✓ |
Overall change | 46.9 kB | 46.9 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
_app-HASH.js gzip | 194 B | 195 B | N/A |
_error-HASH.js gzip | 182 B | 181 B | N/A |
amp-HASH.js gzip | 502 B | 501 B | N/A |
css-HASH.js gzip | 320 B | 322 B | N/A |
dynamic-HASH.js gzip | 2.5 kB | 2.5 kB | N/A |
edge-ssr-HASH.js gzip | 255 B | 256 B | N/A |
head-HASH.js gzip | 350 B | 349 B | N/A |
hooks-HASH.js gzip | 368 B | 369 B | N/A |
image-HASH.js gzip | 4.19 kB | 4.18 kB | N/A |
index-HASH.js gzip | 257 B | 256 B | N/A |
link-HASH.js gzip | 2.67 kB | 2.67 kB | N/A |
routerDirect..HASH.js gzip | 310 B | 311 B | N/A |
script-HASH.js gzip | 384 B | 383 B | N/A |
withRouter-HASH.js gzip | 306 B | 308 B | N/A |
1afbb74e6ecf..834.css gzip | 106 B | 106 B | ✓ |
Overall change | 106 B | 106 B | ✓ |
Client Build Manifests
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
_buildManifest.js gzip | 483 B | 485 B | N/A |
Overall change | 0 B | 0 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
index.html gzip | 528 B | 527 B | N/A |
link.html gzip | 541 B | 539 B | N/A |
withRouter.html gzip | 523 B | 522 B | N/A |
Overall change | 0 B | 0 B | ✓ |
Edge SSR bundle Size
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
edge-ssr.js gzip | 94.4 kB | 94.4 kB | N/A |
page.js gzip | 150 kB | 150 kB | N/A |
Overall change | 0 B | 0 B | ✓ |
Middleware size
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
middleware-b..fest.js gzip | 620 B | 626 B | N/A |
middleware-r..fest.js gzip | 151 B | 149 B | N/A |
middleware.js gzip | 47.4 kB | 47.4 kB | ✓ |
edge-runtime..pack.js gzip | 1.94 kB | 1.94 kB | ✓ |
Overall change | 49.3 kB | 49.3 kB | ✓ |
Next Runtimes
vercel/next.js canary | vercel/next.js 02-12-Initial_Turbopack_build | Change | |
---|---|---|---|
app-page-exp...dev.js gzip | 166 kB | 166 kB | ✓ |
app-page-exp..prod.js gzip | 95.4 kB | 95.4 kB | ✓ |
app-page-tur..prod.js gzip | 97.2 kB | 97.2 kB | ✓ |
app-page-tur..prod.js gzip | 91.6 kB | 91.6 kB | ✓ |
app-page.run...dev.js gzip | 136 kB | 136 kB | ✓ |
app-page.run..prod.js gzip | 90.2 kB | 90.2 kB | ✓ |
app-route-ex...dev.js gzip | 22 kB | 22 kB | ✓ |
app-route-ex..prod.js gzip | 14.9 kB | 14.9 kB | ✓ |
app-route-tu..prod.js gzip | 14.9 kB | 14.9 kB | ✓ |
app-route-tu..prod.js gzip | 14.7 kB | 14.7 kB | ✓ |
app-route.ru...dev.js gzip | 21.7 kB | 21.7 kB | ✓ |
app-route.ru..prod.js gzip | 14.7 kB | 14.7 kB | ✓ |
pages-api-tu..prod.js gzip | 9.43 kB | 9.43 kB | ✓ |
pages-api.ru...dev.js gzip | 9.7 kB | 9.7 kB | ✓ |
pages-api.ru..prod.js gzip | 9.43 kB | 9.43 kB | ✓ |
pages-turbo...prod.js gzip | 22 kB | 22 kB | ✓ |
pages.runtim...dev.js gzip | 22.7 kB | 22.7 kB | ✓ |
pages.runtim..prod.js gzip | 22 kB | 22 kB | ✓ |
server.runti..prod.js gzip | 49.9 kB | 49.9 kB | ✓ |
Overall change | 924 kB | 924 kB | ✓ |
let versionInfo: VersionInfo = await getVersionInfo( | ||
true || isTestMode || opts.telemetry.isEnabled | ||
const versionInfo: VersionInfo = await getVersionInfo( | ||
isTestMode || opts.telemetry.isEnabled |
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.
This incorrectly was always true
@@ -1167,13 +1357,7 @@ export async function createHotReloaderTurbopack( | |||
clearHmrServerError() { | |||
// Not implemented yet. | |||
}, | |||
async start() { | |||
const enabled = isTestMode || opts.telemetry.isEnabled | |||
const nextVersionInfo = await getVersionInfo(enabled) |
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.
This was already called earlier before returning the hotReloader interface, we don't have to run it twice.
packages/next/src/build/index.ts
Outdated
rootPath: config.experimental.outputFileTracingRoot || dir, | ||
nextConfig: config.nextConfig, | ||
jsConfig: await getTurbopackJsConfig(dir, config), | ||
watch: true, |
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.
watch: true, | |
watch: false, |
}) | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const iter = project.entrypointsSubscribe() |
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.
We should expose a non-subscribing method here
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.
Yeah this was just to get to the point where it can be called 👍
Failing test suitesCommit: 3d1d9f1
Expand output● app-dir action handling › should handle actions correctly after navigation / redirection events
Read more about building and testing Next.js in contributing.md.
Expand output● Prerender › should on-demand revalidate for fallback: blocking with onlyGenerated if generated
Read more about building and testing Next.js in contributing.md. |
## What? Follow-up to #61929. More refactors to move the logic out of `createHotReloaderTurbopack` so that these functions can be used for builds later too. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2440
What?
Follow-up to #61917. Splitting out more code from the development handling so that it can be used for builds too in a later PR.
Closes NEXT-2429