eco icon indicating copy to clipboard operation
eco copied to clipboard

Improved web performance and size

Open dleclere opened this issue 12 years ago • 9 comments

I am currently working on a web application using eco templates for both the server and client. The plan is to pre-compile the templates using brunch and load keep them in the main build file. I just had a look at the minified output and I was horrified at what eco had done.

  • It pushes many meaningless lines to the output array,
  • preserves multiple recurrent white-spaces when just one white space would be appropriate,
  • and leaves html comments in... for fun?

So in light of this I modified the preprocessor and utilities slightly and corrected these issues.

Later I would like to modify eco further so that it didn't build a copy of its base functions into every template it rendered and instead shared some code brought in through a require. This would reduce the framework agnosticism presently enjoyed by eco, so I am going to have to think about it a little more...

dleclere avatar Jun 07 '12 00:06 dleclere

bump this - do you have a repo i can look at? I'm also looking at moving out the eco base functions, and am also looking at putting them into someplace where you can also define custom global helpers that can be included into the template (just like __obj.safe and __obj.escape) and access the template's current context.

asyraf9 avatar Jun 08 '12 06:06 asyraf9

I wanted to use eco for config file generation and I also need that whitespace fix to make it work properly. After all eco statements in the code newlines are inserted which makes the output very ugly. :+1: this.

Philipp15b avatar Jul 15 '12 11:07 Philipp15b

bump, I'd really like to see this idea of cleaner compiled templates.

aeischeid avatar Sep 07 '12 22:09 aeischeid

this seems like a great PR — is eco still under active maintenance? is there a more active fork of this repo somewhere?

mbhnyc avatar May 27 '13 15:05 mbhnyc

bump. Want to take over @Philipp15b ?

mbhnyc avatar Jun 05 '13 04:06 mbhnyc

Has anybody tried pinging @sstephenson or anyone else listed as a maintainer directly? They may not be watching the project and may not be getting notified when someone comments.

michaelficarra avatar Jun 05 '13 06:06 michaelficarra

@mbhnyc Unfortunately, I'm not a user of eco anymore (partly due to the flaws mentioned above).

Philipp15b avatar Jun 05 '13 08:06 Philipp15b

What are people switching to, out of curiosity? The core feature of eco (embedded CS) I've enjoyed using quite a bit..!

mbhnyc avatar Jun 05 '13 12:06 mbhnyc

haven't tried it out yet but have been keeping an eye on https://github.com/baryshev/ect

aeischeid avatar Jun 05 '13 21:06 aeischeid