-
Notifications
You must be signed in to change notification settings - Fork 12.9k
When building projects in watch mode, only schedule projects that need build or need update to bundle #48865
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
Conversation
tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js
Show resolved
Hide resolved
@andrewbranch can you please review.. would like to get this in early for 4.8 |
while (state.projectPendingBuild.size) { | ||
// If already scheduled, skip | ||
if (state.timerToBuildInvalidatedProject) return; | ||
// Before scheduling check if the next project needs build | ||
const info = getNextInvalidatedProjectCreateInfo(state, buildOrder, /*reportQueue*/ false); | ||
if (!info) break; // Nothing to build any more | ||
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps) { | ||
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps && (changeDetected || projectsBuilt === 5)) { |
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.
How did you choose 5? What’s the advantage of having a delay between groups at all? (Is it so there are points where the operation can be canceled if a new change comes in?)
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.
I assumed that on an average the change to build 5 projects might be couple of seconds or less and that would be good time to check if there is new change...
Without adding delay, we wont be able to check if new change is detected and cancel existing chain of build
Earlier we use to build single project at 250ms and the next project build or project time stamp updates happened after another 250ms. Now only build and update bundle is scheduled with reduced time gap (100ms) and update timestamps happens right after project build
Fixes #48187