Introducing Our New Templating Engine



  • Are there any current themes written in benchpress which we can poke around at?


  • Admin

    @fish the syntax hasn't changed, so actually all of the existing themes are benchpress compatible...



  • Well, for me NodeBB works great. I run it on a micro instance and resource consumption is very low. There were some minor issues, but overall I'm very happy with it. I just don't use plugins which are unsupported, i think this is a common sense when deploying open source code developed by community. I think it could be useful (and it will help to avoid a lot of confusion) if we put plugins into different categories: stable (always tested with every new release of NodeBB), and unstable (use at your own risk), this model works well for Debian Linux, that has three branches: Stable, Testing and Unstable (sid).


  • Admin

    @arutemu Thanks for the feedback, we're always looking to establish new release practices.

    We have stable branches, namely the release branches (e.g. v1.5.x). master and develop are both considered development branches.



  • Why didn't you use Twig.js? Twig.js is the fastest template engine in javascript, and also the most powerful. You can look at the design, every possible optimization is made.


  • Global Moderator

    @razr-world twig is not compatible with templates.js syntax.

    Also, it's tough claiming to be faster than Benchpressjs. I haven't seen any benchmarks comparing the two.


  • Admin

    @pitaj Didn't you run your own benchmarks against comparable templating engines? I'd love to see those results posted...


  • Community Rep

    @razr-world I don't see anywhere that makes these claims, but they both compile to JS, so the performance should be similar.

    I'd like to see actual benchmarks as well.


  • Global Moderator

    template-benchmark

    There you go, published results. It looks like Twig.js is even slower than templates.js was, and much slower than Benchpress. I am a little dubious of those results, though, as I could have easily messed something up in the benchmark.


  • FreeBSD/OpenBSD

    There's one more breaking change that I did not find documented anywhere.
    For our theme we had to change:

    	var templates = require('templates.js');
    	templates.registerHelper('generateCategoryBorder', helpers.generateCategoryBorder);
    

    to

    	var Benchpress = require('benchpressjs');
    	Benchpress.registerHelper('generateCategoryBorder', helpers.generateCategoryBorder);
    

    Not a big deal but some folks might struggle to see why their template helpers don't work on server side.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.