LearnNewsExamplesServices
Frontmatter
id19176
titlePin how IdGenerator names every instance
stateOpen
labels
enhancementhelp wantedgood first issuecontributor-experiencehacktoberfestaitesting
assignees[]
createdAtSep 24, 2026, 5:23 PM
updatedAtOct 2, 2026, 10:12 AM
githubUrlhttps://github.com/neomjs/neo/issues/19176
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Pin how IdGenerator names every instance

Open Backlog/active-chunk-25 enhancementhelp wantedgood first issuecontributor-experiencehacktoberfestaitesting
neo-opus-ada
neo-opus-ada commented on Sep 24, 2026, 5:23 PM

Welcome 👋

Every Neo instance gets an id like neo-button-3, and Neo.core.IdGenerator hands them out: one counter per name, a neo- prefix, and a special case for the default name. Fifteen lines, used by the whole engine, and no test yet.

This is a good first issue for Hacktoberfest 2026. It needs Node.js and a clone of this repository: no Docker, no AI setup.

[!IMPORTANT] Reserved for first-time Neo.mjs contributors. The maintainer team will not claim, edit, or implement this issue through 2026-10-31. Comment here to claim it, and ask anything on this issue.

Set up once: follow Set up the engine from a clone, including npm run bundle-browser-deps: without it the unit suite selects zero tests.

Where things live

  • Source: src/core/IdGenerator.mjs: getId(name), base, idCounter. It also installs Neo.getId.
  • New test file: test/playwright/unit/core/IdGenerator.spec.mjs
  • Pattern to copy: test/playwright/unit/util/Array.spec.mjs (the setup() call and imports)
  • Tip: every spec in the run shares the counters, so give every test its own name (e.g. test-a-1). The default name (neo) is shared with the whole engine, so for it assert how the number grows between your own calls, never a fixed number.

What to cover

Call Expected
getId('test-a') twice 'neo-test-a-1', then 'neo-test-a-2'
getId('test-b') after those 'neo-test-b-1': each name counts on its own
getId(), then getId(''), then getId('neo') 'neo-<n>', 'neo-<n+1>', 'neo-<n+2>': they share one counter, with no name in the middle
Neo.getId('test-c'), then getId('test-c') 'neo-test-c-1', then 'neo-test-c-2': the same function and counters
IdGenerator.base 'neo-'
Neo.core.IdGenerator the same object as the default export

Done when

  • test/playwright/unit/core/IdGenerator.spec.mjs exists, following the pattern file's setup.
  • One test(...) per table row.
  • Test-only: if the object disagrees with a row, say so on this issue before changing src/.
  • npm run test-unit -- test/playwright/unit/core/IdGenerator.spec.mjs passes.
  • npm run test-unit passes.

Out of scope

Which name each class passes (getIdKey()), and ids set by hand through the id config.

While you wait for review

You just pinned one small piece of a multi-threaded application engine: in Neo.mjs your app's code runs inside a web worker, and the main thread only paints. Two things worth ten minutes:

  • See the part nobody expects. Run npm run build-themes -- -n -e dev -t all and npm run server-start, open apps/workstation/, and drag a tab out of the browser window. It becomes its own OS window, still running, with the same component instances and the same worker. Benefits: Introduction explains why that is possible.
  • Your coding agent can go much further here. The skills this repository's AI maintainers work with are published on npm as neo-agent-skills, and they need no Knowledge Base and no Memory Core. With Claude or GPT beside you, the help wanted issues are within reach after this one.
Maintainer notes

Curated under #18985 (Hacktoberfest 2026). Found work: no unit or component spec names this module on dev (2026-09-24). Every row in the table was run in the unit environment on dev before filing, and the values are the measured ones. Live latest-open sweep: the latest 20 open issues at 2026-09-24T15:22Z, plus a search for IdGenerator, CountryFlags and rpc Api registerApi; no equivalent. A2A: no claim on this scope. Memory Core: no prior decision.

Origin Session ID: 101d2ce9-9f43-4f5a-9ae2-3c75bf8f6fcf