[IMP] component: emit warning when async hooks take too long

This commit adds a warning when an async hook
(onWillUpdateProps/onWillStart) takes longer than 3 seconds, as these
hooks block the rendering and patching of the application, it is rarely
desirable and often a sign of a deadlock. This warning will contain the
stack trace of the call to the hook to help in debugging.
This commit is contained in:
Samuel Degueldre
2022-03-14 09:37:21 +01:00
committed by Géry Debongnie
parent 47c6d6cc3c
commit 77ff5ee895
5 changed files with 132 additions and 1 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ export async function nextTick(): Promise<void> {
interface Deferred extends Promise<any> {
resolve(val?: any): void;
reject(): void;
reject(val?: any): void;
}
export function makeDeferred(): Deferred {