Reapply "Speed up TypeScript v2 (#6406)" (#6586)

This reverts commit b2cf28b7f1 and reapplies #6406.
This commit is contained in:
Ian Sutherland
2019-03-06 17:46:38 -07:00
committed by GitHub
parent e69ad37fcf
commit 1548a0a92e
14 changed files with 220 additions and 47 deletions

View File

@@ -106,7 +106,7 @@ function handleSuccess() {
tryApplyUpdates(function onHotUpdateSuccess() {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
ErrorOverlay.dismissBuildError();
tryDismissErrorOverlay();
});
}
}
@@ -140,19 +140,15 @@ function handleWarnings(warnings) {
}
}
printWarnings();
// Attempt to apply hot updates or reload.
if (isHotUpdate) {
tryApplyUpdates(function onSuccessfulHotUpdate() {
// Only print warnings if we aren't refreshing the page.
// Otherwise they'll disappear right away anyway.
printWarnings();
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
ErrorOverlay.dismissBuildError();
tryDismissErrorOverlay();
});
} else {
// Print initial warnings immediately.
printWarnings();
}
}
@@ -183,6 +179,12 @@ function handleErrors(errors) {
// We will reload on next success instead.
}
function tryDismissErrorOverlay() {
if (!hasCompileErrors) {
ErrorOverlay.dismissBuildError();
}
}
// There is a newer version of the code available.
function handleAvailableHash(hash) {
// Update last known compilation hash.