4 ms·
Is anyone using pure.js? That's been one on my radar since they use pure HTML templates with JSON models. I don't think it does data binding to update the templ
by zzzmarcus 16y ago
Is anyone using pure.js? That's been one on my radar since they use pure HTML templates with JSON models. I don't think it does data binding to update the template automatically after the first render if the model changes, but apart from that, it seems preferable to using custom templates like jQuery or Mustache etc.
http://beebole.com/pure/ http://beebole.com/pure/
That having been said, I haven't started using it yet. I'm open to other viewpoints.
- tchvil 16y agoI wrote it. What makes jQuery and Mustache preferable? I know pure.js is different, but having the HTML clean of any tags or logic is something new and very flexible.
- zzzmarcus 16y agoThat's what I was saying. From what I've seen, pure.js does seem preferable to using Mustache or jQuery templates. I was curious if anyone else had other feedback after using it. The reason I am considering it is to be able to use Ruby erb templates on the server to initially populate data on a page, then use pure.js and its directives to treat that same HTML as a javascript template. With mustache or jquery templates and everything else I've seen, you're tied to rendering at least some basic empty HTML first, then populating it with javascript templates once javascript is ready. I've messed around with it some and it seems to work fine. I guess my question is why isn't everyone doing it this way? :)
- tchvil 16y agoI guess people feel at home with a double-brackets template engine. It mimics what exist server side for ages. A pity as HTML in the browser is a DOM, not a sliced string.