sproutcore / build-tools

SproutCore Build Tools
12 stars 7 forks source link

Scss files support #63

Open xogg opened 8 years ago

xogg commented 8 years ago

Content Filters Adds a new abstract file type BT.CodeFile with content filtering support implemented via a BT.ContentFiltersMixin. With content filtering mixed in, a chain of filters may be defined for a processable file with purpose of parsing, replacing known fragments or any other kind of processing.

sc_static() / static_url() support Implemented as JavaScript functions in node-sass. all targets are inserted into the file's resourceDependencies, so linked resources would be processed in BUILD run mode.

Dependency tree All @import's in .scss files are intercepted and a tree of dependencies is maintained. Updating an imported file leads to the update of all master files on top of its dependency chain.

mauritslamers commented 8 years ago

I like the idea a lot, because I see its value for the script files as well as base class for scripts and styles of any kind. I am unsure about this implementation. First of all, the class name is a bit vague, BT.FilteredFile would be better IMHO. Secondly, I think that this doesn't need to be done through mixins, mainly because if the normal extending procedure is used, you can use concatenatedProperties (http://docs.sproutcore.com/#doc=SC.Object&method=concatenatedProperties&src=false) to automatically attach new filtering to the end of the filtering procedure. Moreover, if the filters themselves are implemented as cached computed properties, it could mean a speed up for any processed file.

The purpose of the class itself is to simply apply all the filters in a row. Thoughts?

nicolasbadia commented 8 years ago

Very nice work! I agreed with Maurits for the implementation details.

nicolasbadia commented 8 years ago

I thinks we should also move most of the BT.CSSFile logic into BT.SCSSFile, and extend BT.CSSFile from BT.SCSSFile.