[PR #304] feat(javascript): add webpack and rspack runtime adapters #1940

Closed
opened 2026-10-16 21:12:42 +00:00 by bsakaguchi · 0 comments
Owner

Original Pull Request: https://github.com/morluto/rea/pull/304

State: closed
Merged: Yes


What changed

  • Recover Webpack/Rspack runtime metadata from chunk registrations: runtime require aliases, runtime entry module keys, async chunk keys, unknown counts, omitted counts, and observed module-cache markers.
  • Project bundler chunks and modules into the JavaScript application graph with chunk lookup keys, entry-module loads edges, async-chunk imports edges, and explicit unresolved chunk/module reference nodes.
  • Resolve static chunk:<id> dynamic-import references back to recovered same-bundle chunk nodes when the runtime/chunk match is unambiguous.
  • Avoid treating Webpack/Rspack helper calls such as __webpack_require__.e(...) as ordinary module require edges.
  • Add source-owned Webpack and Rspack fixture coverage for custom globals, factory require aliases, runtime entry calls, async chunks, unresolved chunks, and helper-call classification.
  • Regenerate TypeDoc API output for the new public graph/static-analysis fields.

Why

The previous static bundler recovery captured module tables but did not preserve enough runtime structure to answer entrypoint and async chunk questions reliably. That left agents with module nodes but weak graph semantics around which modules start the runtime and which chunks are loaded lazily.

Impact

Webpack/Rspack Electron and JavaScript artifact analysis now exposes stronger runtime topology without executing target code. Results distinguish resolved edges from not-found references and keep unknown/omitted counts explicit when AST recovery is bounded or dynamic.

Validation

  • PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run check
  • PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run verify:package
  • PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run knip
  • PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run jscpd
  • PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run scan:todos
  • git diff --check
**Original Pull Request:** https://github.com/morluto/rea/pull/304 **State:** closed **Merged:** Yes --- ## What changed - Recover Webpack/Rspack runtime metadata from chunk registrations: runtime require aliases, runtime entry module keys, async chunk keys, unknown counts, omitted counts, and observed module-cache markers. - Project bundler chunks and modules into the JavaScript application graph with chunk lookup keys, entry-module `loads` edges, async-chunk `imports` edges, and explicit unresolved chunk/module reference nodes. - Resolve static `chunk:<id>` dynamic-import references back to recovered same-bundle chunk nodes when the runtime/chunk match is unambiguous. - Avoid treating Webpack/Rspack helper calls such as `__webpack_require__.e(...)` as ordinary module `require` edges. - Add source-owned Webpack and Rspack fixture coverage for custom globals, factory require aliases, runtime entry calls, async chunks, unresolved chunks, and helper-call classification. - Regenerate TypeDoc API output for the new public graph/static-analysis fields. ## Why The previous static bundler recovery captured module tables but did not preserve enough runtime structure to answer entrypoint and async chunk questions reliably. That left agents with module nodes but weak graph semantics around which modules start the runtime and which chunks are loaded lazily. ## Impact Webpack/Rspack Electron and JavaScript artifact analysis now exposes stronger runtime topology without executing target code. Results distinguish resolved edges from not-found references and keep unknown/omitted counts explicit when AST recovery is bounded or dynamic. ## Validation - `PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run check` - `PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run verify:package` - `PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run knip` - `PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run jscpd` - `PATH=/home/pentester/.nvm/versions/node/v24.18.0/bin:$PATH npm run scan:todos` - `git diff --check`
bsakaguchi 2026-10-16 21:12:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1940
No description provided.