ember-cli-sass
ember-cli-sass copied to clipboard
performance
There is an easy way to get much better performance. Currently, everything in bower_components/vendor and app are considered when determining if a rebuild is needed or not.
Now this means stuff "magically" works, but this means as an app and vendor grow. Copious time is spent merely figuring out if some input file changed or not.
We have several options, likely worth exploring. Most affective would be:
- only watch
app/styles
by default - give users an API to add additional "input paths"
An example API could be:
var app = new EmberApp();
app.cssPaths.concat([
app.name + '/styles/**/*.scss',
'bower_components/material-design-lite-src/src/**/*.scss'
]);
Another thing, would be to add matcher, to only both detecting specific file types. This will require some fixes to our change detection, but again may yield a good win.
Unfortunately, I am unclear if such a matcher exists. Would it be possible for us to only watch files with the following extensions? .css
.scss
.sass
?
Some recent micro-optimizations that yield a nice boost: (reducing costs of stats + crawls by 2x), but ^ would be a substantial win in many cases.
part 1: https://github.com/aexmachina/broccoli-sass-source-maps/pull/5 part 2: https://github.com/ember-cli/broccoli-caching-writer/pull/58
Hey Stef, I've added you to this repo as well.
@stefanpenner only watching app/styles
would make pod styles difficult to handle, would it not? We shouldn't make users manually enter every pod they use.
Any progress on this issue @stefanpenner?
Do you have any agreement on what an API would look like? I'm keen to help implement this as this bottleneck is adding 30 seconds to my cold starts (when using npm linked modules) and 2-3 seconds to each rebuild.
I hacked together an addon that passes a tree containing only /app/styles
to this addon. This effectively allows me to control exactly what goes into my sass pipeline. It sped up my cold builds by 1/3rd and rebuilds by 2/3rds.
https://github.com/dmfenton/ember-cli-prune-style-tree
@dmfenton @stefanpenner would be the best person to ask about this. Stef any thoughts on this? Is there someone else that would be good to speak to about this?
Are there any updates on this one? ember-cli-prune-style-tree doesn't seem to be a drop-in solution for us.
@stefanpenner Any news?
Thanks to @dmfenton's addon our rebuild times were reduced by 2/3 (from about 7 seconds to about 2). This should be part of ember-cli-sass!
Sounds interesting. Can you send a link and we'll have a look.
-- Simon Wade - Chief Technical Officer jtribe - love your apps 13/243 Collins Street, Melbourne VIC 3000 [email protected] | +61 422 777 262 <+61422777262> | http://jtribe.com.au
It's the one he posted above: https://github.com/dmfenton/ember-cli-prune-style-tree
I'm not sure if it works for every use case but we haven't had any problems with it.
We just had problems with compiling in-repo-addon styles using the app's outputPaths option. After some debugging I remembered installing above mentioned ember-cli-prune-style-tree addon. It only allows styles in the app directory to be compiled. So beware. If other people should run into the same problem here is what the error message looks like:
File not found: \app\styles\themes\addon\app.scss
in any of the following include paths:
...\tmp\sass_compiler-input_base_path-PuGpRr2a.tmp