Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav...
by h3mb3 on Tuesday July 20, 2021 @03:30AM
(#27890940)
What does "agnostic" really mean here? Or, how is something like React not "agnostic"?
[ Parent
| on HN ]
Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav...
by dumindaxsb on Tuesday July 20, 2021 @04:17AM
(#27891175)
It's 100% interoperable with Native DOM API.
Basically, CalDOM's reactivity system does not care how the Element is created as long as it's a Native DOM Element/Node.
It could be _("+div") or document.createElement("DIV") or even jQuery("<div></div>")
See example: https://caldom.org/#reactive-native-node
Also, a CalDOM instance is just a wrapper around Native DOM Element(s).
_("div").elem === document.querySelectorAll("div")[0]
This interoperability allows for powerful integrations & to update the DOM directly by avoiding expensive virtual-DOM diffing.
In React's world, everything is micro-managed(there're pros & cons), accessing DOM directly can be chaotic & usually not recommended.