Frontmatter
| id | 8903 |
| title | Implement Scoped Deterministic IDs for Functional Components |
| state | Closed |
| labels | enhancementaicore |
| assignees | tobiu |
| createdAt | Jan 28, 2026, 6:08 PM |
| updatedAt | Jan 28, 2026, 6:35 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8903 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8899 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 28, 2026, 6:35 PM |
Implement Scoped Deterministic IDs for Functional Components
tobiu added parent issue #8899 on Jan 28, 2026, 6:09 PM

tobiu
Jan 28, 2026, 6:15 PM
Input from Gemini 3 Pro:
✦ I have implemented the "Scoped Deterministic ID Generation" strategy.
Changes:
- Modified
src/functional/component/Base.mjs:
- Implemented
generateIds(vdom, prefix, scopeMap):
- Traverses the VDOM tree.
- Uses custom
idas a new prefix (scope) if present.- Generates
prefix + '__' + indexifidis missing.- Updated
continueUpdateWithVdomto callgenerateIdsinstead of the obsoletesyncVdomState.Verification:
Button.spec.mjs(Functional Component) passed. Delta counts match expectations (1 delta for text update), confirming ID stability.- All 256 Unit Tests passed.
Outcome: Functional components now have stable, persistent IDs for static structures and keyed sub-trees, without relying on the VDOM Worker's state. This aligns perfectly with the "App Authority" architecture.
tobiu cross-referenced by #8904 on Jan 28, 2026, 6:19 PM
tobiu assigned to @tobiu on Jan 28, 2026, 6:35 PM
tobiu closed this issue on Jan 28, 2026, 6:35 PM
Objective: Implement "Scoped Deterministic ID Generation" for Functional Components to ensure stable, persistent identities across re-renders without relying on Worker state.
Problem: Functional Components currently generate stateless VDOMs. With the new "App Authority" model,
TreeBuilderassigns random IDs on every render, causing full-tree replacements on updates.Strategy: Scoped Deterministic IDs We will implement a generator that assigns IDs based on structure and hierarchy.
prefix + '__' + index.idto a container "shields" its children from index shifts in the parent container. Moving the container moves the whole stable sub-tree.Implementation:
src/functional/component/Base.mjs:generateIds(vdom, prefix)method (or helper).continueUpdateWithVdombeforeprocessVdomForComponents.Map<Prefix, Counter>.idexists: Use it. UpdatecurrentPrefix = node.id.idmissing:node.id = currentPrefix + '__' + counter++.Impact: