Open RobLoach opened 8 years ago
Personally, I think piping should be a higher level concern, not something we handle at this level. Our transform's uniform interface is a string, rather than an AST, so we don't need to think about splitting out parse/compile stages. I think we should avoid the added complexity.
I think we should avoid the added complexity.
:+1:
@RobLoach Also, i thought for it when you posted the issue, but. Can you show some example (with multiple transformers) and what you would expect?
It would be too complex to be implemented, even without unified
, base
, use
or any other thing like that.
I can think only for one example that may be useful:
str -> Rework (or some pre-processor) -> PostCSS -> output
Or okey, another think... str -> [mustache ->] handlebars -> htmlmin -> output
, but what if one jstransformer supports only async api? And more questions pops up, imho.
https://www.npmjs.com/package/unified
Would end up being like the following:
Or https://github.com/jonschlinkert/base-methods may be another option.
Using this API would allow easy piping between the Transformers.