metapolator/metapolator — pull request #214 by graphicore (2014-10-08 11:47:03+00:00)
Title: @import

This is the first round of trying to implement `@import`. We'll need some iterations to get this ready.

In the file `app/lib/models/CPS/parsing/atImportFactories.js` a Todo list can be found with the most important tasks for the moment, I reproduce that here, for easier discussion:
from https://github.com/graphicore/metapolator/blob/b03a4b65ee65024d64e60a30a5fa119ea97f7d2e/app/lib/models/CPS/parsing/atImportFactories.js#L72

* at this point: at least "io" and "parameterRegistry" MUST be somehow given by the code that invoked the parser in the first place!
* it is desired to create and return a special subclass of ParameterCollection => AtImportCollection. This will be a good marker for us and allow for all kinds of specialization!
* This could be done by using a (sub-)version of parameterFactories that overides the "stylesheet" factory, which is declared in baseFactories.
* when printing the new subclass of ParameterCollection we will wrap the output into special comments mentioning that the source of the rules is a `@import`
* This change breaks the red pill on a deep level: *changing one of these rules should propagate to all instances where this file was imported.*
* ALSO: When a change to this file happens, a reloading of the affected styles MUST NOT read this files version from disc, but use the buffered version as a source. So that all occurences of the imported rules stay in sync