Skip to content

Commit 1f34bc2

Browse files
committed
docs(release-notes): Enhance Hero Story 2 with architecture diagram and zero-allocation details (#9341)
1 parent d24d32d commit 1f34bc2

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

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

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,37 @@ The DevIndex UI is a torture test. It renders live, animated data charts ("Livin
122122

123123
To achieve true O(1) scrolling performance and constant memory usage, we completely shattered the monolithic Grid Body. Every row is now its own standalone `Neo.grid.Row` component, and we aggressively split the workload across five independent actors:
124124

125+
```mermaid
126+
flowchart TD
127+
subgraph Browser Engine
128+
Main(Main Thread<br/>DOM Updates & Native Scroll)
129+
end
130+
131+
subgraph Neo.mjs Workers
132+
App(App Worker<br/>Row Pooling, Logic & Streaming)
133+
VDom(VDom Worker<br/>Tree Diffing & Deltas)
134+
Data(Data Worker<br/>Sorting & Filtering)
135+
Canvas(Canvas Worker<br/>OffscreenCanvas Rendering)
136+
end
137+
138+
Main -->|Scroll Event| App
139+
Main -->|OffscreenCanvas Transfer| Canvas
140+
141+
App -->|Update TimeScale| Canvas
142+
App -->|VDOM JSON| VDom
143+
App -->|Request Data| Data
144+
145+
Data -->|Return Sorted Array| App
146+
VDom -->|DOM Deltas| Main
147+
Canvas -->|60fps Render Loop| Main
148+
```
149+
125150
1. **Component-Based Rows & Granular Updates (App Worker):**
126151
* Editing a record now triggers a VDOM update *only* for that specific `Neo.grid.Row` instance.
127152
* **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.
128153

129154
2. **The "Fixed-DOM-Order" Strategy (Main Thread):**
130-
* We upgraded `Neo.grid.Body` to enforce strict **Row Pooling**. As you scroll, rows leaving the top of the viewport are teleported to the bottom via CSS `translate3d`.
155+
* We upgraded `Neo.grid.Body` to enforce strict **Row Pooling**. As you scroll, rows leaving the top of the viewport are recycled in place via CSS `translate3d`.
131156
* *The Flex:* When you scroll the 50,000-record DevIndex grid, there are **ZERO structural DOM mutations** (`insertBefore`, `removeChild`, `moveNode`). There can be 600 deltas in a single tick, but they are exclusively fast CSS transforms and `textContent` updates. The DOM order never changes, effectively eliminating layout recalculations.
132157

133158
3. **"Full Pool Rendering" for Cells (O(1) Horizontal Scroll):**
@@ -137,10 +162,14 @@ To achieve true O(1) scrolling performance and constant memory usage, we complet
137162
4. **Main-Thread Drag & Kinetic Scrolling:**
138163
* We introduced `Neo.main.addon.GridDragScroll`. Instead of passing high-frequency `mousemove` events back and forth between workers, drag-to-scroll logic now runs directly on the Main Thread. It features physics-based inertial scrolling with exponential decay friction, delivering a buttery-smooth, native-like touch and drag experience.
139164

140-
5. **"Living Sparklines" & Sparse Animation (Canvas Worker):**
165+
5. **"Living Sparklines" & Zero-Allocation Physics (Canvas Worker):**
141166
* We transferred ownership of the `<canvas>` DOM nodes inside the grid cells to a dedicated Canvas Worker using the `OffscreenCanvas` API.
167+
* To maintain a strict 16ms frame budget (60fps) without Garbage Collection (GC) stutters, the physics engine uses a **Zero-Allocation** strategy (cached geometry, pre-allocated `CanvasGradient` objects).
142168
* To prevent GPU overload, it uses a **"Sparse Animation Strategy"**. A single master loop randomly selects *one* chart to pulse with a "Data Packet" every few seconds. This creates the visual impression of a highly active, living system ("The Server Room Effect") while keeping actual GPU load equivalent to rendering just a single chart.
143169

170+
6. **Performance Theater: The "Show Off" Effect:**
171+
* To prove the Main Thread is completely unblocked by the Grid's layout during a scroll, we intentionally **double the animation speed** of the complex 3D Luminous Flux header when you scroll. The Canvas worker smoothly accelerates the physics `timeScale` while the grid scrolls underneath it, proving visually that heavy canvas operations cannot block the App Worker's scrolling logic.
172+
144173
**The Best Part: Zero Migration Effort**
145174
Despite being a fundamental, ground-up rewrite of the framework's most complex component, the new Grid is a **100% drop-in replacement**. All your existing grid configurations, custom cell renderers, and stores will work out of the box with massively upgraded performance.
146175

0 commit comments

Comments
 (0)