-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EngineRouterService to Engines #669
base: master
Are you sure you want to change the base?
Conversation
@rwjblue can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is yet missing the routeWillChange
and routeDidChange
events. I was playing around with my own EngineRouterService
and found that in most cases, it's most sensible to transform the to
and from
properties of the Transition
and expose the original RouteInfo
s as toExternal
and fromExternal
.
@buschtoens how to do that? I did your solution, but it doesn't works -https://gist.github.com/buschtoens/de2faacfc8977e39843b7e2cc2f3fd1e#gistcomment-2960117 |
I think the missing Regarding your comment on my gist: It looks like the event handlers are calling themselves recursively. This can have multiple reasons and I'd need to reproduce it. |
thanks @buschtoens, for while we'll push this without routeWillChange and routeDidChange events. |
Will this affect engines that are getting the router service injected into them from the parent app? |
@lvegerano As the engine router is injected into However, I feel like this is an anti-pattern, as from how I understand it, Engine routing system shouldn't be concerned with host-app (that's why for example you pass the data via services). |
Yes
This is not a anti-pattern, we just providing the same API that already exist on router to controllers, components and etc using a service. Nothing changes about isolation/concern. You can check this on my changes on this PR |
b277364
to
0bffc60
Compare
@villander getting close imo! I think we're down to needing a couple tests for the events above, and my main concern which is:
We should probably have a hard error when a service named |
@dgeb thanks for bringing all concepts here. I added all tests to EngineRouterService events, also I added the proper assert to avoid parent pass service named I think finally we're ready to move it forward and release it as v0.9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@villander thanks for making those changes!
@rwjblue do you have time to do a final pass reviewing this?
@rwjblue any chance to review it this week? |
This PR has dragged on for quite a while and I'd like to move it forward ASAP. That said, I was just doing another walkthrough here and could use some feedback from others in one area ... I'd like to decide whether we really want to support all the @villander @rwjblue @buschtoens thoughts? |
Yes, we're fighting with it for one year or more, and finally, we going to stabilize the Router on Engines. Looking forward to seeing it merged and released.
I agree we need more core team involvement here, this has been going on for years. Ember Engines seems "abandoned"
Seems a great decision to make Ember Engines more ergonomic with default methods from a normal Ember app and easy to update with RouterService coming from Ember.js repository, but we need to treat ember engines seriously and create an RFC for that, could you please do that @dgeb? |
@dgeb I'm generally 👍 on your suggestion of removing The name I still believe that merging the internal and external namespaces as I suggested in #691 is the superior solution in terms of dev ergonomics. Another suggestion was using opaque route name via a That said, |
Thanks for your thoughts, @villander and @buschtoens.
@villander Same here, but my hesitation is that this PR creates a whole lot of API surface area that is not strictly necessary. I'd like to push forward with the simplest possible version of this PR that provides the minimal API to ship an
I think you're right here, @buschtoens. Since we're really talking about the My proposal to ship this PR as an MVP:
Does anyone have an issue with this as a starting point? This can be followed quickly with a PR that deprecates the no longer needed We can also consider #691 more carefully after doing all this, since none of this will foreclose on that approach. |
I think we're mixing up two things here. What's currently injected as The
By doing just this we would break support for So going by your suggestion what we'd need is:
The advantage of having this I'd like to reiterate this point once more, as it seems that there was some confusion regarding the terminology of host routes (routes accessible via
|
I totally agree, it breaks the isolation principle even doing developer ergonomics easier removing surface API. Also, I think we should open an RFC to discuss it better. There are many pros and cons here to be discussed. We already discussed some of them on the previous RFC and #691.
I see one big pro:
I see 4 big trade-offs:
|
FWIW I addressed these concerns here: #691 (comment) |
FWIW, I replied to all of them here, addressing all objections #691 (comment) & #691 (comment) |
Apologies. It's been so long since I've used engines personally that I completely overlooked current support for external routes. I will get back up to speed here and work through everyone's comments. |
@dgeb any update or forecast here? Is there something else I can do to move it forward? |
Bump. This would be really nice to have. |
@btecu you can use this addon that provides this PR to Engines - https://github.com/villander/ember-engines-router-service |
It implements #587
*External
variant for all methods