-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Currently, glint supports GlimmerX-style components, where a component's template is defined using a tagged template literal inside its class body.
Regardless of the form factor strict mode and template imports ultimately take, to support today's idioms in Ember we need to be able to consume templates in standalone files. This forces the introduction of some amount of project-structure knowledge into glint, but fortunately isolating these sorts of details is exactly the kind of thing environments were introduced to handle.
We probably want to support template-only components and colocated component/template pairs as a minimum starting point. That is, if <root> refers to app or addon as appropriate, then:
<root>/components/<name>.hbsshould pair with<root>/component/<name>.tsif present<root>/components/<name>.hbsshould be treated as a template-only component otherwise (and if no other cases described below apply)
There are a pretty large number of other cases we can hopefully eventually detect well enough to support route/controller templates and to give folks in classic/pods layouts a migration path.
<root>/templates/components/<name>.hbsshould pair with<root>/components/<name>.tsif present<root>/templates/<name>.hbsshould pair with<root>/controllers/<name>.tsif present<root>/<path>/template.hbsshould, in order:- pair with
<root>/<path>/component.tsif present - pair with
<root>/<path>/controller.tsif present - be treated as template-only otherwise (is
/templatethe import path?)
- pair with