[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
+2
View File
@@ -117,3 +117,5 @@ Dev mode activates some additional checks and developer amenities:
- [Props validation](./props.md#props-validation) is performed
- [t-foreach](./templates.md#loops) loops check for key unicity
- Lifecycle hooks are wrapped to report their errors in a more developer-friendly way
- onWillStart and onWillUpdateProps will emit a warning in the console when they
take longer than 3 seconds in an effort to ease debugging the presence of deadlocks