Angular Renderer Resilience & Reactivity Updates#1939
Conversation
There was a problem hiding this comment.
Code Review
This pull request converts componentType and props to Angular Signals in ComponentHostComponent and introduces logic to wait for surface creation asynchronously if it is not immediately available. It also adds corresponding unit tests to verify these behaviors. The reviewer suggests refactoring the manual detectChanges() and Promise.resolve() change detection hacks by utilizing NgZone to handle asynchronous updates from outside the Angular Zone more idiomatically.
3b27e30 to
bddff1c
Compare
josemontespg
left a comment
There was a problem hiding this comment.
The changes make sense to improve reliability of Surface lookups during component tree creation. Left some comments about code style and testing
deab4aa to
0b43cb9
Compare
|
Hi @josemontespg, I have resolved the conflicts by rebasing the branch on top of I've also:
The PR checks are now green. Could you please take a look and merge the PR? Thanks! |
0b43cb9 to
32ea9b5
Compare
57b43f0 to
632080f
Compare
This commit fixes critical reliability bugs and change-detection rendering skips in the Angular Renderer (ComponentHostComponent): 1. Fix subscription memory leak: Resolve a pattern where the component-host subscribes to onSurfaceCreated and attempts to unsubscribe self-referentially within the synchronous emission path, which evaluates to undefined and leaks listeners. 2. Asynchronous surface resolution: In progressive rendering or streaming environments, component host nodes can be mounted in the DOM before the surface itself is registered. Added a subscription to onSurfaceCreated to automatically bootstrap the component when the surface registers. 3. Optimize reactivity (Signals upgrade): Upgraded componentType and props to Signals. In strict OnPush applications, asynchronous updates inside RxJS callbacks were not recognized by the change detector, leaving components unrendered.
632080f to
27f32b2
Compare
This pull request fixes critical reliability bugs and change-detection rendering skips in the Angular Renderer (
ComponentHostComponent):onSurfaceCreatedand attempts to unsubscribe self-referentially within the synchronous emission path, which evaluates toundefinedand leaks listeners.onSurfaceCreatedto automatically bootstrap the component when the surface registers.componentTypeandpropsto Angular Signals. In strictOnPushapplications, asynchronous updates inside RxJS callbacks were not recognized by the change detector, leaving components unrendered.Pre-launch Checklist