-
Notifications
You must be signed in to change notification settings - Fork 1
Runtime
The eQuantic.UI Runtime is the library that brings the application to life in the browser. It is responsible for transforming the virtual tree generated by the compiled code into real DOM elements and reacting to state changes.
Unlike frameworks that recreate the entire DOM, the eQuantic.UI Reconciler compares the current page with the desired new version and applies only the minimum necessary changes.
-
Type Comparison: If a node has changed its tag (e.g.,
divtospan), it is replaced entirely. - Attribute Update: Only modified attributes are changed in the DOM.
- Child Management: The reconciler recursively traverses the list of children.
With the introduction of Keyed Diffing, the reconciler now supports the key property.
- If two nodes in different positions have the same key, the framework understands that the element has been moved, preserving the browser's internal state (such as the cursor position in an input or the scroll state).
To prevent memory leaks, the runtime uses an event tracking system based on WeakMap.
- Event listeners are mapped directly to the
HTMLElement. - When an element is removed from the DOM and there are no more references to it, the browser's Garbage Collector can automatically clear the event metadata, ensuring that the application's memory consumption remains stable even in long sessions.
The runtime supports the "Hydration" process, where it takes control of HTML already rendered by the server (SSR). Instead of destroying and recreating, the runtime only attaches the necessary event listeners to the existing elements, ensuring an instantaneous initial load.