ember-cli-styles-reloader
ember-cli-styles-reloader copied to clipboard
Fix: ember-component-css compatibility
Fixes #8.
However, this is blocked by: https://github.com/ebryn/ember-component-css/issues/75
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.
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.
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
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 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?
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.
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.
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.
I am currently vacationing as well. Try to find time this week
@buschtoens interested in making PR per our discussion?
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 @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.
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 thx, sounds great.
Any status on this? :D
@xomaczar I can't find the branch fix-ember-component-css
anywhere? I'd be willing to help solve this issue.