2017-11-18 15:26:33 -05:00
{
2018-01-05 19:15:14 -05:00
"cli-hello-world" : {
"master" : {
"uncompressed" : {
2018-10-31 11:25:57 -04:00
"runtime" : 1497 ,
2019-05-14 18:55:46 -04:00
"main" : 166799 ,
2019-01-17 19:52:34 -05:00
"polyfills" : 43626
2018-01-05 19:15:14 -05:00
}
}
} ,
2019-01-28 10:04:38 -05:00
"cli-hello-world-ivy-minimal" : {
"master" : {
"uncompressed" : {
"runtime" : 1440 ,
fix(ivy): don't mask errors by calling lifecycle hooks after a crash (#31244)
The Angular runtime frequently calls into user code (for example, when
writing to a property binding). Since user code can throw errors, calls to
it are frequently wrapped in a try-finally block. In Ivy, the following
pattern is common:
```typescript
enterView();
try {
callUserCode();
} finally {
leaveView();
}
```
This has a significant problem, however: `leaveView` has a side effect: it
calls any pending lifecycle hooks that might've been scheduled during the
current round of change detection. Generally it's a bad idea to run
lifecycle hooks after the application has crashed. The application is in an
inconsistent state - directives may not be instantiated fully, queries may
not be resolved, bindings may not have been applied, etc. Invariants that
the app code relies upon may not hold. Further crashes or broken behavior
are likely.
Frequently, lifecycle hooks are used to make assertions about these
invariants. When these assertions fail, they will throw and "swallow" the
original error, making debugging of the problem much more difficult.
This commit modifies `leaveView` to understand whether the application is
currently crashing, via a parameter `safeToRunHooks`. This parameter is set
by modifying the above pattern:
```typescript
enterView();
let safeToRunHooks = false;
try {
callUserCode();
safeToRunHooks = true;
} finally {
leaveView(..., safeToRunHooks);
}
```
If `callUserCode` crashes, then `safeToRunHooks` will never be set to `true`
and `leaveView` won't call any further user code. The original error will
then propagate back up the stack and be reported correctly. A test is added
to verify this behavior.
PR Close #31244
2019-06-24 16:14:05 -04:00
"main" : 14847 ,
2019-01-17 19:52:34 -05:00
"polyfills" : 43567
2019-01-28 10:04:38 -05:00
}
}
} ,
2019-01-28 09:54:34 -05:00
"cli-hello-world-ivy-compat" : {
2018-12-21 13:00:16 -05:00
"master" : {
"uncompressed" : {
"runtime" : 1440 ,
2019-05-30 15:54:39 -04:00
"main" : 149248 ,
2019-01-17 19:52:34 -05:00
"polyfills" : 43567
2018-12-21 13:00:16 -05:00
}
}
} ,
2018-01-05 19:15:14 -05:00
"hello_world__closure" : {
"master" : {
"uncompressed" : {
2018-04-04 13:56:02 -04:00
"bundle" : "TODO(i): temporarily increase the payload size limit from 105779 - this is due to a closure issue related to ESM reexports that still needs to be investigated" ,
2019-04-03 10:08:45 -04:00
"bundle" : 179825
2018-01-05 19:15:14 -05:00
}
}
}
2019-05-30 15:54:39 -04:00
}