LearnNewsExamplesServices
Frontmatter
id7006
titlecore.IdGenerator: switch from singleton to plain object
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 10, 2025, 9:44 PM
updatedAtJul 10, 2025, 9:44 PM
githubUrlhttps://github.com/neomjs/neo/issues/7006
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 10, 2025, 9:44 PM

core.IdGenerator: switch from singleton to plain object

Closed v10.0.0-beta.6 enhancement
tobiu
tobiu commented on Jul 10, 2025, 9:44 PM
  • We can make this one more lightweight.

Implications:

  • Simpler Definition: The new version is much simpler and more lightweight, as it's just a plain object.
  • No Neo.mjs Class Overhead: It avoids the overhead of the Neo.mjs class system (configs, lifecycle hooks, mixins, etc.) for a utility that doesn't require them.
  • Direct Access: Properties like base and idCounter are directly accessible on the IdGenerator object without going through the config system.
  • Explicit Namespace: The namespace assignment is now more explicit.

This refactoring makes sense for a utility like IdGenerator that doesn't need the full power of the Neo.mjs class system and is intended to be a simple, globally accessible singleton.

tobiu assigned to @tobiu on Jul 10, 2025, 9:44 PM
tobiu added the enhancement label on Jul 10, 2025, 9:44 PM
tobiu referenced in commit afff146 - "core.IdGenerator: switch from singleton to plain object #7006" on Jul 10, 2025, 9:44 PM
tobiu closed this issue on Jul 10, 2025, 9:44 PM