Unverified Commit 498f342b authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Turbopack: always log HMR rebuild times (#60908)

This removes the need for `NEXT_HMR_TIMING` to do this.


Closes PACK-2264
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 7d4888d9
...@@ -1560,10 +1560,8 @@ async function startWatcher(opts: SetupOpts) { ...@@ -1560,10 +1560,8 @@ async function startWatcher(opts: SetupOpts) {
false, false,
route.dataEndpoint, route.dataEndpoint,
(pageName) => { (pageName) => {
if (process.env.NEXT_HMR_TIMING) {
// Report the next compilation again // Report the next compilation again
readyIds.delete(page) readyIds.delete(page)
}
return { return {
event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES, event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,
pages: [pageName], pages: [pageName],
...@@ -1643,10 +1641,8 @@ async function startWatcher(opts: SetupOpts) { ...@@ -1643,10 +1641,8 @@ async function startWatcher(opts: SetupOpts) {
// There will be another update without errors eventually // There will be another update without errors eventually
return return
} }
if (process.env.NEXT_HMR_TIMING) {
// Report the next compilation again // Report the next compilation again
readyIds.delete(page) readyIds.delete(page)
}
return { return {
action: action:
HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES, HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,
...@@ -1739,7 +1735,7 @@ async function startWatcher(opts: SetupOpts) { ...@@ -1739,7 +1735,7 @@ async function startWatcher(opts: SetupOpts) {
warnings: [], warnings: [],
}) })
if (process.env.NEXT_HMR_TIMING && hmrEventHappened) { if (hmrEventHappened) {
const time = updateMessage.value.duration const time = updateMessage.value.duration
const timeMessage = const timeMessage =
time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms` time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment