Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
495c6a7
Remove the .zig porting-reference sources
cirospaciari Jun 23, 2026
24e728b
codegen: drop on-disk .zig existence checks
cirospaciari Jun 23, 2026
0356580
Drop the Ban Words workflow step and 'banned' script
cirospaciari Jun 23, 2026
432c094
test: retarget the broken-pipe grep to parser.rs; drop the Zig-tests …
cirospaciari Jun 23, 2026
c69b6b3
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 23, 2026
4981c7c
codegen: restore resolved $zig() paths via a static table
robobun Jun 23, 2026
bf3d661
Merge remote-tracking branch 'origin/main' into ciro/rm-zig-sources
robobun Jun 23, 2026
ad42b11
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 23, 2026
a6be699
Sweep remaining scripts/ references to deleted .zig sources
robobun Jun 23, 2026
4616dc0
glob-sources: declare dev_server/mod.rs as a bakeRuntime input
robobun Jun 23, 2026
b437502
Sweep remaining dead Zig artifacts and doc references
robobun Jun 23, 2026
9e7d0a8
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 23, 2026
92ddac7
ci: retrigger (darwin-26-aarch64 artifact download timeout on #64230)
robobun Jun 23, 2026
06a9ab7
Merge remote-tracking branch 'origin/main' into ciro/rm-zig-sources
cirospaciari Jun 23, 2026
7055cd2
Fold all remaining Zig follow-ups into this PR
robobun Jun 23, 2026
cf5b836
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 23, 2026
07ba891
cppbind.ts: fix dangling resultFilePath reference in CI log line
robobun Jun 23, 2026
51831b6
Remove stale generated .zig files accidentally committed in 07ba891
robobun Jun 23, 2026
d75696d
Address review: perf-trace script correctness, half-edited comments, …
robobun Jun 23, 2026
a03841e
Restore .gitignore entries for the legacy Generated*.zig outputs
robobun Jun 23, 2026
8034036
Merge remote-tracking branch 'origin/main' into ciro/rm-zig-sources
robobun Jun 23, 2026
a321e6a
Merge main for #32608 s3 leak fix; address remaining review nits
robobun Jun 23, 2026
f32c694
codegen: remove dead Zig-emission machinery from cppbind/bindgenv2/sh…
robobun Jun 24, 2026
b7322e0
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 24, 2026
866aafb
Sweep four more dead-Zig stragglers
robobun Jun 24, 2026
b922970
cppbind: port [[ZIG_EXPORT]] validation into generateRustFn; finish d…
robobun Jun 24, 2026
69a13b2
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 24, 2026
f888622
Fix remaining half-edited comments; drop dead .gitignore/prose entries
robobun Jun 24, 2026
af58a93
Fix three more half-edit/dead-code residuals
robobun Jun 24, 2026
0852a94
build-prefixes.js correctness: drop is_flex_2009 shim; delete generat…
robobun Jun 24, 2026
087a307
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 24, 2026
5d296d4
generate-perf-trace-events.sh: use awk NF instead of grep -v for blan…
robobun Jun 24, 2026
47fb444
Address three review residuals: StandaloneModuleGraph half-edit, gene…
robobun Jun 24, 2026
ef708c3
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 24, 2026
19d0be3
targets.rs: re-pad Features bitflags to match build-prefixes.js output
robobun Jun 24, 2026
b85c825
mime_type: finish the generate-compact-string-table comment cleanup
robobun Jun 24, 2026
a019c6f
build-prefixes.js: match committed targets.rs exactly; Cargo.toml hal…
robobun Jun 24, 2026
0018bdd
Fix ReleaseFast and image/README.md half-edits
robobun Jun 24, 2026
c4f326a
perf/generated_perf_trace_events.rs: align header to script output
robobun Jun 24, 2026
a9b50b7
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 24, 2026
099e0f6
Docs: correct image/README system_backend; fix zig fences in STREAMS/…
robobun Jun 24, 2026
a23032c
v8 CLAUDE/AGENTS.md: rewrite the V8API code fence to Rust
robobun Jun 24, 2026
31a99ae
Docs: sweep remaining Zig prose/fences in b437502b-touched READMEs
robobun Jun 24, 2026
3c136e7
v8 CLAUDE/AGENTS.md: fix stale src\bun.js\ path in dumpbin line
robobun Jun 24, 2026
ee6fe62
Docs: rewrite last two ```zig fences to Rust
robobun Jun 24, 2026
fb32581
SKILL.md: sweep remaining jsc.JSRef/jsc.Strong/Zig cross-references
robobun Jun 24, 2026
962393f
js2native: rename $zig/$newZigFunction → $rust/$newRustFunction
Jarred-Sumner Jun 25, 2026
46fff1c
Fix half-edits and wrong trait path from 962393f5
robobun Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude/commands/upgrade-webkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ To do that:

Things to check for a successful upgrade:

- Did Source/JavaScriptCore/runtime/JSType.h change? The enum values must align with Bun's mirror in src/jsc/JSType.rs (src/jsc/JSType.zig is a non-compiled porting reference, not the live code).
- Did Source/JavaScriptCore/runtime/JSType.h change? The enum values must align with Bun's mirror in src/jsc/JSType.rs.
Comment thread
claude[bot] marked this conversation as resolved.
Resolved
- Were there any changes to the WebCore code generator? If there are C++ compilation errors, check for differences in the generated reference code in vendor/WebKit/Source/WebCore/bindings/scripts/test/JS/
- If the merge touched the fork's .github/workflows, the release tarball names must still match prebuiltSuffix() in scripts/build/deps/webkit.ts
2 changes: 1 addition & 1 deletion .claude/docs/landing-prs.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ Companion to the "Landing PRs: What Bun Reviewers Catch" section in CLAUDE.md. T
- **Audit the full diff for accidental ride-alongs.** Submodule pointer bumps, lockfile churn from rebases, regenerated snapshots, formatter churn on untouched code, stash leakage. After every merge/rebase with main, re-diff against main: conflict resolution can silently resurrect deleted code or drop your own headline fix while keeping its test (a "one-line test tweak" commit once touched 33 files and reverted the entire production fix). Every file in the diff must be explainable from the PR's stated purpose.
- **The PR description is the permanent squash-commit message — keep it true.** State the root cause and make the exact fixing line identifiable apart from refactoring ("Which line was the fix?"). Name the verifying tests and state they fail on the unfixed build. "Fixes #N" must match the issue's actual repro; a partial fix says so. Re-sync title/description whenever review reworks the change. Every hunk needs an articulable one-sentence justification — pre-empt it in the description or a code comment for anything a reviewer can't explain from context. On large mechanical diffs, leave self-review comments pointing at the load-bearing hunks. Never delete unrelated code, others' TODOs, or debug tooling in passing — deletions your change orphans are required (see "Delete dead code"), but each is intentional and named.
- **Treat every review suggestion — especially from bots — as an unverified hypothesis.** Reproduce or check it against actual API semantics before applying or dismissing. Apply real findings; decline wrong ones in-thread with checkable evidence (file:line, run transcripts) — evidence-backed rebuttals close threads, bare dismissals don't. Never blanket-apply (blindly-applied suggestions have reintroduced known ASAN failures), never resolve threads silently in bulk (a bulk-resolve once swallowed a genuine correctness bug). When a reviewer flags a pattern once, sweep and fix every instance — Jarred leaves one substantive comment then "ditto" on each clone; fixing only the commented line guarantees another round.
- **Green CI on every platform is a hard precondition.** Maintainers file changes-requested reviews consisting solely of "CI is failing". Confirm you changed the implementation that ships (a complete fix to a dormant .zig reference file got the one-line review "redo this PR in Rust"). Regenerate checked-in codegen outputs — again after every rebase. Every failure on your branch but not on main is yours to root-cause; "probably a flake" requires a link to the same failure on main. Check per-job results, not the aggregate icon, and confirm CI actually executed your tests — path filters silently skip them.
- **Green CI on every platform is a hard precondition.** Maintainers file changes-requested reviews consisting solely of "CI is failing". Regenerate checked-in codegen outputs — again after every rebase. Every failure on your branch but not on main is yours to root-cause; "probably a flake" requires a link to the same failure on main. Check per-job results, not the aggregate icon, and confirm CI actually executed your tests — path filters silently skip them.
- **One concern per PR, scoped to the narrowest change that fixes it.** Fixing every instance of the same bug class is ONE concern (see "Fix the whole class"); drive-by refactors, style cleanups of adjacent code, and vendored upgrades are not. If one part triggers design debate mid-review, carve it out so the uncontroversial part merges. Diff size itself is grounds for changes-requested.
- **Pre-existing bugs surfaced by review: acknowledge, scope, track.** Never silently ignore, never silently widen your diff. State the mechanism in-thread, note your PR doesn't change it, file a tracking issue — "out of scope" without a tracker is not accepted. Exception: if it's the exact bug class your PR claims to eliminate, fix all instances in the same PR ("pre-existing, will follow up" for the same crash class gets "no, fix it.").
3 changes: 0 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ jobs:
fi

echo "✅ All formatters completed successfully"
- name: Ban Words
run: |
bun ./test/internal/ban-words.test.ts
- name: Verify checked-in codegen
# `*.generated.rs` are deterministic outputs of `*.string-map.ts`; the
# source `.ts` is the truth. This step regenerates and fails if the
Expand Down
6 changes: 2 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ test("(multi-file test) my feature", async () => {
- **TypeScript** (`src/js/`): Built-in JavaScript modules with special syntax (see JavaScript Modules section)
- **Generated code**: Many `.rs` and `.cpp` files are auto-generated from `.classes.ts` and other sources. The build regenerates them automatically when their inputs change.

Comment thread
claude[bot] marked this conversation as resolved.
Resolved
You will see `.zig` files alongside many `.rs` files (e.g. `fetch.zig` next to `fetch.rs`). These are the **original Zig implementation, kept only as a porting reference** — they are **not compiled** and **not shipped**. New code goes in `.rs`. When fixing a bug or porting a behavior, the `.zig` sibling is the source of truth for *intended semantics*: read it, then make the `.rs` match. Never add new behavior to a `.zig` file.

### Core Source Organization

The Rust side is a Cargo workspace of ~200 crates rooted at `Cargo.toml`. The key ones:
Expand Down Expand Up @@ -217,7 +215,7 @@ Several situational sections live in `.claude/docs/landing-prs.md` — read the
- **Fix the whole class in the same PR** (same-class sites are ONE concern, not scope creep). Grep for every sibling site sharing the pattern: parallel switch arms, sync/async twins, fast/slow paths, POSIX/Windows branches, SSL/non-SSL variants, copy-pasted blocks, every caller of a changed helper. Prefer moving the guard into the shared helper. If a site is intentionally excluded, say so in the PR.
- **Enumerate the input space deliberately.** Empty input, lone `.`, delimiter-only, inputs that become empty after processing, CRLF, IPv6 literals, integer max, every accepted spelling of an option. Treat "empty", "zero", and "unset" as three distinct states — gate on presence, not truthiness. Use real parsers, never prefix-stripping or regex heuristics over user-controlled input. When tightening validation, enumerate every legitimate input class and prove each still passes.
- **Every line you add must be demonstrably live.** Trace any flag you gate on through every context that sets it; trace new state to an actual consumer — parsed-but-never-read is a red flag; check for an unconditional overwrite after a new conditional; manually exercise the failure path of any checker whose purpose is to fail. Delete defensive code only when you can show the condition cannot occur; when a new assertion trips, fix the violating call sites.
Comment thread
claude[bot] marked this conversation as resolved.
Resolved
- **Verify semantics empirically, never from names or intuition.** Read the implementation of every helper, macro, and sentinel you rely on. For protocols, derive behavior from the spec and cite the upstream source line for every magic number. For ported code, the reference implementation (esbuild, the `.zig` siblings, Node) is the spec — diff control flow against it before "fixing" apparent bugs. For codecs, a self-round-trip proves nothing — validate against external known-answer vectors. Settle behavioral disputes by running the scenario.
- **Verify semantics empirically, never from names or intuition.** Read the implementation of every helper, macro, and sentinel you rely on. For protocols, derive behavior from the spec and cite the upstream source line for every magic number. For ported code, the reference implementation (esbuild, Node) is the spec — diff control flow against it before "fixing" apparent bugs. For codecs, a self-round-trip proves nothing — validate against external known-answer vectors. Settle behavioral disputes by running the scenario.
- **Validate representation at every boundary.** Numbers from JS or the wire: handle NaN, ±Infinity, negatives, out-of-range before casting; compare in the wide type, cast last; coercing conversions (`toInt32(global)`, never `asInt32` on user values); 64-bit types for byte lengths. Strings: never run byte-level checks without branching on encoding (JSC 8-bit strings are Latin1, not UTF-8); never compare byte counts to code-unit counts across a conversion; WTF-8 helpers for lone surrogates (real Windows paths contain them); test with non-ASCII beyond emoji.
- **Treat every refactor as guilty until proven behavior-preserving.** Diff the old path's complete behavior — out-parameter writes, error-path side effects, condition polarity, defaults, unconditional operations becoming conditional. Test status flags with bitwise-AND, not equality. Audit every hit of bulk find-and-replace. Before deleting odd-looking code, git-blame why it was written — it is usually load-bearing. If neighboring code does something differently than you're about to, find out why.
- **One source of truth; update every consumer atomically.** When a fact lives in two places (mirrored tables, encode/decode pairs), derive one from the other. New enum variant or struct field → audit every switch on the discriminant, every constructor/clone site, every hasher/serialization pair. Signature changes and renames → grep the whole repo including cfg-gated code and generated-binding inputs; stale call sites compile fine and silently miss the new behavior.
Expand All @@ -234,7 +232,7 @@ Several situational sections live in `.claude/docs/landing-prs.md` — read the
### Code style & idioms reviewers enforce

- **In runtime native code, grep for the in-tree helper before hand-writing anything.** File I/O, paths, strings, hashing, formatting, validation, spawning, timers — use the most specific existing helper: `bun.sys`/FD syscall wrappers (never raw std fs/posix), bun_core strings/fmt/Output, shared ref-count helpers, WTF:: containers over std:: in C++ bindings. Being the only file touching a raw primitive is a red flag. New helpers go on the type that owns the concept; extend a maintained in-tree equivalent rather than forking. Verify the helper's actual semantics fit.
- **Match the exact file's local conventions:** the namespace aliases the neighboring lines actually use, import placement, canonical parameter names, the same error-path sequence as sibling exit sites, formatter output. New code is Rust — don't import Zig-era conventions from `.zig` reference files. Name things truthfully: booleans state the invariant positively; no numeric-suffix variants (create2); magic numbers become named constants derived from what they describe (`".tgz".len`, not 4).
- **Match the exact file's local conventions:** the namespace aliases the neighboring lines actually use, import placement, canonical parameter names, the same error-path sequence as sibling exit sites, formatter output. Name things truthfully: booleans state the invariant positively; no numeric-suffix variants (create2); magic numbers become named constants derived from what they describe (`".tgz".len`, not 4).
- **Built-in JS modules (`src/js/`) are hot-path code in a hostile environment.** Tamper-resistance: $-prefixed intrinsics and primordial-safe calls (`$isJSArray`, `map.$get`, `$call`), globals captured at module load, `require` with the `node:` prefix, never route internal logic through user-overridable machinery (`Array.isArray`, never `instanceof Array`). Performance: heavy requires stay inside the branch that needs them (`x ??= require(...)`); named functions over inline closures; `Promise.$resolve`/withResolvers over `new Promise` executors; `createFIFO` over `Array#shift` queues; declare every instance field with a default in the class body; cache repeated property reads in locals; `process.platform === 'win32'` for platform checks (tree-shaken per platform).
- **Delete dead code in the same PR that makes it dead** (required scope — name the deletions in the description): superseded implementations, helpers whose last caller you rewired, fields nothing reads, parameters discarded in the body, guards a new validator makes redundant. Public items escape dead-code lints — grep for callers manually. Prefer deleting an unmaintained dead feature over renaming it.
- **Simplest honest shape; deduplicate within your own diff.** Early returns over else-after-return; `if let`/`?` over null-check-then-unwrap; exhaustive match over equality chains. Don't condense working explicit code into clever one-liners, and don't ride file-wide standardization on a focused bugfix. The second time a multi-line block appears in your diff, extract a named helper and use it at EVERY parallel site. If your fix makes two functions byte-identical, delete one.
Expand Down
Loading
Loading