Skip to content

Comment on Show HN: fancy-pants 5K lib for Custom Elements with reactive dirty tracking

Comments

Condensed History (from author):

I really liked the idea that a JS class could represent a custom element. But the need to know when something should be rendered or not and knowing what to update was always a large ask and the reason VirtualDOM like libs were made. In this case I leveraged the ideas of tracking changes by means of tracked proxies which result in memoized function calls. Thus a Component can be split into two simple responsibilities: DOM update code and noting when something tracked is changed.

The big win here is that VanillaJS can leverage the idea of auto-tracking in that only one tracked thing needs decorating and any call stack that touches that one thing will be auto-recomputed when needed.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.