ember-cli-styles-reloader icon indicating copy to clipboard operation
ember-cli-styles-reloader copied to clipboard

Fix: ember-component-css compatibility

Open buschtoens opened this issue 9 years ago • 16 comments

Fixes #8.

However, this is blocked by: https://github.com/ebryn/ember-component-css/issues/75

buschtoens avatar Jul 11 '15 01:07 buschtoens

Agree. Out of the box we should satisfy 99% of use cases w/o any custom config. Reloading *.css (vendor & app) is straight forward and was the initial implementation, however I thought parsing vendor css (which most of the time does not change during the dev and may contain large css framework) was unnecessary.

xomaczar avatar Jul 11 '15 12:07 xomaczar

That's right - if only we wouldn't have ended up with just the opposite: only the vendor.css reloading. :smile:

But the rationale is right. Would be ignoring the vendor.css too much of a trade-off? As you said, the vendor.css updates very rarely; practically only after a new addon is installed (afaik).

Maybe we can just leave it up to the user to do these reloads, if any, manually, to save us a big headache.

buschtoens avatar Jul 11 '15 12:07 buschtoens

Well, the only reason we ended up with the opposite is due to using non ember-cli prescribed app structure. It works correctly in all other cases. To ignore vendor.css requires knowing that a given file will be concatenated into vendor.css - same issue as we have now with {app}.css

xomaczar avatar Jul 11 '15 15:07 xomaczar

How about having these (default) config settings:

{
  reload: {
    app: true,
    vendor: false
  }
}

This way the user can decide, whether or not they need vendor.css reloading, which I would assume most do not. I'd have no other idea on how to teach this addon when to reload which file.

buschtoens avatar Jul 11 '15 15:07 buschtoens

@buschtoens your input is valuable and greatly appreciated. Can you please elaborate what happens when reload {app:false, vendor:true} and user modifies app/styles/app.sass. Do we just reload vendor.css because a style was changed?

xomaczar avatar Jul 11 '15 17:07 xomaczar

I'd say yes.

The problem is, we can't possibly know the behaviour of all the addons out there. But I haven't yet encountered a single addon that imported from the app directory into the vendor.css tree. But that need not mean that there's not such an addon. However, I'd go by the default assumption, that app only contains "app" code. If users somehow get vendor code mangled in there, they are free to set vendor: true and have it work. All other 99 or so % would be satisfied with the default behavior.

Another thing though: There might be a way to know, when a file belongs to the vendor.css tree. We could hook in to the app.import(asser, options) call. However, this could potentially slow down boot time and is quite hacky.

In the end, I would really just ignore the vendor.css stuff completely by default, but allow users to enable it on demand. At least in my workflow, I'd never need it. I'd just hit F5, if ever needed.

buschtoens avatar Jul 12 '15 07:07 buschtoens

Sounds great. Do you have time to make PR with associated test that support this new workflow. If not, I can probably get to it at the end of this week.

xomaczar avatar Jul 13 '15 15:07 xomaczar

Sorry for not responding. I was on vacation for a few days. :tropical_drink:

I guess you also didn't have the time to prepare a commit? Maybe I'll get something cooked up tonight or tomorrow.

buschtoens avatar Jul 17 '15 12:07 buschtoens

I am currently vacationing as well. Try to find time this week

xomaczar avatar Aug 01 '15 19:08 xomaczar

@buschtoens interested in making PR per our discussion?

xomaczar avatar Aug 31 '15 04:08 xomaczar

I have no idea where this currently is but I tried out the current branch in my project and it worked awesomely!

I'm using:

"ember-cli": "1.13.8",
"ember-cli-sass": "^4.0.1",
"ember-cli-styles-reloader": "[email protected]:buschtoens/ember-cli-styles-reloader.git#fix-ember-component-css-compat",
"ember-component-css": "0.1.6"

erkie avatar Aug 31 '15 13:08 erkie

@erkie @buschtoens branch fix-ember-component-css should work for you. Based on our discussion above, we decided to simplify that implementation to support various app styles locations.

xomaczar avatar Sep 01 '15 13:09 xomaczar

Yup. Maybe I'll get around to it this evening. 😊

Andrey Khomenko [email protected] schrieb am Di., 1. Sep. 2015 15:00:

@erkie https://github.com/erkie @buschtoens https://github.com/buschtoens branch fix-ember-component-css should work for you. Based on our discussion above, we decided to simplify that implementation to support various app styles locations.

— Reply to this email directly or view it on GitHub https://github.com/xomaczar/ember-cli-styles-reloader/pull/9#issuecomment-136709763 .

buschtoens avatar Sep 01 '15 14:09 buschtoens

@buschtoens thx, sounds great.

xomaczar avatar Sep 01 '15 17:09 xomaczar

Any status on this? :D

erkie avatar Jan 26 '16 11:01 erkie

@xomaczar I can't find the branch fix-ember-component-css anywhere? I'd be willing to help solve this issue.

erkie avatar Jan 26 '16 11:01 erkie