Repository navigation
Drop dead bumpalo dep and consolidate duplicate type-alias re-exports - #34806
Conversation
Follow-up to #34763, #34767, #34778. bumpalo dependency removed from workspace root + 10 member crates (ast, base64, bundler, css, js_parser, js_printer, parsers, resolver, shell_parser, sourcemap). The last code-level use was the Bump alias deleted in #34778; all remaining refs are comments. TaggedPointer -> TaggedPtr: the long-name alias existed in both bun_ptr and bun_collections; 5 call sites rewritten to the canonical TaggedPtr and both aliases replaced with direct re-exports. Duplicate/compat aliases consolidated: - bun_ast::ToSourceOpts -> ToSourceOptions (1 caller in ini) - bundler::options::OutputValue -> OutputFileValue (2 callers; both aliased the same output_file::Value)
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (20)
Comment |
There was a problem hiding this comment.
LGTM — mechanical dead-dep removal and alias consolidation.
What was reviewed:
- Verified
bumpalohas zero non-comment references insrc/**/*.rs; the workspace/member drops are safe. - Confirmed the removed aliases (
TaggedPointer,ToSourceOpts,OutputValue) have no remaining Rust call sites — the two residualTaggedPointerhits inio/lib.rsandDeferredBatchTask.rsare comments, and thesrc/jsc/bindings/v8/hits are an unrelated C++ class. - Each rewrite is an identity substitution to the type the alias already resolved to (
TaggedPtr,ToSourceOptions,OutputFileValue), so no behavior change is possible.
Extended reasoning...
Overview
Follow-up cleanup to #34778's porting-era alias sweep. Two independent mechanical changes:
-
Dead dependency removal —
bumpalodropped from workspaceCargo.tomland 10 member-crateCargo.tomls, with correspondingCargo.lockregen. The last code-level use (pub type Bump = bumpalo::Bump) was deleted in #34778; grep confirms every remaining reference insrc/**/*.rsis inside a comment (mostly "bumpalo::Bump re-export" annotations onbun_alloc::Arenaimports, which now describe historical shape rather than a live dep).bumpaloremains inCargo.lockas a transitive dep ofwasm-bindgen-macro-support, which is expected. -
Compat-alias consolidation — four
pub type X = Y/pub use Y as Xre-exports removed after rewriting their handful of callers to the canonical name:bun_ptr::TaggedPointer+bun_collections::TaggedPointer→TaggedPtr(5 call sites acrossposix_event_loop.rs,server/mod.rs,NodeHTTPResponse.rs; both re-exports now exposeTaggedPtrdirectly)bun_ast::ToSourceOpts→ToSourceOptions(1 caller inini/lib.rs)bundler::options::OutputValue→OutputFileValue(2 callers inStandaloneModuleGraph.rs; the twopub use output_file::Value as ...lines were adjacent, one is dropped)
Security risks
None. No logic, control flow, validation, or data handling is touched — every code change is a type-name substitution to the same underlying type, plus Cargo manifest line deletions.
Level of scrutiny
Low. This is the definition of a safe mechanical refactor: type aliases are transparent to the compiler, so TaggedPointer::init(..) and TaggedPtr::init(..) compile to identical code. The Rust compiler enforces correctness — a missed call site or a wrong target name would fail rust:check-all (which the PR reports passing on all 10 targets). I independently grepped for stragglers and found none in Rust code.
Other factors
- No test is expected per REVIEW.md: dead-dep removal has no fail-before state, and identity type substitutions cannot change behavior.
- The
bun_collections::TaggedPtrre-export is preserved (just no longer renamed), so external callers ofbun_collections::TaggedPtrUnionetc. are unaffected. - The one comment-only edit in
server/mod.rs("TaggedPointer::init" → "TaggedPtr::init") keeps the doc accurate. - Follows the repo's "delete dead code in the same PR that makes it dead" and "no re-export shim files" guidance from REVIEW.md.
Follow-up to #34763, #34767, #34778.
bumpalo dependency removed
bumpalois dropped from the workspace root and 10 member crates (ast, base64, bundler, css, js_parser, js_printer, parsers, resolver, shell_parser, sourcemap). The last code-level use was thepub type Bump = bumpalo::Bumpalias deleted in #34778; every remainingbumpaloreference insrc/is in a comment (verified:rg 'bumpalo' --type rust src/ | grep -v '//'returns nothing).TaggedPointer → TaggedPtr
The long-name
TaggedPointeralias existed in bothbun_ptrandbun_collections, both resolving totagged_pointer::TaggedPtr. Rewrote the 5 call sites to useTaggedPtrdirectly and replaced both aliases with plain re-exports of the canonical name:io/posix_event_loop.rs(3 sites, viabun_collections::)runtime/server/mod.rs,runtime/server/NodeHTTPResponse.rs(2 sites, viabun_ptr::)Duplicate/compat aliases consolidated
bun_ast::ToSourceOpts→ToSourceOptions(1 caller inini/lib.rs)bundler::options::OutputValue→OutputFileValue(2 callers inStandaloneModuleGraph.rs; both names aliased the sameoutput_file::Valueon adjacent lines)Verification
bun bdbuildsbun run rust:check-allpasses on all 10 targetsNet: +11 / -39 (including Cargo.lock regen).
No test added: bumpalo was already unreferenced in code (dead dep removal has no fail-before state); the alias rewrites are identity substitutions to the type each alias already resolved to.