dustjs icon indicating copy to clipboard operation
dustjs copied to clipboard

Mini version of Dust with sync rendering apis only

Open vybs opened this issue 11 years ago • 5 comments

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

vybs avatar Jun 06 '13 02:06 vybs

@rragan

vybs avatar Jun 06 '13 16:06 vybs

Did you accidentally nuke my comment?

rragan avatar Jun 06 '13 16:06 rragan

nope. I dont think so. not on this for sure :-)

vybs avatar Jun 06 '13 16:06 vybs

+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

jimmyhchan avatar Jun 06 '13 21:06 jimmyhchan

Is there a way to use this in a sync fashion? i like the syntax but don't need no callbacks 👽

dcsan avatar Aug 20 '16 20:08 dcsan