ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Allow GJS/GTS route templates

Open ef4 opened this issue 1 year ago • 4 comments

In the process of starting to write guides content for template tag, @kategengler and I decided it's too clunky to force new learners to mix HBS and GJS.

In practice, experienced ember devs who are adopting template tag are often using ember-route-template so they can author routes in template tag. We considered just proposing ember-route-template for the default blueprint, but then realized that in that case it's actually just much better to build the same feature into ember.

AFAIK, this PR is the full implementation and it's ready to go, pending an RFC.

This does not preclude also doing a more comprehensive Route Manager API that would cleanup more about routes. But this seems like an important smallest step we can make today to improve the experience.

ef4 avatar Oct 02 '24 19:10 ef4

I am a fan, and this reduces the divergences in the TS support PR for the v2 app blueprint

NullVoxPopuli avatar Oct 02 '24 19:10 NullVoxPopuli

cc @chancancode: this would essentially copy your ember-route-template implementation into ember.

ef4 avatar Oct 02 '24 21:10 ef4

Yea, I think it definitely should be built-in and the wrapper shouldn't be necessary. Mostly just have to decide whether we are happy enough with @model and @controller for now, and if those somehow locks us into an undesirable path. Couldn't think of any obvious problems off the top of my head, generally +1.

chancancode avatar Oct 03 '24 00:10 chancancode

RFC: https://github.com/emberjs/rfcs/pull/1046

ef4 avatar Oct 04 '24 16:10 ef4

It is on my personal TODO list, but beyond what I commented above, I suspect we can simplify this code quite a bit (and clearly mark the legacy code path) by flipping it around – have the happy path always just assume and invoke a component with @controller and @model, and wrap/upgrade any legacy templates as a special component as needed.

chancancode avatar Nov 12 '24 20:11 chancancode

This was replaced by https://github.com/emberjs/ember.js/pull/20800

kategengler avatar Jan 17 '25 20:01 kategengler