LearnNewsExamplesServices
Frontmatter
titlefeat(core): import MicroLoader config as JSON module (#5756)
authorneo-gpt
stateMerged
createdAtJun 23, 2026, 8:04 AM
updatedAtJun 23, 2026, 9:27 PM
closedAtJun 23, 2026, 9:27 PM
mergedAtJun 23, 2026, 9:27 PM
branchesdevcodex/5756-microloader-json-import
urlhttps://github.com/neomjs/neo/pull/13909
contentTrust
projected
quarantined0
signals[]
Merged
neo-gpt
neo-gpt commented on Jun 23, 2026, 8:04 AM

Resolves #5756

MicroLoader.mjs now imports the app-local neo-config.json as a JSON module using import attributes, while preserving the previous document-relative lookup semantics via document.baseURI before bootstrapping mainPath.

The production appworker build now minifies the copied src/MicroLoader.mjs with Terser instead of deleting all whitespace. The old production copy step transformed new URL(...) into newURL(...), which broke dist/production at runtime.

Evidence: L3 (post-rebase build-all, local browser portal matrix, and focused whitebox e2e) -> L3 required (MicroLoader browser bootstrap and generated dist portal output). Residual: GitHub CI on pushed head.

Deltas from ticket

  • Preserved the old fetch('./neo-config.json') document-relative behavior by resolving the dynamic import specifier with new URL('./neo-config.json', document.baseURI).href.
  • Updated bootstrap docs that explicitly described the retired fetch/json parse path.
  • Replaced production MicroLoader whitespace stripping with Terser module minification so generated dist/production/src/MicroLoader.mjs preserves valid JavaScript syntax.

Test Evidence

  • git diff --check
  • node --check src/MicroLoader.mjs
  • node --check buildScripts/webpack/production/webpack.config.appworker.mjs
  • npm run build-all -- -l no (post-rebase, passed; total time 31.49s)
  • Browser smoke against local exact-head server: /apps/portal/, /apps/portal/index.html, /dist/development/apps/portal/, /dist/esm/apps/portal/, and /dist/production/apps/portal/ all rendered .neo-viewport with expected Neo.config.environment / mainPath values.
  • npm run test-e2e -- test/playwright/e2e/NeuralLink.spec.mjs (post-rebase, 1 passed)
  • npm run test-e2e -- test/playwright/e2e/LivePreviewMultiWindow.spec.mjs (post-rebase, 12 passed)

Post-Merge Validation

  • GitHub CI confirms PR-body lint, source lint, CodeQL, and test-scope jobs on the pushed branch.

Commits

  • df3c4d354afeat(core): import MicroLoader config as JSON module (#5756)
  • 590dfd7f6afix(build): preserve production MicroLoader syntax (#5756)

Authored by Euclid (GPT-5, Codex Desktop). Session db5b2ecf-db91-4b7d-9498-ccef00426a1c.

Author response

The evidence request found a real blocker: generated dist/production/src/MicroLoader.mjs was invalid because the production appworker build deleted all whitespace, turning new URL(...) into newURL(...).

Fix pushed in 590dfd7f6a: production MicroLoader generation now uses Terser module minification instead of raw whitespace stripping.

Post-rebase evidence is now in the PR body. Highlights:

  • npm run build-all -- -l no passed.
  • Five portal entry URLs passed a local browser smoke, including dist/production.
  • test/playwright/e2e/NeuralLink.spec.mjs passed.
  • test/playwright/e2e/LivePreviewMultiWindow.spec.mjs passed 12/12 across dev, dist/development, and dist/production.

CI is running on the rebased head 590dfd7f6aac06404b7cd1c4f6d0f128e7369642.


tobiu
tobiu CHANGES_REQUESTED reviewed on Jun 23, 2026, 9:58 AM

evidence ledger required:

  • build-all fully works
  • apps/portal works inside all 5 envs
  • whitebox e2e tests still work

neo-gpt
neo-gpt commented on Jun 23, 2026, 7:39 PM
tobiu
tobiu APPROVED reviewed on Jun 23, 2026, 9:27 PM

No review body provided.