Skip to content

Commit b77719a

Browse files
committed
docs(release-notes): Refine VDOM lifecycle shift explanation to clarify Main Thread deltas (#9341)
1 parent f5b3f2f commit b77719a

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

resources/content/release-notes/v12.0.0.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,39 @@ flowchart TD
151151
```
152152

153153
1. **Component-Based Rows & Granular Updates (App Worker):**
154-
* Editing a record now triggers a VDOM update *only* for that specific `Neo.grid.Row` instance.
154+
* **The VDOM Lifecycle Shift:** The old `Grid.Body` was highly virtualized—it only ever rendered the mounted range (e.g., 30 rows by 10 columns). However, it was still monolithic. While nested components (like a button in a cell) could update themselves, if the underlying *data record* changed (e.g., via a live data feed or user edit), it forced the Body into an "update all or nothing" scenario. The App Worker had to serialize and send the entire 30x10 VDOM tree to the VDOM Worker to process the single record change.
155+
* Now, `Neo.grid.Row` acts as a discrete VDOM boundary. Editing a record triggers a VDOM update *only* for that specific Row instance. We send drastically smaller JSON payloads to the VDOM worker (1 row instead of 30) for data-driven UI updates. It is important to note that this optimization strictly targets the App $\rightarrow$ VDOM worker bridge; the final, highly-optimized DOM deltas applied to the Main Thread remain exactly the same.
156+
157+
**Before (v11): The Monolithic Body**
158+
```javascript readonly
159+
// Grid.Body.mjs (Old Architecture)
160+
onStoreRecordChange({record}) {
161+
let rowIndex = this.store.indexOf(record);
162+
163+
// The Body had to manually replace the raw VDOM node for the row
164+
// inside its massive children array, then trigger a full update.
165+
this.vdom.cn[rowIndex] = this.createRow({record, rowIndex});
166+
this.update();
167+
}
168+
```
169+
170+
**After (v12): Granular Component Rows**
171+
```javascript readonly
172+
// Grid.Body.mjs (New Architecture)
173+
onStoreRecordChange({record}) {
174+
let rowIndex = this.store.indexOf(record),
175+
poolSize = this.items.length,
176+
itemIndex = rowIndex % poolSize,
177+
row = this.items[itemIndex];
178+
179+
if (row) {
180+
// We simply tell the modular Row component to update itself.
181+
// The Body's VDOM doesn't change, and no other rows are affected.
182+
row.createVdom();
183+
}
184+
}
185+
```
186+
155187
* **Resilient Lifecycle:** Component columns (like our Living Sparklines) are now standard children of the `Row` component. Because the row itself is never destroyed, the framework's standard lifecycle manages cell components automatically, permanently eliminating the dreaded "Zombie Canvas" bugs.
156188

157189
2. **The "Fixed-DOM-Order" Strategy ("Zero-Latency" Scrolling):**

0 commit comments

Comments
 (0)