-
Notifications
You must be signed in to change notification settings - Fork 48
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
Getting errors after updating to Ember 2.8 #41
Comments
@poteto @martndemus I think the issue may be related to this |
I'm unable to reproduce this, could you add steps to reproduce? |
@martndemus I don't think we are doing anything strange, so could be any number of things making this issue crop up. I'll have to try to throw together a test app. |
This issue was introduced for me in the upgrade to ember-route-action-helper on ember 2.4 LTS. It happens in integration tests where the router is not present. @martndemus Here is a twiddle that repros the problem. |
Thanks @blimmer! |
no problem @rwwagner90 - my workaround is to lock to 1.0.0 for now. |
In that case: duplicate of #39. |
@blimmer @martndemus why can't we support this? |
@rwwagner90 in theory, components should never be "route dependant" and that's why this shouldn't be supported by the plugin. In practice, we all have components that are specific to the routes because, well, it makes our life easier - controllers are kinda weird. Although it makes us to do more boilerplate work (manual action bubbling) I agree with @martndemus because it enforces better design and separation of concerns. I guess routable components will help us with this, if they ever land.. :) |
For those with this issue, I recommend reverting to version |
@ilucin the components are not specific to routes in our use cases. Think of components used across many routes and you have an action on all their parent routes |
@rwwagner90 I see what you mean, it's a valid use case. But the thing is, components should never depend on their parent scope/environment. They should receive all dependencies (input) through attrs and fire actions (output) to communicate to outside world - that's how they are decoupled from their parent context. For the same reason, having service injections in components can also be considered a bad practice. On the other hand, this approach can be harsh and maybe we should make our lives easier and break some of the "rules". |
@ilucin I totally understand where you're coming from, but I think I show a somewhat reasonable use-case here: We often use components to help separate logic from the main route template (or "routeable component") to make each piece easier to work with. For instance, on the comment I linked above, it's a navigation element that's only used on one set of routes whose parent always has the |
I would love to see an option to enable this again or something. With a warning that it goes against the traditional DDAU principles somewhat. |
This will work the other way, but will cause test failures in components that do that. See DockYard/ember-route-action-helper#41 for more details.
This will work the other way, but will cause test failures in components that do that. See DockYard/ember-route-action-helper#41 for more details.
This will work the other way, but will cause test failures in components that do that. See DockYard/ember-route-action-helper#41 for more details.
@blimmer @ilucin can we bring that back ? I don't get it why we need to "enforce" that rule destroying creativity? |
Just ran into this while writing integration tests for component with route-action and I agree with @vasilakisfil if we are to pass actions down into the component (the ember way), then it also seems to to make this helper pointless... Personally I find route-action's to serve a purpose in certain cases and make life easier... thoughts? |
while true, in practice I don't believe most people pass services down into components but rather inject as needed... interesting to consider though |
Not sure exactly what the cause may be.
The text was updated successfully, but these errors were encountered: