Re:Show HN: Moon – fast 7k Vue alternative
by allover on Saturday August 26, 2017 @06:38PM
(#15107857)
Also see hyperHTML [1] which is same idea, but predates lit by some months. Comparison here [2].
[1] https://github.com/WebReflection/hyperHTML [2] https://gist.github.com/WebReflection/fadcc419f5ccaae92bc167...
Re:Show HN: Moon – fast 7k Vue alternative
by leeoniya on Saturday August 26, 2017 @05:17PM
(#15107510)
were you aware of https://github.com/trueadm/t7 when you started?
are there advantages over t7, other than NIH?
Re:Show HN: Moon – fast 7k Vue alternative
by spankalee on Saturday August 26, 2017 @05:46PM
(#15107664)
T7 is quite a bit larger than lit-html, and requires a vdom reconciler still. lit-html is self-contained and < 2k minified and gzipped.
I also didn't want to use vdom because it doesn't encode whether nodes are static or dynamic, and even static sections are diffed. That's extremely important feature for performance and memory overhead, which is why I'm happy to see that emphasized in Moon.
Also, coming from the Polymer team, where we've had a lot of success using <template> elements to stamp out large pre-defined DOM trees, I wanted a system backed by those.
Template literals in JS give us a way to always tell the static from dynamic parts of a template. HTML <template> elements let us stamp out pre-defined trees of DOM quickly. Combined we can then only update the dynamic parts without a virtual DOM.