eco icon indicating copy to clipboard operation
eco copied to clipboard

Reduce code duplication with multiple compiled eco templates

Open Philipp15b opened this issue 13 years ago • 3 comments

So I wanted to use eco client-side and I noticed that eco pre-compiles all the helper functions in every single one of the compiled templates.

This could be solved by maybe allowing the compiler to use a global eco object which would then contain the helpers.

This was also mentioned in #48.

Philipp15b avatar Aug 04 '12 19:08 Philipp15b

Yes, would be nice to prevent it, maybe something like

eco = require 'eco'

bundle = [
  eco.head()
  eco.precompileWithoutHead(tmpl1)
  eco.precompileWithoutHead(tmpl2)
  ....
].join("; \n")

al6x avatar Aug 08 '12 21:08 al6x

+1 for this optimization! We just noticed this duplication as well, and were immediately looking for a way to cut it out, but got lost in the details of why it is there in the first place.

aeischeid avatar Sep 07 '12 22:09 aeischeid

Any news for this? At least is this feature will be accepted or rejected?

al6x avatar Oct 02 '12 15:10 al6x