Re:Show HN: 0-dependency, granular, min-diff UI view updates...
by graderjs on Monday April 19, 2021 @05:49AM
(#26860851)
Instead of a virtual DOM, this uses closures to update parts of a nodes text content, attributes and child nodes. There's a pinch of syntactic sugar to let you add event handlers directly into the template literal, and two dashes of template tag functions: s to provide singletons that can be keyed, and always update their existing slot in the DOM, and c to generate new DOM that you can slot anywhere when you don't need minimal updates or keyed components.
It's inspired by React and Custom Elements and aims to use existing HTML and DOM APIs in the most efficient and tactile (developer friendly) way possible.
If you know your way around DOM, you probably know how to use this.
Apologies on the README, it's a work in progress. This title and comment is a much better description of what it does, where it comes from and why.
Hope you enjoy! Come contribute. If you want to see some examples, check out the tests directory. I'm using this in production for more than 2 years.
Re:Show HN: 0-dependency, granular, min-diff UI view updates...
by graderjs on Tuesday April 20, 2021 @01:32AM
(#26871037)
Thanks. Yeah that's also a very inspiring micro framework to me. A bunch of people seemed to create new frameworks around the same time, me included, i think in part as a reaction to the main ones.
It's inspired by React and Custom Elements and aims to use existing HTML and DOM APIs in the most efficient and tactile (developer friendly) way possible.
If you know your way around DOM, you probably know how to use this.
Apologies on the README, it's a work in progress. This title and comment is a much better description of what it does, where it comes from and why.
Hope you enjoy! Come contribute. If you want to see some examples, check out the tests directory. I'm using this in production for more than 2 years.