Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4836

Routes and their future role in Ember

$
0
0

@knownasilya wrote:

Coming from this thread https://mobile.twitter.com/oligriffiths/status/993837170317234181 I decided to post my thoughts in more then just a tweet :slight_smile: and get others to reply.

Looks like there are a few ideas and projects that are rethinking the role of the Route in an Ember app. One of those early ideas was “Routable Components” and I think there is still something there that can be salvaged to make Ember a simpler and more coherent framework.

There are several ways that this could go, the two most obvious are:

  1. Route -> Component
  2. Route -> Template -> Component (https://mobile.twitter.com/Thoov/status/993733133894799361)

One downside I see to #1 is that it’s not as clear which component is associated with a route. Does that have to be set in the Route or should it be a convention like <routeName>-route component, e.g. users-route. The other issue is how to define the data and the actions on the component without that intermediate template.

With #2 doing ember g route <routeName> also creates a template, but that template doesn’t automatically have a component so that’s an extra step and there is no way to know if the template rendered without a component with the APIs currently in the Route. If the controller is removed, which data is passed to this template and does that data include actions as well? So there are a few unresolved questions.

I’d like to see a discussion about which convention is more fitting for Ember, or if it’s another one altogether. What other pros/cons are there for each solution?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles