LearnNewsExamplesServices
Frontmatter
id9419
titleImplement Dynamic Module Loading in `Neo.worker.Data`
stateClosed
labels
enhancementaicore
assigneestobiu
createdAtMar 9, 2026, 4:46 PM
updatedAtMar 12, 2026, 3:54 PM
githubUrlhttps://github.com/neomjs/neo/issues/9419
authortobiu
commentsCount1
parentIssue9449
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 12, 2026, 3:54 PM

Implement Dynamic Module Loading in Neo.worker.Data

Closed v12.1.0 enhancementaicore
tobiu
tobiu commented on Mar 9, 2026, 4:46 PM

Goal

Add a remote method access (RMA) endpoint to the Data Worker to dynamically import ES modules at runtime.

Context

To achieve a high-performance Connection -> Parser -> Normalizer pipeline inside the Data Worker, the Data Worker needs access to application-specific Parser and Normalizer classes. Instead of serializing complex mapping functions across thread boundaries, the App Worker will instruct the Data Worker to dynamically import() the necessary module files.

Architecture

  • Implement an async loadModule({path}) method in src/worker/Data.mjs (similar to the existing test helper in the App Worker).
  • Use await import(/* webpackIgnore: true */ path) to load the module natively.
  • Address Webpack production bundling strategies (e.g., magic comments or dynamic chunks) as needed during implementation.
tobiu added the enhancement label on Mar 9, 2026, 4:46 PM
tobiu added the ai label on Mar 9, 2026, 4:46 PM
tobiu added the core label on Mar 9, 2026, 4:46 PM
tobiu added parent issue #9404 on Mar 9, 2026, 4:46 PM
tobiu cross-referenced by #9420 on Mar 9, 2026, 4:46 PM
tobiu assigned to @tobiu on Mar 9, 2026, 4:47 PM
tobiu cross-referenced by #9449 on Mar 12, 2026, 3:20 PM
tobiu removed parent issue #9404 on Mar 12, 2026, 3:21 PM
tobiu added parent issue #9449 on Mar 12, 2026, 3:21 PM
tobiu referenced in commit 7830abe - "feat: Implement Dynamic Module Loading in Data Worker (#9419)" on Mar 12, 2026, 3:53 PM
tobiu
tobiu Mar 12, 2026, 3:54 PM

Input from Gemini 3.1 Pro:

✦ I have successfully implemented dynamic module loading in Neo.worker.Data.

Changes Made

  • Added the remote config mapping to expose loadModule to the app worker.
  • Implemented async loadModule({path}) which utilizes Webpack's dynamic import() capabilities natively.
  • Integrated the specific webpackExclude rule /* webpackExclude: /(?:\/|\\)(dist|node_modules)\/(?!neo.mjs)/ */ to ensure robust bundler chunking and ignore irrelevant system folders.
  • Ran all unit tests (331) successfully.

Code has been committed and pushed under #9419.

tobiu closed this issue on Mar 12, 2026, 3:54 PM