Skip to content

Commit

Permalink
Turbopack: always log HMR rebuild times (vercel#60908)
Browse files Browse the repository at this point in the history
This removes the need for `NEXT_HMR_TIMING` to do this.


Closes PACK-2264

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
wbinnssmith and ijjk committed Jan 20, 2024
1 parent 7d4888d commit 498f342
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/next/src/server/lib/router-utils/setup-dev-bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1560,10 +1560,8 @@ async function startWatcher(opts: SetupOpts) {
false,
route.dataEndpoint,
(pageName) => {
if (process.env.NEXT_HMR_TIMING) {
// Report the next compilation again
readyIds.delete(page)
}
// Report the next compilation again
readyIds.delete(page)
return {
event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,
pages: [pageName],
Expand Down Expand Up @@ -1643,10 +1641,8 @@ async function startWatcher(opts: SetupOpts) {
// There will be another update without errors eventually
return
}
if (process.env.NEXT_HMR_TIMING) {
// Report the next compilation again
readyIds.delete(page)
}
// Report the next compilation again
readyIds.delete(page)
return {
action:
HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,
Expand Down Expand Up @@ -1739,7 +1735,7 @@ async function startWatcher(opts: SetupOpts) {
warnings: [],
})

if (process.env.NEXT_HMR_TIMING && hmrEventHappened) {
if (hmrEventHappened) {
const time = updateMessage.value.duration
const timeMessage =
time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms`
Expand Down

0 comments on commit 498f342

Please sign in to comment.