Skip to content

Conversation

@xogg
Copy link

@xogg xogg commented Jul 17, 2016

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
Copy link
Member

mauritslamers commented Jul 18, 2016

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
Copy link
Member

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

@nicolasbadia
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants