Slower than Vanilla JS
at unit level
faster than React
performant DOM updates
View benchmark results against Vanilla JS, Vue JS, React JS, jQuery & more.
Instead of pulling you into a library-specific magical world, CalDOM let you fully access the DOM directly while keeping the reactivity.
A 2-in-1 virtual-DOM & no-virtual-DOM approach if you will.
So you could take full advantage of native APIs & mix it with other libraries to gain superior performance & flexibility in the development process.
Zero tooling, zero dependencies, zero new syntax, just pure JS.
Use it as a chainable DOM traverser and a manipulator, a lightweight jQuery alternative.
We use _ (underscore) to access CalDOM.
Build reactive components. Use it as a lightweight React JS/Vue JS alternative.
Not using classes, similar to React Hooks, but simpler.
Also works as an extended ES6 class.
Native DOM Node is a first-class citizen. Also, a CalDOM instance is just a wrapper around them.
This agnostic interoperability allows for an infinite amount of powerful integrations.
Not a fan of rendering & virtual-DOM thingies? Use CalDOM to update() pre-defined HTML content reactively.
CalDOM's API is inspired by jQuery.
Efficiently update() the DOM directly and/or proceed to virtual-DOM render if it's more suitable.
Use this.$ to hold direct DOM Node references. CalDOM keeps them in sync even when render() drastically alter the DOM structure.
CalDOM integrates seamlessly with Web Components.
Use CalDOM to create stateful & reactive Web Components. It also accepts web components as inputs.
You can use these custom elements in HTML code natively as usual.
Create future-ready declarative modern web apps. Currently, native browser support for Web Components is at 95% & expected to play a primary role in future web development.🔮
Basic building box of CalDOM is just native Node/Element. Thus, making it compatible with almost any DOM library on the web.
CalDOM does not dictate your coding style or approach. It's super flexible & scalable from a single element to large nested implementations.
CalDOM renders a virtual-DOM and efficiently updates only changed elements in the actual DOM.
Multiple renders are batched to only run once.
CalDOM plays nicely with nested reusable reactive components and takes care of all DOM updates efficiently.
No matter how deeply nested, components only get re-rendered if their state is changed.
Use CalDOM for server side rendering.
You can use a library like JS-DOM to implement a browser context on the server.
Fetching and rendering content generated in the server.
Please note that we did not use classes to keep the examples simple without HTML & CSS. But in practice, always prefer using external CSS over directly setting CSS on elements due to obvious reasons. CalDOM has addClass(), removeClass() methods to facilitate this.
Multiple element instances, built-in XPath support & there is much more
View more examples in the DocumentationCalDOM is extensively tested on Chromium. Firefox & other browsers to be tested specifically. CalDOM is using native, time-tested official DOM API under the hood. Thus, it should work just fine with any modern browser. Minimum browser support based on MDN compatibility specs is listed below.
CalDOM does not address bugs and loosely implemented web standards of legacy browsers like IE.