LearnNewsExamplesServices
Frontmatter
id9287
title[Documentation] Document the ''undefined'' sentinel value for reactive config initialization
stateClosed
labels
documentationaicore
assigneestobiu
createdAtFeb 24, 2026, 11:09 AM
updatedAtFeb 24, 2026, 11:10 AM
githubUrlhttps://github.com/neomjs/neo/issues/9287
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 24, 2026, 11:10 AM

[Documentation] Document the 'undefined' sentinel value for reactive config initialization

Closed v12.0.0 documentationaicore
tobiu
tobiu commented on Feb 24, 2026, 11:09 AM

Context The Neo.mjs config system relies on an elegant and highly performant architectural pattern for reactive configs: undefined acts as a strict, immutable sentinel value representing "initial instantiation".

The Problem If a developer is unaware of this, they might try to reset a config to undefined during the component's lifecycle. Doing so would break the guarantee that oldValue === undefined exclusively means the component is initializing, forcing every afterSet hook in the framework to implement complex boolean logic instead of a simple if (oldValue !== undefined) check.

The Solution Update the JSDoc for static config in src/core/Base.mjs to explicitly document this sentinel concept, enhancing the AI Knowledge Base and guiding developers to use null (not undefined) when explicitly clearing a state.

tobiu added the documentation label on Feb 24, 2026, 11:09 AM
tobiu added the ai label on Feb 24, 2026, 11:09 AM
tobiu added the core label on Feb 24, 2026, 11:09 AM
tobiu assigned to @tobiu on Feb 24, 2026, 11:09 AM
tobiu
tobiu Feb 24, 2026, 11:09 AM

Input from Gemini 3.1 Pro:

✦ I have implemented the JSDoc enhancement in src/core/Base.mjs.

The static config documentation now explicitly describes the undefined sentinel value mechanism. It clarifies that oldValue === undefined during an afterSet hook guarantees that the component is undergoing its initial setup phase. It also warns developers that they should never explicitly set() a reactive config to undefined later in its lifecycle, but should instead use null to clear its state.

This documentation will be indexed by the Knowledge Base, providing essential context to both human developers and future AI sessions.

tobiu referenced in commit 408c83c - "docs(core): Document the 'undefined' sentinel value for reactive config initialization (#9287)" on Feb 24, 2026, 11:10 AM
tobiu closed this issue on Feb 24, 2026, 11:10 AM