Remove dead code across foundation crates#32000
Conversation
|
Updated 3:05 AM PT - Jun 10th, 2026
❌ @robobun, your commit 2f2b483 has some failures in 🧪 To try this PR locally: bunx bun-pr 32000That installs a local version of the PR into your bun-32000 --bun |
|
@robobun adopt |
WalkthroughThis PR consolidates shared output tag rewriting logic, optimizes string escaping through const-generic encoding dispatch, abstracts event loop storage behind a trait for cross-platform code reuse, and removes approximately 30 unused public APIs across collections and utilities while refactoring internal data structures including semver strings, URL FFI handles, and sourcemap generation. ChangesShared Output Tag Rewriting and String Escaping Optimization
Event Loop Storage Abstraction and Cross-Platform Unification
Systematic API Surface Reduction
Data Structure Refactoring
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
…urcemap, threading, url
f0cc8a8 to
58f7624
Compare
|
Adopted. Went through the full diff: the moves and dedups are behavior-preserving, and the one external consumer of the changed CI status: the diff is effectively green. On build 61692, all 284 jobs that ran passed; the build is marked failed only because the two |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/bun_output_tags/lib.rs`:
- Around line 125-143: The parser currently consumes raw '>' and drops a
trailing backslash at EOF; update the match arms handling b'\\' and b'>' so only
recognized tag/escape sequences are consumed: in the b'>' arm, push the literal
b'>' into out (instead of swallowing it) and advance i; in the b'\\' arm, if i+1
>= fmt.len() (trailing backslash) push the b'\\' into out and stop/advance
appropriately, otherwise keep the existing escape handling for recognized '<' or
'>' and for unknown escapes push both the backslash and the following byte
unchanged. Locate these edits around the match on fmt[i] in lib.rs where fmt,
out, and i are used.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e0b240f7-9211-43b1-aa09-cbf027083864
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (29)
src/bun_core/output.rssrc/bun_core/string/mod.rssrc/bun_output_tags/lib.rssrc/clap_macros/lib.rssrc/collections/StaticHashMap.rssrc/collections/array_hash_map.rssrc/collections/array_list.rssrc/collections/bit_set.rssrc/collections/lib.rssrc/collections/multi_array_list.rssrc/collections/pool.rssrc/ini/lib.rssrc/io/PipeWriter.rssrc/io/posix_event_loop.rssrc/io/windows_event_loop.rssrc/paths/lib.rssrc/paths/resolve_path.rssrc/router/Cargo.tomlsrc/router/lib.rssrc/semver/Version.rssrc/semver/lib.rssrc/sourcemap/Chunk.rssrc/sourcemap/lib.rssrc/threading/WaitGroup.rssrc/threading/channel.rssrc/threading/guarded.rssrc/threading/work_pool.rssrc/url/Cargo.tomlsrc/url/lib.rs
💤 Files with no reviewable changes (16)
- src/collections/StaticHashMap.rs
- src/semver/Version.rs
- src/collections/lib.rs
- src/threading/guarded.rs
- src/paths/resolve_path.rs
- src/router/Cargo.toml
- src/threading/work_pool.rs
- src/threading/WaitGroup.rs
- src/sourcemap/lib.rs
- src/collections/array_hash_map.rs
- src/sourcemap/Chunk.rs
- src/collections/array_list.rs
- src/threading/channel.rs
- src/collections/pool.rs
- src/paths/lib.rs
- src/collections/bit_set.rs
What this does
Small dead-code deletions and helper dedups across the foundation crates: collections (unused StaticHashMap/array_list/bit_set items), threading, paths, semver, sourcemap, ini, clap_macros, bun_core output/string, io (PipeWriter/event-loop macro extraction), router (deletes orphaned cfg(test) fixture scaffolding and its dev-dependency), and url (re-exports
bun_opaquehandle types; Cargo.lock updated accordingly). Net −1.5k lines.This is the base of a small stacked chain (install-cli → jsc-runtime → webcore will be based on it).
Split from #31912 (whole-repo simplification pass; closing that PR in favor of module-scoped splits). This PR only moves and removes code — zero intended behavior change. Verified there by a per-file behavioral-equivalence audit and full CI (green on build 61383); verified here by a standalone full-workspace compile check.
Why no new test files
This diff removes unused code and dedups identical implementations, so there is no behavior change for a new test to pin down. Regression coverage is the existing suite, which already exercises every touched path: bundler/transpiler snapshots for the string printer, the io and spawn suites for FilePoll/PipeWriter (Windows lanes cover
windows_event_loop), the install suites for semver string interning, andtest/cli/install/public-hoist-pattern.test.tsfor the ini matcher path.multi_array_listkeeps its in-crate#[test]coverage.