Show HN: BDC – Ergonomic, sub 1KiB virtual DOM library
23 points| bwhmather | 3 years ago |github.com
clobber(
document.body,
h("marquee", [
h("span", {"style": "font-weight: bold"}, "Hello"), ", ",
h("blink", "world"), "!",
]),
);
Very fast to first render, moderately slow on subsequent updates.Prompted by the post on millionjs, which compiles user code to hit the same outrageously small size target.
sod|3 years ago
Your lib seems to lack svg & @types support though. And I don't know why you have "virtual DOM" in the title, given that it has nothing to do with it :)
chrismorgan|3 years ago
If you’re changing from one thing to another very similar thing, then doing precise edits makes sense. But if you’re changing structure significantly, then doing precise edits will be slower than just clobbering it all by setting innerHTML.
klysm|3 years ago
sxspartshouse|3 years ago
[deleted]