You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/ticket-asymmetric-vdom-updates.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,25 +16,25 @@ We will introduce a new manager to act as a central orchestrator for all collisi
16
16
### 1. New Class: `Neo.manager.VDomUpdate` (Orchestrator)
17
17
- This new singleton manager will **not** schedule or delay updates.
18
18
- It will contain two maps to manage all collision scenarios:
19
-
-`mergedCallbackMap`: Stores callbacks for **pre-flight merges**.
19
+
-`mergedCallbackMap`: Stores callbacks and relevant update depth information for **pre-flight merges**.
20
20
-`postUpdateQueueMap`: Stores child components that need updating after an **in-flight collision**.
21
21
- It will expose methods to be called by the `VdomLifecycle` mixin:
22
-
-`registerMerged(ownerId, childId, callbacks)`
23
-
-`registerPostUpdate(ownerId, childId)`
24
-
-`executeCallbacks(ownerId)`
22
+
-`registerMerged(ownerId, childId, callbacks, childUpdateDepth, distance)`: Stores the child's callbacks, its `updateDepth`, and its `distance` from the owner.
23
+
-`registerPostUpdate(ownerId, childId, resolve)`
24
+
-`executeCallbacks(ownerId)`: This method will also be responsible for calculating the maximum required `updateDepth` for the `ownerId` (parent) based on the `childUpdateDepth` and `distance` of all merged children. It will then set the `ownerId` component's `updateDepth` to this calculated maximum *before* the parent's `update()` method is called (if `needsVdomUpdate` is true).
25
25
-`triggerPostUpdates(ownerId)`
26
26
27
27
### 2. `VdomLifecycle.mjs` Refactoring
28
28
- The core, high-performance update logic (`updateVdom`, collision detection) will remain.
29
-
-**Pre-Flight Merge:** When an update is merged (e.g., in `mergeIntoParentUpdate()`), it will now call `Neo.manager.VDomUpdate.registerMerged(...)` instead of manipulating local caches.
29
+
-**Pre-Flight Merge:** When an update is merged (e.g., in `mergeIntoParentUpdate()`), it will now call `Neo.manager.VDomUpdate.registerMerged(parent.id, me.id, me.resolveUpdateCache, me.updateDepth, distance)` instead of manipulating local caches.
30
30
-**In-Flight Collision:** When an update collides with an in-flight parent (in `isParentUpdating()`), it will call `Neo.manager.VDomUpdate.registerPostUpdate(...)`. The child component will still set its own `needsVdomUpdate = true` and hold its own callback in its `resolveUpdateCache` for the update it will eventually run.
31
31
-**On Update Completion:** When a root update cycle finishes, its `then()` block will call both `manager.executeCallbacks(this.id)` and `manager.triggerPostUpdates(this.id)`.
32
32
- This change allows for the complete removal of the complex `childUpdateCache` property and simplifies the logic around `resolveUpdateCache`.
- This part of the plan remains crucial and unchanged.
36
36
-`getVdomTree()` and `getVnodeTree()` will be refactored to honor the `updateDepth` of each individual component.
37
-
- If a child component is excluded from an update, a lightweight placeholder object `{componentId: 'neo-ignore', id: childComponent.id}` will be inserted into the tree to preserve its structural integrity.
37
+
- If a child component is excluded from an update, a lightweight placeholder object `{componentId: 'neo-ignore'}` will be inserted into the tree to preserve its structural integrity.
- The VDOM worker's `createDeltas()` method will be enhanced to recognize the `neo-ignore` placeholder. When it encounters this node, it will skip the diffing process, leaving the corresponding DOM element untouched.
@@ -57,4 +57,4 @@ Given the architectural significance of these changes, a comprehensive testing s
57
57
- Create a suite of performance tests that simulate high-frequency updates on complex component trees.
58
58
- Run these benchmarks on both the `main` branch (old implementation) and the feature branch (new implementation) to rigorously compare performance and ensure there are no regressions.
59
59
60
-
This final, refined approach provides the best of all worlds: it fixes the code complexity and maintainability issues by centralizing all collision-related state, while fully preserving the framework's proven, real-time performance characteristics.
60
+
This final, refined approach provides the best of all worlds: it fixes the code complexity and maintainability issues by centralizing all collision-related state, while fully preserving the framework's proven, real-time performance characteristics.
0 commit comments