Unverified Commit c2ba7e6a authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: fix over-invalidation of node.js assets (#57240)

### What?

* no need to clear require cache when assets where not used previously
* make build status reporting more consistent
* report build status to client side for build indicator

### Why?

### How?


Closes WEB-1826
parent 6adb9716
......@@ -95,6 +95,7 @@ export default function initializeBuildWatcher(
break
case HMR_ACTIONS_SENT_TO_BROWSER.BUILT:
case HMR_ACTIONS_SENT_TO_BROWSER.SYNC:
case HMR_ACTIONS_SENT_TO_BROWSER.FINISH_BUILDING:
hide()
break
}
......
......@@ -17,6 +17,7 @@ export const enum HMR_ACTIONS_SENT_TO_BROWSER {
SYNC = 'sync',
BUILT = 'built',
BUILDING = 'building',
FINISH_BUILDING = 'finishBuilding',
DEV_PAGES_MANIFEST_UPDATE = 'devPagesManifestUpdate',
TURBOPACK_MESSAGE = 'turbopack-message',
SERVER_ERROR = 'serverError',
......@@ -37,6 +38,10 @@ interface BuildingAction {
action: HMR_ACTIONS_SENT_TO_BROWSER.BUILDING
}
interface FinishBuildingAction {
action: HMR_ACTIONS_SENT_TO_BROWSER.FINISH_BUILDING
}
interface SyncAction {
action: HMR_ACTIONS_SENT_TO_BROWSER.SYNC
hash: string
......@@ -95,6 +100,7 @@ export type HMR_ACTION_TYPES =
| TurbopackMessageAction
| TurbopackConnectedAction
| BuildingAction
| FinishBuildingAction
| SyncAction
| BuiltAction
| AddedPageAction
......
......@@ -20,7 +20,7 @@ const installCheckVisible = (browser) => {
watcherDiv.querySelector('div').className.indexOf('visible') > -1
)
if (window.showedBuilder) clearInterval(window.checkInterval)
}, 50)
}, 5)
})()`)
}
......
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