So IVY is out and with it comes some great private APIs, which help create smaller Custom Elements.
- createCustomElement -> using ɵRender3ComponentFactory
The problem that I have run into is using third-party structural directives that use the ChangeDetectorRef’s method markForCheck().
We know this simple marks a component’s view (and parent’s view) to be checked in the next change detection cycle.
When hand cranking a component with IVY we lose this and have to manually call change detection.
So how does a component detect a change that is done by a directive. (being that we can’t change the directive implementation…)
I have created an example on branch directiveCD of the below repo.
(either project shows of the problem)
Things I have played with:
- ChangeDetectorRef is shared by the directive and the component, so can we monkey patch an observable to emit when
- Try and add some of the functionality of NgZone and ApplicationRef so we can hook into
So I am opening a discussion on how would be the best way to approach this problem (obviously I am aware that these are private APIs etc and none of this is standard).