jstransformers / jstransformer

Normalize the API of any JSTransformer.
http://npm.im/jstransformer
MIT License
153 stars 12 forks source link

pixie #182

Closed tunnckoCore closed 7 years ago

tunnckoCore commented 7 years ago

https://github.com/jamen/pixie

@jamen looks cool. Maybe inspired by tagged templates, haha? Good job.

jamen commented 7 years ago

Hey! Thanks.

A lot of my projects are just little tests and experiments so I can learn more. I created this one because I wanted a tiny templating engine (< 100 LOC there), runs client side for another project I was doing, and contains no dependencies. Decided I would make it a standalone thing.

For small templates (e.g. formatting string) you want to template, it should be faster than most options.

But, It's not designed very scalable unfortunately. Something like handlebars would be better as the template gets bigger and bigger (you can see some benchmarks I made in the repo). However, I'm open to ideas and PRs.

jamen commented 7 years ago

Oh I forgot, one of the bigger aspects I like about pixie though is the array piece.

You can preparse templates into arrays, pass them off to other functions for manipulation, and reuse them, or serialize as JSON. Feels more useful than the typical render(template)(locals) with no interpolation.

jamen commented 7 years ago

Thanks for reminding me btw! I'm going to revisit and change some things now.

tunnckoCore commented 7 years ago

You can preparse templates into arrays, pass them off to other functions for manipulation, and reuse them, or serialize as JSON.

Yea looks interesting. I also have few template engines in my account that are small - one is the 140bytes implementation by Jed Schmidt - j140, another is by AbsurdJS - octet, and the third is using tagged templates - gana/gana-compile. Actually started updating es6-template to v2 using gana and gana-compile, but another more important thing popuped and they are uncomplete now.

jamen commented 7 years ago

Awesome! es6-template reminds me of a fun little thing I did called lazy-template (which is made on top of pixie). Although it's less useful because it uses actual template literals. Just little point-substitution module.

RobLoach commented 7 years ago

https://github.com/jstransformers/jstransformer-pixie :+1: .... Pretty neat. Could add some Engine supports in the options array there too.