5 ms·
I was inspired by this project for Node: https://github.com/hij1nx/weld https://github.com/hij1nx/weld And I tried the concept using Nokogiri in Ruby. I found
by luigi 15y ago
I was inspired by this project for Node:
https://github.com/hij1nx/weld https://github.com/hij1nx/weld
And I tried the concept using Nokogiri in Ruby. I found that in practice it gets really tedious. I had to make sure that every single element I wanted to manipulate had a unique id. Then I had to account for updating the content of an element versus an arbitrary attribute for that element. Or adding an attribute, like some data-* attribute. I realized why string interpolation is just so much easier.
There's also the problem where the DOM parser changes the original HTML in some way. How will it deal with conditional comments for IE? Or slightly malformed HTML that you want to keep that way?
I ended up going back to Handlebars.