-
Notifications
You must be signed in to change notification settings - Fork 115
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
Doesn't work on components without a JS class in 3.13 #335
Comments
😭 |
umm.. yea. So to maintain backwards compatibility, we'd have to dump an empty component file in if there was non for each template. The difficulty there is that due to the lax resolver, components can be anywhere, so it ends up dumping components next to route templates. |
I just won't be able to look into this until next week :( |
And with the new version, we are requiring "template only" components to have to use the |
it looks like it's still getting registered, I wonder if you could pull it out of that. |
@knownasilya might have a fix for this. We'll see if it suffices for the mean time. |
Shoot. Ok. well, have to spend a little more time later. |
@knownasilya is it possible to assign styleNamespace using template ast-transform? <div class="{{styleNamespace}}"></div> -> AST <div class="app_components_my-component"></div> or kinda. |
@lifeart yea. that parts easy, but there’s is no way to distinguish route templates and component templates, or if a component template is going to need that or not at build time. |
@webark during transform time we can figure out template type, based on file name & location. |
you could have a template that’s “app/posts/author-comment/template.hbs” and call that with {{posts/author-comment}} so..
neither of those are great options. I would also be much more error prone to try to add this to templates in addon’s due to how they are structured as well. |
How's this coming along? I'm running into this issue with my app. |
I think going the way we discussed in #342 where we have the option of wrapping all templates in a let block that defines a “styleNamespace” local variable is best for now.. That should be quick to do. |
@webark Just want to clarify. This is an update to the repo that you're talking about, rather than me wrapping all of the components that I'm working with in a |
correct |
Any updates on this? We also ran into it in our app. |
Bump/+1: I'm stuck on ember 3.12 due to the break when I switch to 3.13. |
@ctaylor-nurx check https://github.com/Brain-up/brn/blob/master/frontend/app/helpers/style-namespace.js and its usages in app, working for us |
We settled for a similar thing! After switching to that it's a lot nicer than leaning on an implicitly created <div class={{style-namespace-for "my/component"}} ...attributes>
</div> or <h1>Not this</h1>
<div class="{{style-namespace-for "my-component"}} more-classes" ...attributes>
<p>It adds flexibility to where you can apply the namespace</p>
</div>
<div class={{style-namespace-for "my-component"}}>
<p>You can also use it multiple times :D</p>
</div> |
yea. I am in the process of rewriting this (again) webark/ember-cli-styles#1 . I am very close (it's been about a 3 year journey) but here I'm doing something similar by using a element modifier. There's a few discrepancies between the broccoli trees embroider provides and non embroider provides, so I'm trying to find a simple way of consuming both and having it work. Should be soon for a beta release of those packages. |
oh nice! thanks! |
@webark will it work with FastBoot considering element modifiers do not run in FastBoot? |
@SergeAstapov well.. :sigh: well no then. I could adopt what I'm doing with the element modifiers into a helper. The ast will be more complex though. bascially what I am doign now is taking an element modifier like
and turning that into
with an ast (and only adding the You could modify that same behavior to work with a helper, the AST will just not be able to be as terse. |
@SergeAstapov I guess the AST is the same.. So that can be an easy transition. |
updating the specs will be more annoying |
#293 (comment)
Solution would be to auto generate an empty JS class for components that don't have one.
The text was updated successfully, but these errors were encountered: