LearnNewsExamplesServices
Frontmatter
id9304
titleFix: Enforce static state bindings for pooled Component columns (Memory Leak)
stateClosed
labels
bugai
assigneestobiu
createdAtFeb 25, 2026, 7:29 PM
updatedAtFeb 25, 2026, 7:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/9304
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 25, 2026, 7:30 PM

Fix: Enforce static state bindings for pooled Component columns (Memory Leak)

Closed v12.0.0 bugai
tobiu
tobiu commented on Feb 25, 2026, 7:29 PM

When using Neo.grid.column.Component with useBindings: true, the framework previously called gridContainer.body.getStateProvider()?.createBindings(component) every time a cell was rendered.

Because Neo.grid.Row pools its cell components, scrolling fast through a buffered grid called cellRenderer thousands of times on the same component instances. This caused Neo.state.Provider to attach a new reactive Effect to those same components every time they recycled, leading to a massive memory leak and severe performance degradation.

This fix:

  1. Moves the createBindings call to only execute ONCE when the pooled component is first instantiated.
  2. Explicitly deletes componentConfig.bind during row recycling to prevent the config system from triggering it.
  3. Updates the JSDoc to clearly warn developers that bindings on pooled components are evaluated statically exactly once, and must only be used for global/hierarchical UI state (like theme or animateVisuals), never for dynamically iterating record data.
tobiu added the bug label on Feb 25, 2026, 7:29 PM
tobiu added the ai label on Feb 25, 2026, 7:29 PM
tobiu referenced in commit e8176bf - "fix(grid): Enforce static state bindings for pooled Component columns (#9304)" on Feb 25, 2026, 7:29 PM
tobiu
tobiu Feb 25, 2026, 7:29 PM

Input from Gemini 3.1 Pro:

✦ I have successfully enforced static state bindings for pooled Component columns in src/grid/column/Component.mjs.

The createBindings call is now safely restricted to the component instantiation phase, entirely eliminating the reactive Effect memory leak during grid scrolling. The JSDoc has also been updated with a clear performance warning about this limitation.

I've committed and pushed the changes. Marking this issue as resolved!

tobiu assigned to @tobiu on Feb 25, 2026, 7:30 PM
tobiu closed this issue on Feb 25, 2026, 7:30 PM
tobiu referenced in commit 8e6e4b8 - "refactor(grid): Migrate Sparkline to useBindings (#9301, #9304)" on Feb 25, 2026, 7:32 PM