LearnNewsExamplesServices
Frontmatter
id8469
titleAudit and Refactor all afterSetId Implementations
stateClosed
labels
epicairefactoringcore
assigneestobiu
createdAtJan 9, 2026, 4:17 PM
updatedAtJan 9, 2026, 6:26 PM
githubUrlhttps://github.com/neomjs/neo/issues/8469
authortobiu
commentsCount2
parentIssuenull
subIssues
8471 Refactor afterSetId in src/button/Base.mjs
8472 Implement Lazy VDOM Cloning in Component Base
8473 Refactor afterSetId in Split Button and Grid Body
8474 Enforce Eager VDOM Cloning in Component Constructor
8475 Remove redundant ensureStableIds from Button Base
8476 Refactor Gallery to remove manual afterSetId ID assignment
8477 Refactor Progress Component ID handling
8478 Refactor afterSetId in Form Fields to ensureStableIds
subIssuesCompleted8
subIssuesTotal8
blockedBy[]
blocking[]
closedAtJan 9, 2026, 6:26 PM

Audit and Refactor all afterSetId Implementations

Closed v11.19.1 epicairefactoringcore
tobiu
tobiu commented on Jan 9, 2026, 4:17 PM

Following the VDOM ID stabilization fix (#8467), we need to audit all occurrences of afterSetId in the codebase.

Context: We discovered that Component.Base#afterSetId was previously mutating the class prototype's _vdom and that manual VDOM ID assignment is now handled centrally by VdomLifecycle#ensureStableIds.

Goals:

  1. Redundancy Removal: Identify and remove any manual VDOM ID assignment logic that is now handled by ensureStableIds.
  2. Safety Check: Ensure no other implementations are mutating class prototypes (e.g., modifying _vdom or vdom properties during the construction phase before initConfig completes).
  3. Compatibility: Verify that component-specific logic (e.g., updating ARIA attributes, specific DOM lookups) is compatible with the new wrapper ID scheme.

Files to Audit:

  • src/button/Base.mjs
  • src/button/Split.mjs
  • src/component/Abstract.mjs
  • src/component/Base.mjs (Already refactored, double-check)
  • src/component/Gallery.mjs
  • src/component/Progress.mjs
  • src/core/Base.mjs
  • src/grid/Body.mjs
tobiu added the epic label on Jan 9, 2026, 4:17 PM
tobiu added the ai label on Jan 9, 2026, 4:17 PM
tobiu added the refactoring label on Jan 9, 2026, 4:17 PM
tobiu added the core label on Jan 9, 2026, 4:17 PM
tobiu assigned to @tobiu on Jan 9, 2026, 5:08 PM
tobiu added sub-issue #8471 on Jan 9, 2026, 5:09 PM
tobiu
tobiu Jan 9, 2026, 5:09 PM

Input from Gemini 3 Pro:

✦ Completed refactoring of src/button/Base.mjs in sub-ticket #8471.

  • Replaced afterSetId with ensureStableIds.
  • Verified prototype safety with new unit tests.
tobiu added sub-issue #8472 on Jan 9, 2026, 5:26 PM
tobiu added sub-issue #8473 on Jan 9, 2026, 5:34 PM
tobiu added sub-issue #8474 on Jan 9, 2026, 5:43 PM
tobiu added sub-issue #8475 on Jan 9, 2026, 5:57 PM
tobiu added sub-issue #8476 on Jan 9, 2026, 6:07 PM
tobiu added sub-issue #8477 on Jan 9, 2026, 6:14 PM
tobiu added sub-issue #8478 on Jan 9, 2026, 6:21 PM
tobiu
tobiu Jan 9, 2026, 6:26 PM

Input from Gemini 3 Pro:

✦ I have completed the audit and refactoring of all afterSetId implementations.

Summary of Work:

  1. Core Safety: Implemented eager VDOM cloning in Neo.component.Base.construct (#8474) to prevent prototype pollution from early VDOM access.
  2. Logic Centralization:
    • Refactored src/button/Split.mjs, src/grid/Body.mjs, src/component/Progress.mjs, src/component/Gallery.mjs, src/form/field/CheckBox.mjs, src/form/field/FileUpload.mjs, and src/form/field/Text.mjs.
    • Replaced manual afterSetId logic with ensureStableIds overrides where appropriate.
    • Removed redundant ensureStableIds from src/button/Base.mjs.
  3. Audit: Verified that src/component/Abstract.mjs and src/core/Base.mjs use afterSetId correctly for manager registration, which is outside the scope of VDOM stabilization.

Outcome: The codebase now enforces a consistent, safe, and centralized pattern for VDOM ID assignment.

I am closing this Epic.

tobiu closed this issue on Jan 9, 2026, 6:26 PM