I'm interested to hear an alternative, particularly one that will work with separate front end dev teams etc.
<div class="greeting-container" data-lift="SayHello"><span class="greeting">lorem ipsum</span></div>
And a transformation: ".greeting *" #> "Hello World"
The output will be: <div class="greeting-container"><span class="greeting">Hello World</span></div>
See http://exploring.liftweb.net/master/index-5.html#entry-CSS-T... et aliaWith this technique, your designers can create pure HTML and assets, with no logic in the templates. Basically they create static mock-ups and then the developers "enliven" them.
I prefer this but I don't imagine it will ever become mainstream.
React's JSX is also (as far as I can tell) node based, but with a lot less power (you can really only do insert operations, and the operations don't really compose well).
'(p "hello" (strong "jamespo"))
Before you say "ahhh the parens!", there are special readers such as Racket's Pollen that provide a less Lispy, but still powerful, language for writing documents.For JavaScript, there's of course a bunch of options such as Mithril:
m("p", ["hello", m("strong", "jamespo")]);
I don't write Go so I don't know what the options are there. Just trying to raise awareness for safer programming.For much more in-depth information about the problem, see: http://www.more-magic.net/posts/structurally-fixing-injectio...