fix(router): add missing outlet events to RouterOutletContract #42431
Conversation
aa36b67
to
f645559
These events aren't part of the contract between the |
@atscott If the router doesn't listen to them, how am I supposed to access them in a typed manner as they are triggered? |
@smasala Can you please file an issue report and outline your use-case? Are you reading from the Also, this change would be breaking because the new function on the interface would need to be implemented by the classes. |
@atscott this isn't breaking as the events are there, just not exposed on the interface. I'm still able to access the events as in v11, just in v12 I need to cast the object so that I can get them without a TS error. |
That’s exactly why it’s a breaking change. You have to change something when updating (; |
@alfaproject breaking is a matter of definition. If this PR is merged, my code works as before with no further changes required (not breaking) and any migrations from v11 to this merged PR would also continue to work. The only difference for me or current Ng 12 applications would be that any casting to the |
@smasala The way the public API works would still make this a breaking change. Any new implementers of the interface in v12 would break with this update. We can make this non-breaking by having the events be optional and we can merge it for the |
@atscott updated. Thanks btw |
reviewed-for: fw-router |
I think we could replace @atscott what do you think about using |
Exposes both activateEvents and deactivateEvents as the original outlet interface did.
@AndrewKushnir That's a fair point and a good idea. I went ahead and made that change. |
LGTM reviewed-for: public-api |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR adds
activateEvents
anddeactivateEvents
to theRouterOutletContract
.This is needed in our case where we dynamically render components via the Module Federation at some point in the future. Without this the
active
component is alwaysɵEmptyOutletComponent
and not the actual component which is eventually created by an external route, hence why these events are needed so that we can capture all components rendered at any given time.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Simply updating the public api interface which now causes type errors in angular 12 but is technically still available.
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information