CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 38
Abstract the real DOM from the Virtual DOM #559
Description
Enhancement
This is a proposal to remove all access points to DOM Elements that are created via the v()
and w()
functions and managed through the Dojo 2 widget system.
When nodes
are created through the Dojo 2 widget system leveraging the v()
and w()
functions, accessing DOM nodes can contravene the reactive architecture pattern and encourage widgets to become stateful, or at worst indeterminate
There are currently 2 first class supported mechanisms that enable consumers to gain DOM references on successful Element creation and Element updates - onElementCreated
and onElementUpdated
.
Note: Both these hooks will be deprecated and eventually removed as part of these changes.
It is recognised that attributes from the DOM are required in order to create the UI layout desired, animations, focus (and more) and as part of this proposal, enhancements (linked to this epic) to widget-core
will be completed to allow consumers to access this information in a readonly, reactive nature.
Finally, there will be occasions where needing a DOM Element is the only way to achieve certain functionality, i.e. working with external libraries that create their own DOM nodes - for these cases widget-core
provides a higher order component called DomWrapper
that wraps manually created DOM nodes and places them in the virtual DOM tree, while still allowing you to write to it in a reactive manner.
Supporting features for replacing direct DOM access are:
- DOM Meta Mechanism
- Focus management
- Synthetic Events
- DomWrapper