ember-route-action-helper icon indicating copy to clipboard operation
ember-route-action-helper copied to clipboard

Deprecate Addon

Open elwayman02 opened this issue 3 years ago • 12 comments

@poteto @bcardarella what are your thoughts on officially deprecating this addon? It's been marked as "probably shouldn't use" for 4 years now, and it doesn't receive regular updates anymore. In general, I think Ember patterns have shifted such that we shouldn't be using addons like this to hijack action routing and should instead allow them to flow through controllers (or use the routing service, which is now widely available in Ember apps). We are working on creating a lint rule that will help people eliminate uses of this addon, but it would be great to get an official deprecation from the maintainers to signal to the community that they should no longer be adopting it. This addon is still in the top 10% most downloaded Ember addons, which signals that there's a significant portion of the community still using it even though they shouldn't.

elwayman02 avatar Jul 20 '21 21:07 elwayman02

Seems like a good idea to me...

rwjblue avatar Jul 20 '21 21:07 rwjblue

I've been away from the Ember community for a while now so I don't know if I have more to add here (I agree with this request)—but logistically I think only someone who is an admin of @DockYard can archive this. Maybe @brzpegasus can help if Brian doesn't see this?

poteto avatar Jul 20 '21 21:07 poteto

At the very minimum, just updating the README to clearly deprecate it would be a great first step if we're all in agreement!

elwayman02 avatar Jul 20 '21 21:07 elwayman02

@bcardarella @brzpegasus any thoughts here?

elwayman02 avatar Jul 29 '21 18:07 elwayman02

+1 to deprecating this addon. I am curious if there are any updates regarding this.

shankarsridhar avatar Aug 19 '21 14:08 shankarsridhar

@elwayman02 before we called route-actions in childrens, and the action was declared at the top route level, for example:

route1 -> route2 -> route3 (call route-action "route1")
      \-> route4 -> route5 (call route-action "route1")

please tell me what is the best practice in this case now

AmilKey avatar Dec 16 '21 13:12 AmilKey

@AmilKey I had the exact same problem, here's how I solved it. Add an action to the controllers of route3 and 5 with unique names. From these actions call this.send with the name of the action in the route (not controller!) of route1. This is the cleanest solution I could think of. Too bad this.send only bubbles through routes, not controllers.

Baukereg avatar Jan 26 '22 10:01 Baukereg

To be honest, I'm writing a lot of boilerplate code to get the route action helper out of our application. Controllers with actions that only exist to manually trigger actions on higher level routes.

Baukereg avatar Feb 10 '22 08:02 Baukereg

To be honest, I'm writing a lot of boilerplate code to get the route action helper out of our application. Controllers with actions that only exist to manually trigger actions on higher level routes.

I suspect you may need to rethink that architecture more thoroughly. It should not be common that you have to throw actions up through several levels of parent routes.

elwayman02 avatar Feb 10 '22 20:02 elwayman02

I suspect you may need to rethink that architecture more thoroughly. It should not be common that you have to throw actions up through several levels of parent routes.

I can think of a dozen scenarios where triggering an action on a high level route from a deeply nested route makes sense. It's just that Ember throws up all kind of restrictions, and the route action helper bypassed these restrictions, so in that sense I'm all for deprecating it.

Having asked the community for input, it seems that moving all logic and state to services is the way. In general: make state global, and keep the result of state changes local. It's not necessarily how I would like it, but this is not the place for a broader discussion about Ember fundamentals.

Baukereg avatar Feb 15 '22 10:02 Baukereg

@Baukereg this is something @nullvoxpopuli has already been exploring here: https://github.com/NullVoxPopuli/ember-contextual-services

elwayman02 avatar Feb 15 '22 20:02 elwayman02

@bcardarella @brzpegasus any updates here?

elwayman02 avatar Jun 02 '22 17:06 elwayman02