angular/packages/core/test/bundling/hydration
Andrew Scott 629343f247 fix(core): Multiple subscribers to ApplicationRef.isStable should all see values (#53541)
The behavior of `ApplicationRef.isStable` changed in 16.1 due to
28c68f709c.
This change added a `share` to the `isStable` observable, which prevents
additional subscribers from getting a value until a new one emits. One
solution to the problem would be `shareReplay(1)`. However, that would
increase the bundle size since we do not use `shareReplay` elsewhere.
Instead, we don't even really need to share the observable.

The `Observable` available in `ApplicationRef.isStable` before the above commit
was the zone stable observable, without a `share`. The new behavior adds
only an additional observable to the stream, `hasPendingTasks` (a `BehaviorSubject`).
The observables in this stream are not expensive to subscribe to. The
only one with side effects is the `isStable` (because it subscribes to
onStable), but that one already has the `share` operator on it.
Omitting the `share` in `ApplicationRef` also means that applications on `zoneless` will not
have to pay the cost of the operator when we make zones optional because
the zone stable observable is the only place we use it.

PR Close #53541
2023-12-13 11:26:51 -08:00
..
BUILD.bazel test(core): Add hydration symbols test (#49955) 2023-04-24 09:57:52 -07:00
bundle.golden_symbols.json fix(core): Multiple subscribers to ApplicationRef.isStable should all see values (#53541) 2023-12-13 11:26:51 -08:00
index.html test(core): Add hydration symbols test (#49955) 2023-04-24 09:57:52 -07:00
index.ts test(core): Add hydration symbols test (#49955) 2023-04-24 09:57:52 -07:00
treeshaking_spec.ts test(core): Add hydration symbols test (#49955) 2023-04-24 09:57:52 -07:00