Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
19f5f99
Purge all remaining port-batch markers (Round-X, round-G, reconciler-N)
Jarred-Sumner May 16, 2026
baeeacb
Clean up phase markers and PORT_NOTES_PLAN cross-references in remain…
Jarred-Sumner May 16, 2026
37d1fcf
Address review nits: drop line-number refs, CYCLEBREAK(b0), NOALIAS_H…
Jarred-Sumner May 16, 2026
6278f0a
Clean up bare batch parentheticals, empty backtick artifacts, and rou…
Jarred-Sumner May 16, 2026
fdb1b94
Fix factually wrong comment about HTTPVerboseLevel crate tier
Jarred-Sumner May 16, 2026
c4167e7
Drop remaining B-3 batch markers in bundler options
Jarred-Sumner May 16, 2026
00b0f83
Final port-batch marker sweep: lockfile, sys, Cargo.toml, js_parser s…
Jarred-Sumner May 16, 2026
f71122d
Drop last round-C marker in fold.rs
Jarred-Sumner May 16, 2026
6515182
Fix factual errors in dependency-cycle comments and stale gate refere…
Jarred-Sumner May 16, 2026
ae94b8d
Audit and fix factual errors in dependency-cycle comments
Jarred-Sumner May 16, 2026
15f8418
Fix cache.rs tier claim, revert ThreadPool.rs, wire bun_analytics dep
Jarred-Sumner May 16, 2026
cb164c7
Delete done-process TODOs in jsc_hooks.rs
Jarred-Sumner May 16, 2026
5fe5886
Remove dead code orphaned by stale-TODO deletion in jsc_hooks.rs
Jarred-Sumner May 16, 2026
01a6457
Unwrap purposeless brace blocks; clean port markers in css/rules/medi…
Jarred-Sumner May 16, 2026
a0b9a57
Rename phase_c_exports.rs to link_exports.rs; clean Phase C/D markers
Jarred-Sumner May 16, 2026
e5c687d
Clean port-batch markers in css/ast/bundler/jsc/runtime sibling modules
Jarred-Sumner May 16, 2026
b6aa67c
Fix unexpected_cfgs justification and clean sql_jsc gating markers
Jarred-Sumner May 16, 2026
f400d2c
Clean remaining port-batch markers and stale gating claims tree-wide
Jarred-Sumner May 16, 2026
357cef7
Drop bare R-2 workstream tags from comments tree-wide
Jarred-Sumner May 16, 2026
c1238ca
Fix remaining empty-backtick artifacts, stranded punctuation, and inc…
Jarred-Sumner May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/ast/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,9 @@ impl Expr {
}
}

// Expr — property/object/string accessor methods.
// TODO(port): these call into `E::Object::as_property` / `EString`
// methods that need `bun_core::utf16_eql_string`/`to_utf8_alloc` (track-A
// blocked_on) and `Vec::deep_clone`. Types are real; bodies un-gate with
// the parser round once those land.
// Expr — property/object/string accessor methods. These call into
// `E::Object::as_property` / `EString` methods backed by
// `bun_core::utf16_eql_string` / `to_utf8_alloc` and `Vec::deep_clone`.
Comment on lines +285 to +287
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Three more out-of-diff-sibling clusters of explicitly-targeted patterns survive (same class as #3253647490, different files): (1) src/ast/fold_string_addition.rs:7 '(round-C draft)' — the last [Rr]ound-[A-Z] hit tree-wide, sibling of PR-edited ast/expr.rs; (2) nine \`\`-gated artifacts in css/ parent modules of PR-edited custom.rs/font.rs/keyframes.rs/media.rs (properties/mod.rs:199/225/233, rules/mod.rs:348/540, rules/style.rs:43, rules/property.rs:66, selectors/selector.rs:573, selectors/parser.rs:4312) plus bundler/ParseTask.rs:493 and install/PackageManager.rs:69 TODO(b0); (3) (phase-d) in jsc/AbortSignal.rs:263, jsc/HTTPServerAgent.rs:45, runtime/hw_exports.rs:1, runtime/server/RequestContext.rs:328 (RequestContext.rs also carries 4× TODO(b2-blocked) + 4× Phase B, so it may fall under the #30879 carve-out). The strongest hit is properties/mod.rs:232-234 — the doc-comment ON pub mod custom; still says 'parse/to_css/deep_clone/eql/hash bodies remain internally ``-gated there', directly contradicting custom.rs's own doc which this PR just rewrote to drop that claim. Comment-only, zero runtime impact; per the triage rule each becomes 'gated' / drops the batch tag.

Extended reasoning...

What was left behind

This PR's verification claim ('grep for all known port-batch patterns in the diff's files → 0') holds — none of the files below are in the 83 changed files. But the established review pattern on this PR (resolved #3252700302/#3252763439/#3252788306/#3252788309 and open #3253647490, all swept by the author) is that explicitly-targeted patterns surviving in sibling/parent modules of PR-edited files get listed for completeness. Three more clusters of that shape survive that aren't covered by #3253647490 (which lists server/mod.rs, media.rs, ScopeFunctions.rs, phase_c_exports.rs):

(1) round-C — last tree-wide hit

src/ast/fold_string_addition.rs:7 reads:

EString::push / EString::clone_rope_nodes are still gated in E.rs (round-C draft); inline the minimal surface here so this file can un-gate

Round-[CDEGH] is the first targeted pattern in the PR description, and rg '[Rr]ound-[A-Z]' src returns only this one hit tree-wide. The identical '(round-C draft)' phrasing was already swept from js_parser/fold.rs:23 in this PR (commit 01c5536, resolved #3252795348/#3252809425) — this is the same artifact in src/ast/ rather than src/js_parser/, so the 'rg [Rr]ound-[A-Z] src/js_parser → 0' verification didn't cover it. src/ast/expr.rs IS in the changed-files list (track-A blocked_on removed at :285), making fold_string_addition.rs a same-directory sibling.

(2) \`\`-gated — css/ parent modules + two non-css siblings

908f16f swept the \`\`-gated empty-backtick artifacts from PR-edited css files (custom.rs ×4, font.rs, css_parser.rs — resolved #3252714625), but rg '\`-gated' src/css` still returns 8 hits in their parent/sibling modules:

File Line(s) Relationship
properties/mod.rs 199/225/233 parent declaring pub mod font; / pub mod custom;
rules/mod.rs 348/540 parent declaring keyframes.rs/media.rs
rules/style.rs 43 sibling of keyframes.rs/media.rs
rules/property.rs 66 sibling of keyframes.rs/media.rs
selectors/selector.rs 573 same crate
selectors/parser.rs 4312 same crate

Plus two non-css siblings of PR-edited files: bundler/ParseTask.rs:493 (\`\`-gated, sibling of bundle_v2.rs/options.rs) and install/PackageManager.rs:69 (TODO(b0) — the same B-0 tag this PR converts 4× in bundle_v2.rs; sibling of PR-edited bin.rs/lockfile.rs/Cargo.toml).

The strongest case is properties/mod.rs:232-234: it's the doc-comment ON the pub mod custom; declaration and reads 'parse/to_css/deep_clone/eql/hash bodies remain internally ``-gated there' — directly contradicting custom.rs's own module doc, which this PR rewrote at :9-18 to drop exactly that claim. The PR introduced this parent↔child contradiction (before the PR both said the same thing).

(3) phase-d / TODO(b2-blocked) — jsc/ + runtime/ siblings

The PR description explicitly lists phase-d among targeted patterns, and the diff removes it from parse_stmt.rs:37 and HashObject.rs:193. After this PR, rg '\(phase-d\)|^//! phase-d' returns four hits:

File Line Marker Relationship
jsc/AbortSignal.rs 263 PORT NOTE (phase-d): sibling of 7 PR-edited src/jsc/ files
jsc/HTTPServerAgent.rs 45 PORT NOTE (phase-d): (same)
runtime/hw_exports.rs 1 //! phase-d: sibling of jsc_hooks.rs (~40 lines edited)
runtime/server/RequestContext.rs 328 per phase-d rules sibling of ServerWebSocket.rs

RequestContext.rs additionally carries TODO(b2-blocked) (lines 185/1030/2795/3186) — the form this PR converted ~20× to TODO(port) in jsc_hooks.rs/VirtualMachine.rs/options.rs — plus 4× Phase B (127/167/1037/3194). Its unusually high survivor count suggests it may fall under the '#30879 still touches' carve-out, but the three single-marker (phase-d) files (AbortSignal/HTTPServerAgent/hw_exports) almost certainly don't.

Step-by-step proof (properties/mod.rs:233 — the PR-introduced contradiction)

  1. PR description lists 'stranded empty-backtick artifacts (``-gated)' as a targeted pattern.
  2. PR diff at custom.rs:9-18 rewrites the module doc from 'A few leaf calls … are still -gated in *other* files … Remaining internal gates carry blocked_on: notes for the next round' → 'A few leaf calls … have their bodies inlined verbatim under mod ext below'.
  3. properties/mod.rs:232-234 (the doc-comment ON pub mod custom;) still reads 'parse/to_css/deep_clone/eql/hash bodies remain internally ``-gated there' — pointing the reader at custom.rs.
  4. A reader following that pointer to custom.rs finds a module doc that (as of this PR) says nothing of the sort.
  5. Before this PR, parent and child docs agreed (both said ``-gated). The PR rewrote the child and not the parent, introducing the contradiction.

Not a duplicate

Unresolved #3253647490 lists server/mod.rs, media.rs, ScopeFunctions.rs, phase_c_exports.rs — zero file overlap with any of the ~18 locations above. Resolved #3252714625 covered ``-gated only in PR-edited files (custom.rs/css_parser.rs/jsc_hooks.rs/VirtualMachine.rs, all fixed in 908f16f). None of the 22 prior PR comments mention fold_string_addition.rs, properties/mod.rs, rules/mod.rs, rules/style.rs, rules/property.rs, selectors/, ParseTask.rs, PackageManager.rs:69, AbortSignal.rs, HTTPServerAgent.rs, hw_exports.rs, or RequestContext.rs.

Impact and fix

Zero runtime impact — comment-only. Per the triage rule ('keep the substance, drop the batch-number framing'):

  • fold_string_addition.rs:7: '(round-C draft)' → '(an earlier draft)' or drop the clause (same fix as fold.rs:23).
  • **css/ -gated**: each '-gated' → 'gated' or rephrase; properties/mod.rs:232-234 should be aligned with custom.rs's rewritten doc.
  • ParseTask.rs:493: 'remain ``-gated' → 'remain gated'. PackageManager.rs:69: TODO(b0) → `TODO(port)`.
  • (phase-d): PORT NOTE (phase-d):PORT NOTE:; //! phase-d: → drop the prefix; RequestContext.rs's TODO(b2-blocked)TODO(port) (or skip RequestContext.rs entirely if it's under the Replace HiveArrayFallback's uninit-pointer API with safe construction #30879 carve-out).

Non-blocking nit; flagging only because all three patterns are explicitly listed as targeted, the precedent on this PR is that out-of-diff sibling survivors get swept, and (1) closes out the PR's headline pattern tree-wide while (2) includes a contradiction this PR introduced.

Anchored on ast/expr.rs since none of the survivor files are in the diff.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — cb787f9 handled all three clusters: rg '[Rr]ound-[A-Z]' src is now 0 tree-wide, the nine css/ ``-gated artifacts + ParseTask.rs:493 are gone, the properties/mod.rs:232-234 ↔ custom.rs contradiction is resolved, and AbortSignal/HTTPServerAgent/hw_exports dropped (phase-d). One straggler from cluster (2): `src/install/PackageManager.rs:69` still reads `// TODO(b0): RunCommand arrives from move-in` — same `TODO(b0)` → `TODO(port)` conversion as bundle_v2.rs:370/742. (RequestContext.rs left as-is per the #30879 carve-out the comment flagged.)


impl Expr {
pub fn has_any_property_named(&self, names: &'static [&'static [u8]]) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions src/ast/fold_string_addition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use crate::{self as js_ast, E, Expr, StoreRef, e};
use bun_alloc::Arena; // bumpalo::Bump re-export

// ── local rope helpers ─────────────────────────────────────────────────────
// `EString::push` / `EString::clone_rope_nodes` are still gated in E.rs
// (round-C draft); inline the minimal surface here so this file can un-gate
// without touching E.rs. These mirror the Zig bodies 1:1.
// Mirrors the Zig `E.String.push` / `E.String.cloneRopeNodes` bodies 1:1.
// `estring_push` takes the rope tail as a `StoreRef<EString>` (callers here
// already hold one) instead of `&mut EString` like `EString::push` does.

#[inline]
fn store_append_string(s: E::EString) -> StoreRef<E::EString> {
Expand Down
4 changes: 1 addition & 3 deletions src/bun_bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ bun_crash_handler.workspace = true
bun_mimalloc_sys.workspace = true
bun_platform.workspace = true

# Phase-C: bun_runtime now compiles green; pulled in for `Cli::start()`.
# bun_jsc remains gated until the JSC bridge links.
# bun_runtime is pulled in for `Cli::start()`; bun_jsc comes in transitively.
bun_runtime.workspace = true
# bun_jsc.workspace = true
2 changes: 1 addition & 1 deletion src/bun_bin/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

use core::ffi::{c_char, c_int};

mod phase_c_exports;
mod link_exports;

// Force-link `bun_platform` so its `#[no_mangle]` C exports
// (`sys_epoll_pwait2`, `ioctl_ficlone`, …) reach the linker.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! PHASE-C link bridge — **transient**, not a permanent grab-bag.
//! Link-time `#[no_mangle]` export bridge — **transient**, not a permanent
//! grab-bag.
//!
//! Every symbol that used to be stubbed here now has a real home (the `.rs`
//! sibling of the Zig `export fn`) inside `bun_jsc` / `bun_runtime` /
Expand All @@ -18,7 +19,7 @@
//!
//! Calling convention: `jsc.conv` is plain `"C"` on every non-Windows-x64
//! target, so `extern "C"` is correct on Linux/macOS. The Windows path is not
//! exercised in Phase C.
//! currently exercised here.

#![allow(
non_snake_case,
Expand Down Expand Up @@ -62,7 +63,7 @@ type VirtualMachine = c_void;
// Real-body exports (no gated-crate dependency)
// ════════════════════════════════════════════════════════════════════════════

// PHASE-C: C++ callback — Zig: `pub export fn Bun__panic(msg, len) noreturn`
// C++ callback — Zig: `pub export fn Bun__panic(msg, len) noreturn`
// REAL: src/main.rs (binary-level export; defined here directly)
#[unsafe(no_mangle)]
pub extern "C" fn Bun__panic(msg: *const u8, len: usize) -> ! {
Expand All @@ -85,7 +86,7 @@ pub extern "C" fn Bun__panic(msg: *const u8, len: usize) -> ! {
// Bun__NODE_NO_WARNINGS

// REAL: `Bun__getTLSRejectUnauthorizedValue` / `Bun__isNoProxy` now exported
// directly from `bun_jsc::virtual_machine_exports` (un-gated in phase-d).
// directly from `bun_jsc::virtual_machine_exports`.

// REAL: now provided by bun_runtime (src/runtime/napi/napi_body.rs).
// napi_internal_suppress_crash_on_abort_if_desired
Expand Down
4 changes: 2 additions & 2 deletions src/bun_core/Progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ unsafe extern "system" {

// Progress's terminal handle is the canonical `output::File` (vtable-backed
// stderr/File from `OutputSinkVTable`). The duplicate `ProgressTerminalVTable`
// from B-0 round 1 is removed; tty/ansi/winsize route through the new
// `OutputSinkVTable` slots so `bun_core` stays T0 (no `bun_sys` dep).
// was removed; tty/ansi/winsize route through the `OutputSinkVTable` slots so
// `bun_core` stays T0 (no `bun_sys` dep).
use crate::Fd;
pub use crate::output::File;
use crate::output::output_sink;
Expand Down
2 changes: 1 addition & 1 deletion src/bun_core/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2734,7 +2734,7 @@ pub use wtf::parse_double;
///
/// Unlike `Cell<String>`, [`set`] derefs the previous value and [`replace`]
/// returns an [`OwnedString`] — so the only way to leak a refcount is to
/// `mem::forget` the cell or its `replace` result. The R-2 `&self` migrations
/// `mem::forget` the cell or its `replace` result. The `&self` migrations
Comment thread
claude[bot] marked this conversation as resolved.
/// introduced `Cell<String>::set(..)` calls that silently leaked the old +1.
///
/// [`get`] returns a bitwise `String` copy with **borrow** semantics (no ref
Expand Down
5 changes: 1 addition & 4 deletions src/bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ bumpalo.workspace = true
typed-arena.workspace = true
bun_base64.workspace = true
bun_alloc.workspace = true
# TODO(b2-blocked): bun_analytics — adding the dep triggers a fresh build of
# upstream crates (css/logger/js_parser) with in-progress breakage. Re-add once
# the tree is green; usages in options.rs are gated or stubbed locally.
# bun_analytics.workspace = true
bun_analytics.workspace = true
bun_resolver.workspace = true
# `bun_resolve_builtins` only depends on `bun_options_types` + `bun_string`
# (both already in this graph), so no cycle.
Expand Down
8 changes: 4 additions & 4 deletions src/bundler/LinkerContext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ bun_core::declare_scope!(LinkerCtx, visible);
bun_core::declare_scope!(TreeShake, hidden);

// ══════════════════════════════════════════════════════════════════════════
// CYCLEBREAK(b0): vtable instance for `bun_crash_handler::BundleGenerateChunkVTable`
// (cold-path §Dispatch — crash trace only). crash_handler (T1) holds erased
// `(*const LinkerContext, *const Chunk, *const PartRange)`; bundler supplies
// the formatter that knows their layout. Mirrors src/crash_handler/crash_handler.zig:135.
// Vtable instance for `bun_crash_handler::BundleGenerateChunkVTable` (cold
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Two more empty-backtick artifacts of the () class survived dd85136e in PR-edited files: **`src/bundler/LinkerContext.rs:138`** reads " LinkerGraph SoA accessors are real now ( on `JSAst`/`JSMeta`/`File`)" (the gated-feature name was stripped, leaving ( on), and **`src/runtime/webcore/Body.rs:694`** reads "Recover the parent via offset_of!``) `` and forward." (orphaned `` ``) ``). Both files are in the changed-files list (LinkerContext.rs:60-67 dropped CYCLEBREAK(b0)`; Body.rs had six R-2 tags stripped at :89/:115/:1739/:2302/:2656), so the per-diff-file verification claim ("grep → 0") doesn't quite hold for this artifact class. Same in-diff-file-survivor pattern as resolved #5/#13/#26/#30 — comment-only, non-blocking.

Extended reasoning...

What was left behind

HEAD commit dd85136 ("Fix remaining empty-backtick artifacts, stranded punctuation, and inconsistent docs") swept the () ``-class survivors that the 23:17/23:36/23:40 follow-up threads enumerated (host_fns.rs:12, `rules/mod.rs:388-390`, `timer/mod.rs`). Two more occurrences of the same artifact class survive in files this PR edits:

src/bundler/LinkerContext.rs:138-139 reads:

// `LinkerGraph` SoA accessors are real now (`` on
// `JSAst`/`JSMeta`/`File`); the submodule bodies un-gate against those.

The ( ontoken is a stranded empty-backtick artifact — an earlier rewrite stripped a feature-flag/gate name out of (X on JSAst/...) , leaving the bare plus the trailing on. This is exactly the pattern class the PR description lists as targeted: "Stranded empty-backtick artifacts ( -gated, () ) … from earlier rewrites".

src/runtime/webcore/Body.rs:694 reads:

/// `offset_of!``) and forward.

The ) is the trailing half of the same () pattern — presumably once read "(via offset_of!)" or "offset_of! (container_of!) and forward." before content was stripped, leaving the orphaned close-paren glued to empty backticks.

Why this is in scope

Both files are in this PR's 177 changed files:

So both fall under the verification claim "grep for all known port-batch patterns in the diff's files → 0". The () / -gated pattern is one of those known patterns (it's explicitly bullet-listed in the description), and a grep for it across the diff's file set returns exactly these two hits — the verification claim doesn't quite hold.

This is the same in-diff-file-survivor class as resolved comments #5 (custom.rs -gated, fixed in 908f16f9), #13 (visit/mod.rs:709 -gated, fixed in ba86ce4), #26/#30 (host_fns.rs:12 () ``, fixed in dd85136 itself). Both artifacts pre-date this PR (git blame23427db, the original Rust rewrite), so this is the "explicitly-targeted pattern surviving in a PR-edited file" class, not a PR-introduced regression.

Step-by-step proof

  1. PR description lists "Stranded empty-backtick artifacts ( -gated, () )" as a targeted pattern.
  2. dd85136 (HEAD) swept this pattern at host_fns.rs:12 and rules/mod.rs:388-390 — confirming () `` is in the active sweep set.
  3. src/bundler/LinkerContext.rs is in the changed-files list (diff hunk at :60-67); :138 reads ( on JSAst/... `` at HEAD — verified.
  4. src/runtime/webcore/Body.rs is in the changed-files list (diff hunks at :89/:115/:1739/:2302/:2656); :694 reads `offset_of!) and forward. `` at HEAD — verified.
  5. rg '\(``|``\)' across the 177 PR-edited files returns exactly these two hits — the per-diff-file verification claim is contradicted by ≥2.
  6. None of the 32 prior PR comments mention LinkerContext.rs:138 or Body.rs:694 (resolved Copy source lines when generating error messages #3 covered LinkerContext.rs:63, a different issue) — not a duplicate.

Impact and fix

Zero runtime impact — comment-only doc text. Per the PR's triage rule ("keep the substance, drop the batch-number framing"):

  • LinkerContext.rs:138: drop the empty parenthetical entirely — the real now claim already conveys the substance:

    // `LinkerGraph` SoA accessors are real now on
    // `JSAst`/`JSMeta`/`File`; the submodule bodies un-gate against those.

    (or just // LinkerGraph SoA accessors are real now; the submodule bodies …)

  • Body.rs:693-694: restore the dropped open-paren or simplify:

    /// header carries the refcount + pool back-pointer. Recover the parent (via
    /// `offset_of!`) and forward.
    

Non-blocking nit; flagging only because both are exactly the artifact class dd85136 claims to have closed out, in files the PR already edits.

// path — crash trace only). `crash_handler` holds erased `(*const
// LinkerContext, *const Chunk, *const PartRange)`; the bundler supplies the
// formatter that knows their layout. Mirrors src/crash_handler/crash_handler.zig:135.
// ══════════════════════════════════════════════════════════════════════════
#[cfg(feature = "show_crash_trace")]
bun_crash_handler::link_impl_BundleGenerateChunkCtx! {
Expand Down
5 changes: 0 additions & 5 deletions src/bundler/ParseTask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,6 @@ export var __callDispose = (stack, error, hasError) => {

// ══════════════════════════════════════════════════════════════════════════
// Per-file parse worker — `getAST`/`getCodeForParseTask`/`runFromThreadPool`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 🟡 cb787f9 swept most of the 22:40 comment's list (including ParseTask.rs:493 here) but skipped two: install/PackageManager.rs:69 still reads TODO(b0): RunCommand arrives from move-in, and runtime/server/RequestContext.rs still carries (phase-d):328 + 4× TODO(b2-blocked) (:185/:1030/:2795/:3186) + 4× Phase B (:127/:167/:1037/:3194) + ``-gated:416 — gh pr view 30879 --json files confirms neither is in #30879, so the carve-out doesn't shield them. Two more out-of-diff sibling clusters not in any prior comment: (a) the hyphenated Phase-A/Phase-B form (which a space-anchored Phase A grep misses) survives in install/lib.rs:11/14/21/231/1079 (crate root declaring PR-edited bin.rs/lockfile.rs/Cargo.toml), install/TarballStream.rs:1405, runtime/bake/DevServer.rs:5410, runtime/server/server_body.rs:1378, runtime/api/bun/h2_frame_parser.rs:641; (b) TODO(b*)/``-gated in three crates this PR hasn't touched: js_printer/renamer.rs:668 TODO(b2-blocked), js_printer/lib.rs:6742 ``-gated (also factually stale — bun_ast::runtime is real per this PR's own jsc_hooks.rs BunWrap cleanup), css_jsc/lib.rs:13 ``-gated, collections/bit_set.rs:126/1516 TODO(b2)/TODO(b0), collections/lib.rs:30 TODO(b2-large). Comment-only, zero runtime impact; same out-of-diff-sibling class as resolved #22/#23/#24/#26 — flagging so they ride along rather than spawn another follow-up.

Extended reasoning...

What was left behind

HEAD commit cb787f9 ("Clean port-batch markers in css/ast/bundler/jsc/runtime sibling modules") was the response to the 22:40 review comment, which enumerated three out-of-diff-sibling clusters of explicitly-targeted patterns. cb787f9 addressed ~13 of the ~15 listed items: ast/fold_string_addition.rs, the nine css/ parent-module files, bundler/ParseTask.rs:493 (anchored here — the 5-line ``-gated block was deleted), and jsc/AbortSignal.rs / jsc/HTTPServerAgent.rs / runtime/hw_exports.rs. Two items from that comment's enumeration were skipped, and two further sibling clusters of the same targeted patterns survive that no prior comment has named. None of the survivor files are in the 98 changed files, so the per-diff-file verification claim ("grep for all known port-batch patterns in the diff's files → 0") technically holds — this is the weaker out-of-diff-sibling class established by resolved comments #3252788306 (lockfile.rs), #3252788309 (11 js_parser siblings), #3253647490 (server/mod.rs et al.), and #3253671780 (the 22:40 comment itself), all of which the author swept in follow-up commits.

Cluster (1): comment-#23 remainder — partial-fix follow-up

install/PackageManager.rs:69 reads // TODO(b0): RunCommand arrives from move-in (bun_runtime::cli::RunCommand → install). — the same TODO(b0) form this PR converts 4× in bundle_v2.rs (lines 370/495/742/5229 → TODO(port)). The 22:40 comment listed PackageManager.rs:69 alongside ParseTask.rs:493; cb787f9 fixed ParseTask.rs but not PackageManager.rs. No carve-out was ever suggested for this file.

runtime/server/RequestContext.rs carries 10 markers: per phase-d rules at :328; TODO(b2-blocked) at :185/:1030/:2795/:3186 (the same form this PR converted ~20× in jsc_hooks.rs/VirtualMachine.rs/options.rs); Phase B at :127/:167/:1037/:3194; and ``-gated at :416. The 22:40 comment hedged that this file "may fall under the #30879 carve-out" — gh pr view 30879 --json files confirms it does not, so the PR description's only stated carve-out doesn't apply.

This is the well-established partial-fix-follow-up pattern on this PR: resolved #3252795348 (fold.rs:23 — comment listed :23/:62, response handled :62 only), #3252811820 (visit/mod.rs:709), #3252967867 (BunWrap tail), and the 22:18 follow-up (server/mod.rs after 72cf6b6 handled 1-of-4) — each flagged the N-minus-k remainder after a response commit, and each was addressed.

Cluster (2): hyphenated Phase-A/Phase-B — grep blind spot

The PR description says #30877 swept Phase A/B and this PR catches "the long tail … the case-sensitive greps missed". The hyphenated form Phase-A / Phase-B — which a space-anchored 'Phase A' grep would miss, exactly the kind of grep blind spot the PR title references — survives in five sibling/parent modules of PR-edited files:

File Line(s) Relationship to diff
install/lib.rs 11/14/21/231/1079 (5×) crate root declaring PR-edited bin.rs/lockfile.rs/lockfile/Tree.rs; install/Cargo.toml is in the diff
install/TarballStream.rs 1405 (Phase-B) sibling of bin.rs/lockfile.rs
runtime/bake/DevServer.rs 5410 sibling of PR-edited bake_body.rs
runtime/server/server_body.rs 1378 sibling of PR-edited ServerWebSocket.rs (the 22:57 comment covers server/mod.rs:7 but not server_body.rs)
runtime/api/bun/h2_frame_parser.rs 641 under runtime/api/, same tree as PR-edited HashObject.rs

The hyphenated form is already established as in-scope on this PR — the unresolved 22:57 comment covers server/mod.rs:7 "full Phase-A draft", and install/lib.rs is the exact analogue of the lockfile.rs ← Tree.rs parent-module precedent from resolved #3252788306.

Cluster (3): TODO(b*) / ``-gated in untouched crates

Three crates carry the patterns this PR explicitly targets but have zero files in the diff and aren't named in any of the 26 prior PR comments:

  • js_printer/renamer.rs:668TODO(b2-blocked): bun_core::env_var::BUN_DUMP_SYMBOLS
  • js_printer/lib.rs:6742full `runtime.rs` is-gated upstream `` — also factually stale: bun_ast::runtime::Runtime::source_code() is real and this PR's own jsc_hooks.rs:3369 calls it (the BunWrap arm cleanup in 0fa0f77)
  • css_jsc/lib.rs:13``-gated on `bun_css::values::color::*`
  • collections/bit_set.rs:126TODO(b2): callers needing >64 bits
  • collections/bit_set.rs:1516TODO(b0): strings arrives in bun_core via move-in
  • collections/lib.rs:30TODO(b2-large): heavy nightly-feature usage

This is admittedly the weakest scope relationship of any survivor finding on this PR — js_printer/css_jsc/collections are entirely separate crates, vs. all prior accepted comments which targeted parent/sibling modules within crates the PR already edits. However: js_printer is the direct counterpart of js_parser (18 files edited here) and is named in this PR's own cache.rs rewrite; css_jsc is the _jsc bridge for PR-edited css/; and the cross-crate Cargo.toml sweep precedent (resolved #3252788307 → 642550c) already reached into url/sourcemap/resolve_builtins which had zero .rs edits at the time. Surfacing these lets the author make an informed scope-cutoff decision rather than discover them in another follow-up.

Step-by-step proof

  1. The 22:40 timeline comment listed install/PackageManager.rs:69 TODO(b0) and RequestContext.rs:328 phase-d + 4× TODO(b2-blocked) + 4× Phase B alongside ParseTask.rs:493.
  2. git diff 880ee892..HEAD --name-only shows ParseTask.rs IS in the 98 changed files (the diff at @@ -488 deletes the 5-line ``-gated block); PackageManager.rs and RequestContext.rs are NOT (git log shows both last touched pre-PR).
  3. At HEAD, PackageManager.rs:69 reads TODO(b0): RunCommand arrives from move-in — verified.
  4. At HEAD, RequestContext.rs has all 10 claimed markers at the exact lines listed — verified via sed -n.
  5. gh pr view 30879 --json files returns neither file — the Replace HiveArrayFallback's uninit-pointer API with safe construction #30879 carve-out doesn't shield them.
  6. rg 'Phase-[AB]' src/install src/runtime returns the 9 hyphenated hits listed in cluster (2) — none in the 98 changed files, none mentioned in any prior comment except server/mod.rs:7 (covered separately).
  7. rg 'TODO\(b[02]|``-gated' src/js_printer src/css_jsc src/collections returns the 6 hits in cluster (3) — none in any prior comment.
  8. PR description explicitly lists B-0, Phase C/D/F, phase-d, TODO(b1) (via Clean up Zig-port phase comments and trivial lint warnings #30877), and "stranded empty-backtick artifacts (``-gated)" as targeted; Clean up Zig-port phase comments and trivial lint warnings #30877 explicitly targeted Phase A/B and TODO(b2-*).

Impact and fix

Zero runtime impact — comment-only. Per the PR's triage rule ("keep the substance, drop the batch-number framing, delete done-process comments"):

  • PackageManager.rs:69: TODO(b0)TODO(port) (same conversion as bundle_v2.rs).
  • RequestContext.rs: TODO(b2-blocked)TODO(port) (4×); drop per phase-d rules / Phase B / in Phase B framings; ``-gated → gated.
  • Phase-A/Phase-B: rewrite to plain prose (drafts, earlier draft, Resolved paths) or drop the qualifier — same rewrite the 22:57 comment prescribes for server/mod.rs:7.
  • js_printer/css_jsc/collections: TODO(b*)TODO(port); ``-gated → gated (or delete js_printer/lib.rs:6742 outright since bun_ast::runtime is real).

Non-blocking nit; flagging only because all patterns are in the description's explicitly-targeted list and the established precedent on this PR is that out-of-diff sibling survivors get swept in the same response commit rather than spawning another follow-up round.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — d85dd77 handled two of cluster (3): js_printer/lib.rs:6742 (the stale -gated `runtime.rs` TODO deleted) and `css_jsc/lib.rs:13` (-gated → dropped). The rest of the comment is still outstanding at HEAD (e97f778):

Cluster (1) — neither file touched since pre-PR e520065:

  • install/PackageManager.rs:69 still reads TODO(b0): RunCommand arrives from move-in
  • runtime/server/RequestContext.rs still carries all 10 markers (:127/:167/:185/:328/:416/:1030/:1037/:2795/:3186/:3194)

Cluster (2)rg 'Phase-[AB]' src returns the same 9 hits: install/lib.rs:11/14/21/231/1079, install/TarballStream.rs:1405, runtime/bake/DevServer.rs:5410, runtime/server/server_body.rs:1378, runtime/api/bun/h2_frame_parser.rs:641 (plus server/mod.rs:7, already carved out).

Cluster (3) remainder — js_printer/renamer.rs:668 TODO(b2-blocked), collections/bit_set.rs:126/1516 TODO(b2)/TODO(b0), collections/lib.rs:30 TODO(b2-large).

Per the 22:58 #30879 carve-out (and robobun's HiveArrayFallback warning list on this build), DevServer.rs / server_body.rs / h2_frame_parser.rs / renamer.rs are plausibly shielded — happy to defer those. That still leaves PackageManager.rs:69, RequestContext.rs (which the comment already confirmed isn't in #30879), install/lib.rs (×5), TarballStream.rs:1405, and the three collections/ hits with no carve-out. Same fixes as before: TODO(b0)/TODO(b2*)TODO(port); Phase-A/Phase-B → drop the qualifier; RequestContext.rs's ``-gated:416 → gated.

// The struct/FFI surface and `get_runtime_source` are real. Bodies
// that touch the still-gated `crate::ThreadPool` Worker module or the opaque
// `JSBundlerPlugin`/`FileMap` forward-decls remain ``-gated
// per-function below with explicit `// blocked_on:` notes; they un-gate by
// deletion once those modules land.
// ══════════════════════════════════════════════════════════════════════════
pub mod parse_worker {
use super::*;
Expand Down
3 changes: 1 addition & 2 deletions src/bundler/ThreadPool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,7 @@ impl Worker {
// PORT NOTE: `MimallocArena::help_catch_memory_issues` collected
// mimalloc's deferred frees + zero-filled freed pages. The Rust
// arena is `bumpalo::Bump`, which has no equivalent — calls
// dropped, gated on the real `MimallocArena` un-gate
// (`bun_alloc/MimallocArena.rs` is ``).
// dropped, gated on the real `MimallocArena` un-gate.
}

worker
Expand Down
12 changes: 6 additions & 6 deletions src/bundler/bundle_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ pub mod bv2_impl {
use bun_resolver::fs::PathResolverExt as _;
use bun_resolver::{self as _resolver, Resolver, is_package_path};
use bun_threading::ThreadPool as ThreadPoolLib;
// TODO(b0): bake_types arrives from move-in (TYPE_ONLY Side/Graph/BuiltInModule/Framework → bundler)
// TODO(port): bake_types arrives from move-in (TYPE_ONLY Side/Graph/BuiltInModule/Framework → bundler)
use self::bake_types as bake;

/// CYCLEBREAK(b0) TYPE_ONLY: pure value types from bake that bundler needs without
/// CYCLEBREAK TYPE_ONLY: pure value types from bake that bundler needs without
/// depending on the full DevServer. Move-in pass keeps these as the canonical defs;
/// bun_bake (post tier-6 collapse: bun_runtime::bake) re-exports from here.
pub mod bake_types {
Expand Down Expand Up @@ -492,7 +492,7 @@ pub mod bv2_impl {
/// In Zig this lives on the legacy package_json `Framework`; the duck-typed
/// `comptime TranspilerType` callers reach it through `options.framework.?`.
pub client_css_in_js: crate::options::ClientCssInJs,
// TODO(b0-genuine): remaining Framework field `file_system_router_types`
// TODO(port): remaining Framework field `file_system_router_types`
// stays in T6; only bake::FrameworkRouter reads it.
_opaque_tail: (),
}
Expand Down Expand Up @@ -739,10 +739,10 @@ pub mod bv2_impl {
}
}
}
// TODO(b0): jsc::api arrives from move-in (TYPE_ONLY → bundler)
// TODO(port): jsc::api arrives from move-in (TYPE_ONLY → bundler)
use self::api as jsc_api;

/// CYCLEBREAK(b0) TYPE_ONLY: data-only halves of `jsc::api::JSBundler` and
/// CYCLEBREAK TYPE_ONLY: data-only halves of `jsc::api::JSBundler` and
/// `jsc::api::BuildArtifact` that the bundler reads/constructs without touching
/// JSC. The JS-thread halves (dispatch onto the JS event loop, `toJS`, plugin
/// FFI bodies) stay in tier-6 (`bun_runtime::api`) and re-export these.
Expand Down Expand Up @@ -5229,7 +5229,7 @@ pub mod bv2_impl {
Ok(ctx)
}

// TODO(b0-genuine): body has deep DevServer field access (current_bundle.start_data,
// TODO(port): body has deep DevServer field access (current_bundle.start_data,
// css_entry_points, etc.). After tier-6 collapse this fn should be HOISTED into
// bun_runtime::bake (which can name DevServer concretely) and call back into BundleV2
// helpers. Until then the entry-point fields are reached through the vtable.
Expand Down
16 changes: 8 additions & 8 deletions src/bundler/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ use bun_parsers::json_parser;
use bun_resolver::fs as fs_mod;
use bun_sys::{self, Fd};

// B-3 UNIFIED: `Define` is now the single canonical `bun_js_parser::defines::Define`
// (re-exported via `crate::defines`); `JavaScript::parse`/`scan` and the bundler's
// `Define` is the single canonical `bun_js_parser::defines::Define` (re-exported
// via `crate::defines`); `JavaScript::parse`/`scan` and the bundler's
// `BundleOptions.define` share the same nominal type.
use js_parser::defines::Define;

// ══════════════════════════════════════════════════════════════════════════
// B-3 UNIFIED: `RuntimeTranspilerCache` is canonical in `bun_js_parser`
// (lower tier) so `Features.runtime_transpiler_cache: Option<*mut RTC>` and
// `RuntimeTranspilerCache` is canonical in `bun_ast` (a lower-tier crate)
// so `Features.runtime_transpiler_cache: Option<*mut RTC>` and
// `ParseOptions.runtime_transpiler_cache: Option<&mut RTC>` are the same
// nominal type. This crate adds the env-var-gated `disabled`/`set_disabled` via
// the `RuntimeTranspilerCacheExt` trait below — those need `bun_core::env_var`
// which sits a tier above js_parser. `Entry` / `Metadata` stay concrete here;
// the canonical
// the `RuntimeTranspilerCacheExt` trait below; the disk-I/O / `js_printer`
// dispatch also lives here because it needs `bun_js_printer`, which sits a
// tier above `bun_ast`. `Entry` / `Metadata` stay concrete here; the canonical
Comment thread
claude[bot] marked this conversation as resolved.
// struct stores them type-erased as `*mut ()`.
// ══════════════════════════════════════════════════════════════════════════
use bun_ast::RuntimeTranspilerCache;
Expand All @@ -37,7 +37,7 @@ pub const RUNTIME_TRANSPILER_CACHE_VERSION: u32 = 20;
pub static DISABLED: AtomicBool = AtomicBool::new(false);

/// Extension surface for the canonical `RuntimeTranspilerCache` (defined in
/// `bun_js_parser`). Separate trait so the env-var-dependent bodies stay in
/// `bun_ast`). Separate trait so the env-var-dependent bodies stay in
/// this crate without an orphan-rule violation.
pub trait RuntimeTranspilerCacheExt {
/// Mirrors the Zig `pub var is_disabled` namespaced const — kept as an
Expand Down
2 changes: 1 addition & 1 deletion src/bundler/defines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::defines_table::{
};

// ══════════════════════════════════════════════════════════════════════════
// B-3 UNIFIED: `Define` / `DefineData` / `DotDefine` / `Flags` / `Options` /
// `Define` / `DefineData` / `DotDefine` / `Flags` / `Options` /
// `RawDefines` / `UserDefines` / `UserDefinesArray` are canonical in
// `bun_js_parser::defines` (lower tier) so the parser's `P.define: &'a Define`
// and `BundleOptions.define: Box<Define>` are the *same* nominal type. This
Expand Down
2 changes: 1 addition & 1 deletion src/bundler/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use bun_paths::{self, SEP};
// PORT NOTE: two `fs` shapes are in play here. `bun_resolver::fs` (`Fs`) holds
// the singleton `FileSystem` / `DirnameStore`; `bun_paths::fs` (`PFs`) defines
// the `Path`/`PathName` value types that `ImportRecord.path` is typed against.
// Both port `src/resolver/fs.zig`; B-3 collapses them. Until then, construct
// Both port `src/resolver/fs.zig`; until they are unified, construct
// `import_record.path` via `PFs::Path` so the field assignment unifies.
use bun_core::strings;
use bun_paths::fs as PFs;
Expand Down
4 changes: 2 additions & 2 deletions src/bundler/linker_context/scanImportsAndExports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@ pub fn scan_imports_and_exports(
dependencies.push(Dependency {
// PORT NOTE: `crate::Index` ↔ `bun_ast::Index` are both
// `#[repr(transparent)] u32` newtypes ported from the
// same Zig `ast.Index`; bridge by `.value` until B-3
// collapses them to a single re-export.
// same Zig `ast.Index`; bridge through the inner u32
// until they are collapsed to a single re-export.
source_index: bun_ast::Index(target_source_index.get()),
part_index: *part_index,
});
Expand Down
Loading
Loading