TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: BDC – Ergonomic, sub 1KiB virtual DOM library

23 pointsby bwhmatheralmost 3 years ago
BDC is a simple library for updating the DOM to match a javascript description. Does not require JSX or a compilation step.<p><pre><code> clobber( document.body, h(&quot;marquee&quot;, [ h(&quot;span&quot;, {&quot;style&quot;: &quot;font-weight: bold&quot;}, &quot;Hello&quot;), &quot;, &quot;, h(&quot;blink&quot;, &quot;world&quot;), &quot;!&quot;, ]), ); </code></pre> Very fast to first render, moderately slow on subsequent updates.<p>Prompted by the post on millionjs, which compiles user code to hit the same outrageously small size target.

1 comment

sodalmost 3 years ago
I always wonder why github doesn&#x27;t do something like this. Right now they return html via ajax and innerHTML it into the DOM. Given that innerHTML is notoriously slow, returning something like this should be way faster.<p>Your lib seems to lack svg &amp; @types support though. And I don&#x27;t know why you have &quot;virtual DOM&quot; in the title, given that it has nothing to do with it :)
评论 #32308979 未加载
评论 #32307794 未加载