salsify / ember-css-modules

CSS Modules for ambitious applications
MIT License
282 stars 49 forks source link

Support template-only-glimmer-components optional feature #98

Closed karellm closed 6 years ago

karellm commented 6 years ago

I was playing with Ember 3.1 and saw a move from innerHTML to outerHTML (see here). From my quick tests, it doesn't seem to play nice with ember-css-modules.

karellm commented 6 years ago

Discard this, I had a problem with my configuration.

dfreeman commented 6 years ago

@karellm It actually wouldn't surprise me at all if ECM doesn't work with that feature turned on (or, more likely, if it interferes with that feature because of this logic).

If it is a problem, I'm not positive we'll be able to fix it until module unification lands, but I'll keep an eye on things. Please let me know if you run into any issues!

karellm commented 6 years ago

@dfreeman Thanks for taking the time to check this. local-class still works ok for me. At first I was using class which doesn't work. I will keep experimenting with this and definitely reopen this if I find blocking things.

mswanson commented 6 years ago

It appears this bug should be reopened. I just did some testing with a basic Ember 3.1-beta.5 app. Removing the application template wrapper appears to work just fine, but template-only components silently fail and the wrapper div is still present in the DOM (see screenshot)

screenshot 2018-04-02 23 18 06

I am using the latest 3.1 beta versions of ember and ember-cli

screenshot 2018-04-02 23 19 17

ember-cli: 3.1.0-beta.1
node: 9.5.0
os: darwin x64

Steps to reproduce

  1. Installed the latest ember-cli beta yarn global upgrade ember-cli#3.1.0-beta.1
  2. ember install @ember/optional-features
  3. ember feature:disable application-template-wrapper
  4. ember feature:enable template-only-glimmer-components
  5. ember g component my-component
  6. deleted app/components/my-component.js
dfreeman commented 6 years ago

Yep, that's the issue I was expecting to see—thanks for confirming @mswanson!

The short version is that ECM relies on having a component class defined, so it does the equivalent of creating a component.js for you in order to make the local styles work. And that, clearly, gets in the way of the template-only-glimmer-components feature 🙂

I'll reopen this, but I may not have a chance to investigate what the options are in the near future. If anyone's interested in taking a look, though, I'm happy to point you toward what I do know!

mswanson commented 6 years ago

@dfreeman I can try to take a look. I am expecting my first kid in the next few weeks so i'm not gonna be sleeping anyway! 😄

dfreeman commented 6 years ago

@mswanson Sorry, I totally lost track of this issue — I hope parenthood is treating you well! If you do find yourself with some spare time at some point, feel free to ping me here or in Slack and I can talk you through what I know.