Well, can someone tell me what is HTMLbars good for?

Basically I’m a PHPer, and also know a bit of nodejs and emberjs (now). I’ve already learn a lot of template grammar,

smarty, twig in php ejs in nodejs/express

when setup personal website in github, i also learn Liquid (Redirecting…). when learning backbone, there are underscore template; then when learning angularjs, itself has a lot of ng-*…

i feel xhandlebar is ok now (though i doubt why not just use underscore template?)

If you say “hey, because HTMLbars based on dom element and xhandlebar based on string”, but that’s the reason why i like emberjs not angularjs. In my mind, angularjs is so smart that it did a lot of things which should be done by browser itself in future (or the environment)…

So basically i’m supporting xhandlebar, or underscore template grammar even better…

3 Likes

I’m having a little hard time understanding the question. It’s a question and then it’s not a question?

HTMLBars is a template engine. From the app developer’s perspective, that is it. It’s API interface is identical to what Handlebars have.

HTMLbars is a drop in replacement for handlebars. They’ll share a syntax but will make it very fast and easy to use Ember.

Mostly the difference between htmlbars and handlebars is the output not the input.

1 Like

Can i say that HTMLbars defined a shadow dom for templating, and handlebars just use string? I mean is it is right in tech (just like angularjs is smart), but i think it should be done after (Shadow DOM) .

Or else, it will be similar like angularjs’s templating, for example:
click (pure js environment) vs ng-click vs ?? ( in HTMLbars, cause it based on dom now? )
vs
{{action “doSomething”}} <= i like this one, because it appears not to do the same work.

Hey @yarco, sorry for the delay in response.

I’m not sure if it technically implements a shadow DOM. I believe HTMLbars just implements your views as DOM fragments in memory. This makes it really easy to manipulate view layer without having to read in a string, which is what I believe currently happens with Handlebars. Here’s the architecture of HTMLbars written in the repo for HTMLbars, read Architecture.md. It explains a lot better than anything else what is trying to be achieved by using HTMLbars.

Also, Erik Bryn’s talk on HTMLbars touches on some nice points as well.