Skip to content

bundler: use onResolve-returned path for external imports - #35053

Open
robobun wants to merge 12 commits into
mainfrom
farm/1cc9f314/onresolve-external-path-rewrite
Open

bundler: use onResolve-returned path for external imports#35053
robobun wants to merge 12 commits into
mainfrom
farm/1cc9f314/onresolve-external-path-rewrite

bundler: drop IS_EXTERNAL, superseded by #39874

af0a3e4
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 22, 2026 in 40m 46s

Code review found 2 potential issues

Found 2 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/bundler/bundle_v2.rs:82-89 ExternalPath::apply does not clear a stale source_index written by the initial map pass
🟡 Nit src/bundler/bundle_v2.rs:87-88 PR description is stale: describes IS_EXTERNAL flag removed in af0a3e47

Annotations

Check warning on line 89 in src/bundler/bundle_v2.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

ExternalPath::apply does not clear a stale source_index written by the initial map pass

`PendingImport::ExternalPath::apply` writes only `import_record.path` and does not clear `source_index`, unlike the `SourceIndex` arm which authoritatively overwrites it — so a stale `source_index` written by the initial map pass (from the record's raw specifier) survives an external answer and the record is bundled instead of printed external. This is pre-existing behavior (pre-PR the external arm touched nothing), and the trigger is narrow, but adding `import_record.source_index = Index::INV

Check warning on line 88 in src/bundler/bundle_v2.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

PR description is stale: describes IS_EXTERNAL flag removed in af0a3e47

The PR description is stale: the Fix section describes "New `ImportRecordFlags::IS_EXTERNAL`, set by every external arm of `resolve_import_records` and by `ExternalPath`" and the Notes explain why `IS_EXTERNAL_WITHOUT_SIDE_EFFECTS` was not reused, but af0a3e47 dropped that flag entirely — the barrel-revisit guard now comes from #39874's `only_records: Some(un_deferred)` filtering (barrel_imports.rs:339/353, bundle_v2.rs:6039/6894). Please update the Fix and Notes sections to describe the `only