dustjs
dustjs copied to clipboard
Mini version of Dust with sync rendering apis only
How about creating a mini version of dust-core that does not have the stream functionality and loadSource. It benefits use cases where we do not need any loadSource, since all templates are precompiled on server. it could benefit from less parsing of dust.js as well
for instance group the stream apis into a separate module and made dust more modular
@rragan
Did you accidentally nuke my comment?
nope. I dont think so. not on this for sure :-)
+1 on cleaning up the code and breaking it up but -1 for removing methods.
Some concern:
- Creating a separate project would cause a lot of fragmentation. Hopefully, we are just talking about a build version that is "Optimized"
- We should continue to support Node.
- We should continue to support the full API (do not remove stream)... instead we should focus on tightening up the calls that are made most. If the user never uses stream, the perf differences of the stream code simply existing is negligibly small.
Regarding Modularity, Dust can be detangled quite a bit. I did some work in #192
- Parser doesn't actually depend on dust so don't pass it to parser.
- Compiler depends on the parser and not dust. Stop passing dust to the compiler. Instead of dumping everything into the dust object, return/export a compiler object that exposes specific methods (e.g. compile, optimizers).
- the full source should have the parser place before the compiler. You can't compile without parse but you can vice versa.
- Serverside Dust is supported weirdly by the
require server
call. This should have been done as a build step
Some more thoughts
- We should migrate from the archaic Make file to Grunt. We get Uglify, unit testing, robust build features, compression support, etc.
- Provide a Grunt Task/Build option that would build with AMD wrappers
Is there a way to use this in a sync fashion? i like the syntax but don't need no callbacks 👽