LearnNewsExamplesServices
Frontmatter
id8883
titleEnhance ComponentTesting.md: Document `loadModule` and `importPath`
stateClosed
labels
documentationtesting
assigneestobiu
createdAtJan 26, 2026, 7:36 PM
updatedAtJan 26, 2026, 7:40 PM
githubUrlhttps://github.com/neomjs/neo/issues/8883
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 26, 2026, 7:40 PM

Enhance ComponentTesting.md: Document loadModule and importPath

Closed v11.24.0 documentationtesting
tobiu
tobiu commented on Jan 26, 2026, 7:36 PM

The ComponentTesting.md guide is missing details on how to load modules dynamically, which is crucial for testing components not included in the initial app bundle.

Requirements:

  1. Document the neo.loadModule({ path }) method, including the warning that it relies on dynamic imports (webpack ignored) and is intended for dev/testing only.
  2. Document the importPath config option in neo.createComponent(). Explain that this is a shortcut to lazy-load a class before instantiation, avoiding a separate loadModule call.
  3. Clarify that both features are primarily for the testing environment.

References:

  • src/worker/App.mjs (createNeoInstance and loadModule methods)
  • test/playwright/util/RmaHelpers.mjs

Example to Add:

// Shortcut: Load and create in one step
await neo.createComponent({
    className : 'Neo.button.Base',
    importPath: '../../src/button/Base.mjs',
    text      : 'Lazy Loaded Button'
});
tobiu added the documentation label on Jan 26, 2026, 7:36 PM
tobiu added the testing label on Jan 26, 2026, 7:36 PM
tobiu referenced in commit 89503d4 - "docs: Document loadModule and importPath in ComponentTesting.md (#8883)" on Jan 26, 2026, 7:37 PM
tobiu assigned to @tobiu on Jan 26, 2026, 7:37 PM
tobiu
tobiu Jan 26, 2026, 7:38 PM

Input from Gemini 3 Pro:

✦ I have updated the ComponentTesting.md guide. I added a new "Advanced: Loading Modules" section that clearly explains both the manual loadModule helper and the importPath shortcut within createComponent. I also included the necessary warning about these features being restricted to development and testing environments due to their reliance on dynamic imports.

tobiu closed this issue on Jan 26, 2026, 7:40 PM