[PR #676] [MERGED] fix(browser): keep bare module locations unresolved #2158

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/676
Author: @rudycelekli
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @morluto

Base: main ← Head: fix/rea-module-url-resolution-20261006


📝 Commits (1)

  • d4f4b4b fix(browser): keep bare module locations unresolved

📊 Changes

5 files changed (+69 additions, -1 deletions)

View changed files

📝 src/browser/WebSourceMapFetcher.ts (+2 -0)
📝 src/domain/webBundleAnalyzer.test.ts (+28 -0)
📝 src/domain/webBundleAnalyzerAst.ts (+7 -0)
📝 src/domain/webBundleAnalyzerInspection.ts (+6 -1)
📝 tests/boundary/browser/webSourceMapFetcher.test.ts (+26 -0)

📄 Description

What changed

Preserve bare module/package specifiers as declared while leaving their locations unresolved. Captured chunk edges and parsed source-map original module edges no longer invent a URL-relative location for package-name or @scope/package without an import-map/package resolver. URL-like module syntax still resolves normally; worker importScripts("worker.js") keeps its URL-relative semantics. Raw source-map source filenames are unaffected.

Actual browser evidence

An owned headless Chrome 154 application loaded through loopback HTTP was captured with the built public CdpBrowserProvider.analyzeBundle. Before, both import("package-name") in captured code and import "package-name" in its fetched original source map falsely became /package-name URLs. After, their resolved locations are null while the declared specifiers remain. Actual worker-URL syntax and a relative original-source module remain resolved. This proves captured-source analysis, not runtime package loading.

Verification

  • Added captured-bundle/original-source regressions fail before.
  • Focused analyzer and source-map tests: 32 passed after.
  • npm run check, npm run check:fast passed.
  • npm run verify:browser passed with real Chrome, CLI/stdio MCP, screenshots, capture and scenario controls.
  • Own real Chrome source/source-map capture and four boundary assertions passed.
  • git diff --check passed.

No new schema, tool, package resolver, import-map resolver, or execution authority. Hopper/Ghidra were not exercised because no binary provider behavior changes. AI assistance was used for investigation, implementation and verification.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/676 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/rea-module-url-resolution-20261006` --- ### 📝 Commits (1) - [`d4f4b4b`](https://github.com/morluto/rea/commit/d4f4b4b1f36a9d3e846385c8e57507b639af88d2) fix(browser): keep bare module locations unresolved ### 📊 Changes **5 files changed** (+69 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/WebSourceMapFetcher.ts` (+2 -0) 📝 `src/domain/webBundleAnalyzer.test.ts` (+28 -0) 📝 `src/domain/webBundleAnalyzerAst.ts` (+7 -0) 📝 `src/domain/webBundleAnalyzerInspection.ts` (+6 -1) 📝 `tests/boundary/browser/webSourceMapFetcher.test.ts` (+26 -0) </details> ### 📄 Description ## What changed Preserve bare module/package specifiers as declared while leaving their locations unresolved. Captured chunk edges and parsed source-map original module edges no longer invent a URL-relative location for `package-name` or `@scope/package` without an import-map/package resolver. URL-like module syntax still resolves normally; worker `importScripts("worker.js")` keeps its URL-relative semantics. Raw source-map source filenames are unaffected. ## Actual browser evidence An owned headless Chrome 154 application loaded through loopback HTTP was captured with the built public `CdpBrowserProvider.analyzeBundle`. Before, both `import("package-name")` in captured code and `import "package-name"` in its fetched original source map falsely became `/package-name` URLs. After, their resolved locations are null while the declared specifiers remain. Actual worker-URL syntax and a relative original-source module remain resolved. This proves captured-source analysis, not runtime package loading. ## Verification - Added captured-bundle/original-source regressions fail before. - Focused analyzer and source-map tests: 32 passed after. - `npm run check`, `npm run check:fast` passed. - `npm run verify:browser` passed with real Chrome, CLI/stdio MCP, screenshots, capture and scenario controls. - Own real Chrome source/source-map capture and four boundary assertions passed. - `git diff --check` passed. No new schema, tool, package resolver, import-map resolver, or execution authority. Hopper/Ghidra were not exercised because no binary provider behavior changes. AI assistance was used for investigation, implementation and verification. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:01 +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#2158
No description provided.