LearnNewsExamplesServices
Frontmatter
id8950
titleRefactor: Move `loadModule` to `Neo.worker.Base`
stateClosed
labels
airefactoringcore
assigneestobiu
createdAtFeb 2, 2026, 3:00 PM
updatedAtFeb 2, 2026, 3:28 PM
githubUrlhttps://github.com/neomjs/neo/issues/8950
authortobiu
commentsCount2
parentIssue8948
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 2, 2026, 3:27 PM

Refactor: Move loadModule to Neo.worker.Base

Closed v12.0.0 airefactoringcore
tobiu
tobiu commented on Feb 2, 2026, 3:00 PM

Move the loadModule method from src/worker/App.mjs to src/worker/Base.mjs.

Requirements:

  1. Refactor: Cut loadModule from App, paste into Base.
  2. Expose: Update remote configs in App.mjs, Canvas.mjs, Data.mjs (etc.) to ensure loadModule is accessible.
  3. Verify: Ensure dynamic imports still work in the worker context.
tobiu added the ai label on Feb 2, 2026, 3:00 PM
tobiu added the refactoring label on Feb 2, 2026, 3:00 PM
tobiu added the core label on Feb 2, 2026, 3:00 PM
tobiu added parent issue #8948 on Feb 2, 2026, 3:00 PM
tobiu referenced in commit 04ad3ff - "feat: Canvas.loadModule Remote Method (#8950)" on Feb 2, 2026, 3:26 PM
tobiu
tobiu Feb 2, 2026, 3:26 PM

Input from Gemini 3 Pro:

✦ Implemented Canvas.loadModule with a production-ready Webpack strategy.

  • Uses webpackInclude: /canvas\/.*\.mjs$/ to create lazy chunks for all canvas modules.
  • Uses webpackExclude: /(?:\/|\\)(buildScripts|dist|node_modules)/ to strictly prevent bundling unwanted files.
  • This enables "Drop-in" usage of Sparkline.mjs without manual canvas.mjs edits.
tobiu
tobiu Feb 2, 2026, 3:27 PM

Input from Gemini 3 Pro:

Correction: Originally planned to move loadModule to worker.Base, but this would force every worker type (App, Data, etc.) to bundle Canvas modules due to Webpack's static analysis of the import() statement.

Revised Strategy: Implemented loadModule specifically in Neo.worker.Canvas to keep other worker bundles clean. Kept the original loadModule in App intact for testing (PlayWright).

tobiu closed this issue on Feb 2, 2026, 3:27 PM
tobiu assigned to @tobiu on Feb 2, 2026, 3:28 PM