Routable Components Questions

Can someone provide a practical example of what a “routable component” would look like? Concept seems really alien to me.

I have read the Road to Ember 2.0

A few questions:

1.) Will the component ever be implicit?

say I have

  this.route('help');

Will that mean that a generated component will exist?

{{x-help}}

And I only have to define a template. Presumably the component will need to be explicitly defined in the pods folder along side the route file.

2.) Will there be the concept of a singleton component or is that really just a service?

3.) If not singleton how will we know which instance of the component to pass the attrs hash?

4.) Will there be a set up component method in the route or any kind of analog to setup controller? Where will initialization logic live?

5.) Can a route conditionally load different components depending on the some variable or state of the models in that route? In other words how tightly bound will a given component and a given route be? Is it logical for a route to back multiple types of components, or even multiple instances of a specific component type. The latter case seems like it might be an interesting way to provide a buffer state. Multiple phases of a route expressed by multiple instances of a component as the model is mutated. Perhaps a convenient way to manage undo and rollback.

6.) Other than user confusion were there any other technical reasons to abandon controllers?

Probably more to come when someone posts the RFC. But just curious what people’s early thinking is on this topic.

Thanks

2 Likes

this document might be helpfull : rfcs/0000-routeable-components.md at routeable-components · ef4/rfcs · GitHub

If ability to call render outside transition goes away, whats going to happen to say, modal implementations that base on it for rendering templates into modal outlet in response to user input?

Lets say I rely on modals heavily in my app, should I just insert dom for my 27 modals into application fragment instead of current rendering/disconnecting single outlet? But that seems pretty messy thing to do.


Edit: discard that. I’ve used {{component modalComponent}} helper for same thing. :]

thanks for posting this link. As a newcomer, that doc helped define what exactly “routeable components” mean.

So after reading this, I guess I have a followup question.

Where do the action handlers for user input go when I am using routable components? If I create a feedback form that could exist on mutliple routes, does each url’s route have to know about the action handlers for handling that form submission? Or does that go into the component itself?

That’s the one part I am still lost on.