-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split app/templates
into its own tree.
#1238
Conversation
This is ready for review. |
👍 |
Currently, we are processing the entire `app/templates` and `app/styles` directories for all `preprocessJs` filters (this means things like `ES3SafeFilter` are actually checking each template). This makes `templates` it's own tree, and splits things up appropriately.
Split `app/templates` into its own tree.
What about templates in pods? |
I'm working on a fix for that now :) |
This introduces a hidden gotcha. If a user passes their own I hit this just now because I'm writing an ember-cli addon that can also be tested as a standalone ember-cli app. My Brocfile for standalone use does essentially:
And I was confused about why my templates in
But that feels redundant. Perhaps the default templates tree should be relative to the actual app tree, not the default app tree. Otherwise it's impossible to override just "app" without repeating yourself and also overriding templates. |
This was actually the intended result, and why this was labeled as a breaking change in the changelog. Just like styles, templates are actually a different thing. The app tree is for your javascript, the styles tree is for your styles, and the templates tree is for your templates. You addon will now be asked for the template tree also, so it may make sense to move it outside of the app-addon anyways. Sorry for the trouble this has caused you, but the current mechanism is definitely better. |
Agreed, but then it's an unfortunate choice to keep storing the templates (and styles) inside the app directory. That's the source of confusion. Perhaps |
I agree completely, that sounds good to me. I'll try to get together a PR for that before 0.0.40. |
Does this break pods? @aexmachina not sure if you were asking a question or stating a fact here. After upgrading my templates are not being found even though the log shows correct locations. |
Yes, this broke templates from pods. |
Would adding a suffix for compiled templates and then wildcarding be a possible solution? Reason I ask is that it would address another wish-list item: I use a custom resolver and one of the things I cannot do is have a |
Incidentally I hope separating templates from js code will not become mandatory. Is there a consensus on this? Pod structure is a significant productivity gain for me, I much prefer encapsulation over splitting things at such a higher level, with my templates right next to the controllers. |
@aceofspades - This is a regression, no more. It will be fixed. |
Currently, we are processing the entire
app/templates
andapp/styles
directories for allpreprocessJs
filters (this means things likeember-cli-esnext
are actually checking each template).ES3SafeFilter
was also being ran against templates.This makes
templates
it's own tree, and splits things up appropriately.Fixes #1233.