Skip to content

Commit 498f342

Browse files
wbinnssmithijjk
andauthored
Turbopack: always log HMR rebuild times (vercel#60908)
This removes the need for `NEXT_HMR_TIMING` to do this. Closes PACK-2264 Co-authored-by: JJ Kasper <jj@jjsweb.site>
1 parent 7d4888d commit 498f342

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/next/src/server/lib/router-utils/setup-dev-bundler.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -1560,10 +1560,8 @@ async function startWatcher(opts: SetupOpts) {
15601560
false,
15611561
route.dataEndpoint,
15621562
(pageName) => {
1563-
if (process.env.NEXT_HMR_TIMING) {
1564-
// Report the next compilation again
1565-
readyIds.delete(page)
1566-
}
1563+
// Report the next compilation again
1564+
readyIds.delete(page)
15671565
return {
15681566
event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,
15691567
pages: [pageName],
@@ -1643,10 +1641,8 @@ async function startWatcher(opts: SetupOpts) {
16431641
// There will be another update without errors eventually
16441642
return
16451643
}
1646-
if (process.env.NEXT_HMR_TIMING) {
1647-
// Report the next compilation again
1648-
readyIds.delete(page)
1649-
}
1644+
// Report the next compilation again
1645+
readyIds.delete(page)
16501646
return {
16511647
action:
16521648
HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,
@@ -1739,7 +1735,7 @@ async function startWatcher(opts: SetupOpts) {
17391735
warnings: [],
17401736
})
17411737

1742-
if (process.env.NEXT_HMR_TIMING && hmrEventHappened) {
1738+
if (hmrEventHappened) {
17431739
const time = updateMessage.value.duration
17441740
const timeMessage =
17451741
time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms`

0 commit comments

Comments
 (0)