wip: moving to imperative method of dom
This commit is contained in:
1 parent
91f1b00517
commit
45ee803609
7 files changed
+321
-197
No files matched your search
@@ -1,23 +1,57 @@
|
||||
# This module includes all life-cycle related mechanics, including the virtual DOM, scopes, properties, and lifecycles.
|
||||
|
||||
---
|
||||
|
||||
The VirtualDom is designed as so:
|
||||
|
||||
VDOM contains:
|
||||
|
||||
- An arena of component scopes.
|
||||
- A scope contains
|
||||
- lifecycle data
|
||||
- hook data
|
||||
- A scope contains
|
||||
- lifecycle data
|
||||
- hook data
|
||||
- Event queue
|
||||
- An event
|
||||
- An event
|
||||
|
||||
A VDOM is
|
||||
|
||||
- constructed from anything that implements "component"
|
||||
|
||||
A "Component" is anything (normally functions) that can be ran with a context to produce VNodes
|
||||
|
||||
- Must implement properties-builder trait which produces a properties builder
|
||||
|
||||
A Context
|
||||
|
||||
- Is a consumable struct
|
||||
- Made of references to properties
|
||||
- Holds a reference (lockable) to the underlying scope
|
||||
- Is partially thread-safe
|
||||
- Made of references to properties
|
||||
- Holds a reference (lockable) to the underlying scope
|
||||
- Is partially thread-safe
|
||||
|
||||
# How to interact with the real dom?
|
||||
|
||||
## idea: use only u32
|
||||
|
||||
pros:
|
||||
|
||||
- allows for 4,294,967,295 nodes (enough)
|
||||
- u32 is relatively small
|
||||
- doesn't add type noise
|
||||
- allows virtualdom to stay completely generic
|
||||
|
||||
cons:
|
||||
|
||||
- cost of querying individual nodes (about 7ns per node query for all sizes w/ nohasher)
|
||||
- old IDs need to be manually freed when subtrees are destroyed
|
||||
- can be collected as garbage after every render
|
||||
- loss of ids between renders........................
|
||||
- each new render doesn't know which node the old one was connected to unless it is visited
|
||||
- When are nodes _not_ visited during diffing?
|
||||
- They are predetermined to be removed (a parent was probed)
|
||||
- something with keys?
|
||||
- I think all nodes must be visited between diffs
|
||||
-
|
||||
|
||||
## idea: leak raw nodes and then reclaim them on drop
|
||||
|
||||
## idea: bind
|
||||
Reference in new issue
Block a user