Skip to content

bundler: fix ESMConditions capacity miscomputation with custom conditions - #30535

Closed
robobun wants to merge 1 commit into
mainfrom
farm/a04b027d/fix-esm-conditions-capacity
Closed

bundler: fix ESMConditions capacity miscomputation with custom conditions#30535
robobun wants to merge 1 commit into
mainfrom
farm/a04b027d/fix-esm-conditions-capacity

bundler: fix ESMConditions capacity miscomputation with custom condit…

494e1ca
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 12, 2026 in 11m 56s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/bundler/options.zig:1090-1092 Same if-else precedence footgun remains in loadersFromTransformOptions

Annotations

Check notice on line 1092 in src/bundler/options.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Same if-else precedence footgun remains in loadersFromTransformOptions

Nit (pre-existing): the same if-else precedence footgun exists ~480 lines down in `loadersFromTransformOptions`'s `total_capacity` argument — when `target.isBun()` is true, `default_loader_ext.len` (and the browser term) get absorbed into the `else` branch and dropped. It's harmless there since only the user-provided extensions use `putAssumeCapacity` and the defaults use `getOrPutValue` which grows the map, so it's just a missed pre-sizing — but since this PR is specifically about this pattern