docs: add Bun 1.3 to 1.4 upgrade guide - #36463
Conversation
|
Warning Review limit reached
Next review available in: 16 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 selected for processing (5)
WalkthroughChangesBun 1.4 documentation
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
Found 1 issue this PR may fix:
🤖 Generated with Claude Code |
|
Updated 3:41 PM PT - Aug 12th, 2026
✅ @robobun, your commit a5a909642eff1885d915e4a12252a1591fc14ef5 passed in 🧪 To try this PR locally: bunx bun-pr 36463That installs a local version of the PR into your bun-36463 --bun |
There was a problem hiding this comment.
LGTM — all five prior accuracy notes are addressed in the current diff and this run's bug hunt found nothing new.
What was reviewed:
- Confirmed the five earlier fixes landed: bunfig TOML error format/redaction, lockfile v0→v1 wording, CSS-modules link target, client-only
WebSocket#close()scoping, and the JSX cross-reference. docs.jsonnav entry and internal links (/pm/lifecycle,/runtime/toml,/runtime/jsx,/runtime/cron,/runtime/shell,/bundler/css#css-modules,/guides/util/upgrade) resolve.installation.mdx/executables.mdxbaseline-build removals are consistent with each other and with the new guide's single-x64-build section.
Extended reasoning...
Overview
Docs-only PR: adds docs/upgrade-to-1.4.mdx (~310 lines) as a 1.3→1.4 migration reference, wires it into the "Get Started" nav group in docs.json, links it from guides/util/upgrade.mdx, and updates installation.mdx and bundler/executables.mdx to drop the separate AVX2/baseline x64 build language so those pages agree with the new guide. No source, test, or build files are touched.
Security risks
None. This is prose and MDX markup with no executable code, no secrets, and no changes to auth/crypto/permissions paths.
Level of scrutiny
Medium — the risk here is factual accuracy across ~30 behavior-change claims, not code correctness. That risk was actively exercised: two prior review rounds surfaced five accuracy issues (TOML error format for bunfig, lockfile v0 handling, CSS-modules link target, server-vs-client WebSocket close() validation, and a JSX cross-reference that overpromised), and all five were fixed in 645a3cb and 31351fe. This run's bug-hunting pass found nothing further. Each headline claim in the page maps to a referenced PR in the description, and the neighboring pages (installation.mdx, executables.mdx) were updated in the same PR so they don't contradict the new guide.
Other factors
- All prior inline threads are resolved; the current diff reflects every requested wording change verbatim.
- MDX tag balance / code-fence parity looks correct in the preloaded content;
docs.jsonremains valid JSON with the single added array entry. - The page sits alongside
/typescript-6(the existing version-change page), so nav placement follows an established pattern. - Docs-only, so any residual wording nit is trivially correctable post-merge with no user-facing breakage.
|
@robobun Get this up to date since things might have changed in the past two weeks |
Covers fetch duplicate-header combining, setKeepAlive ms unit, MySQL DATETIME decoding, WebSocket validation, and the remaining Bun API tightenings. Links to the tracking issue for the exhaustive list.
- bunfig.toml error output is redacted; show that format and note the non-redacted Bun.TOML.parse form separately - v0 lockfile is floored to v1 on rewrite, not preserved verbatim - CSS modules link should target /bundler/css#css-modules
- Move page to docs/upgrade-to-1.4.mdx (top-level, matching /typescript-6) - Update installation.mdx and bundler/executables.mdx: there is one x64 build per platform targeting SSE4.2; -baseline names are aliases - Add TOML value-type changes (inf/nan, safe-integer range, SyntaxError)
NODE_ENV=development does not flip react-jsx to the dev runtime for bun run / bun test, so recommend the tsconfig setting as the portable fix and defer the NODE_ENV interaction to the JSX reference page.
ServerWebSocket.close() does not validate the code or reason length; the InvalidAccessError / SyntaxError behavior is client-only. The JSX page does not document NODE_ENV interaction, so point at what it does cover.
Adds the behavior changes that landed since the guide was written: useDefineForClassFields, .env handling when invoked as node, Bun.serve HTML sourcemaps and stop() semantics, .xml loader, process.env coercion and warning listeners, dns.lookup system resolver, Temporal, URL/assert Node parity, MariaDB JSON, PGSSLMODE, bun:sqlite close(), HTMLRewriter streaming, optional-peer lockfile cleanup, and assorted validation tightenings. Corrects the runtime .module.css note.
31351fe to
c371e3a
Compare
There was a problem hiding this comment.
I reviewed the latest revision and found no issues — commit a5a9096 addresses the last open nit (assert.strictEqual dropped from the deep-equality bullet), and all earlier feedback has been incorporated. Given this is the release-facing 1.4 upgrade guide with factual claims spanning the package manager, bundler, runtime, SQL drivers, and Node compat, a maintainer read-through before publishing is still worthwhile.
What was reviewed
- Confirmed the six prior nits (TOML error format, lockfile v0→v1, CSS Modules link, WebSocket
close()scope, JSX cross-reference,assert.strictEqual) are all fixed in the current diff. - Checked
docs.jsonnav entry, internal link targets, and MDX tag balance in the new page. - Verified the
installation.mdx/executables.mdxCPU-requirement edits are internally consistent with the single-x64-build section.
Extended reasoning...
Overview
This PR adds docs/upgrade-to-1.4.mdx (482 lines), a comprehensive migration guide covering ~40 behavior changes between Bun 1.3 and 1.4, and updates docs/installation.mdx, docs/bundler/executables.mdx, docs/docs.json, and docs/guides/util/upgrade.mdx to align with the single-x64-build change and link the new page. It is docs-only; no runtime code is touched.
Security risks
None. Pure documentation; no code paths, no build configuration, no dependencies.
Level of scrutiny
Higher than a typical docs change. This is the canonical upgrade guide for a major release — it will be linked from the release post and support threads, and each of its ~40 sections makes a specific technical claim about runtime behavior. Earlier review rounds surfaced six factual inaccuracies (all now fixed), which suggests the density of claims warrants a human editorial pass rather than auto-approval. The refresh commit (c371e3a) also added ~15 new sections covering changes that landed after the original draft; a maintainer requested that refresh but has not yet reviewed the result.
Other factors
- All prior automated feedback has been addressed across five commits; the last inline comment (
assert.strictEqual) is fixed in a5a9096, and the current diff reflects that. - CI passed on the head commit.
- The nav placement (Get Started group, alongside
/typescript-6) and the editorial scope of what to include vs. defer to #28792 are product decisions a maintainer should sign off on. - No CODEOWNERS file governs
docs/, but release documentation is high-visibility content.
Adds
docs/upgrade-to-1.4.mdx, a migration reference for the user-visible behavior changes between Bun 1.3.14 and Bun 1.4, linked from the "Get Started" navigation group and from the existingbun upgradeguide. Also updatesdocs/installation.mdxanddocs/bundler/executables.mdxso the CPU-requirement and cross-compile-target docs agree with the single-x64-build change the guide describes.The page is the "what do I change" companion to the tracking list at #28792: each section states what changed, who is affected, and the one-line fix, with code examples for the items that need one.
Rebased on current main and re-audited against both #28792 and
git logfor the commits that landed since the guide was first written; the second table below is what that added.Covered with dedicated sections (original audit)
bun.lockwritten aslockfileVersion: 2for new lockfilestrustedDependenciesmatches resolved name, not alias; hash-only / non-canonical entries no longer trustedinf/nanare numbers, integers outside safe range throw, errors areSyntaxError"jsx": "react-jsx"emits the production JSX runtimeBun.cronschedules interpreted in local time;{ tz }option addedambiguous redirect{}(matchesbun build)process.versions.nodeis26.3.0;writeHeaderremoved,stream.read()one-chunk,dgramsync throwsfetch/Bun.servecombine duplicate wire headers;clone()throws on disturbed body;Response.redirectparses URL; truncated compressed body rejects; option-conversion errors rejectBun.Socket#setKeepAlivedelay is millisecondsDATETIME/TIMESTAMPdecode as UTC-baselinenames are aliasesAdded in the refresh (landed on main after the first revision)
--frozen-lockfileimplication); nestednpm:alias no longer redirected to a root alias;bun update <name>re-resolves every occurrenceuseDefineForClassFields: falseis honored.envfiles not auto-loaded when Bun is invoked asnodeBun.serveHTML routes: no sourcemaps in production,[serve.static] sourcemapoverrideserver.stop()closes idle connections and waits for all connections;stop(true)afterstop()force-closes.xmldefault loaderprocess.envcoerces to string /definePropertyvalidation; default"warning"listener registered at startup;process.titledefaultnode:dns.lookup()uses the system resolver on Linuxnew URL()error message /ERR_INVALID_URL;assert.deepStrictEqualprototype + own-property parity; callback throws surface asuncaughtExceptionnode:httpwriteHead()+end(chunk)sends chunked,maxConnectionsenforced;node:cluster/ IPCinternalMessage; worker_threads exit semantics; recursivefs.watcherrorsTemporalenabled by default (BUN_JSC_useTemporal=0to disable)jsoncolumns parsedPGSSLMODEbun:sqliteclose()finalizesquery()statements; LRU cacheHTMLRewriterstreams; string input with async handler throws; error routingWebSocketcloseevent is a queued task (CLOSINGstate)Array.prototype.join()throwsRangeError(JSC update)Bun.JSONC.parseSyntaxError; S3 XML entity decoding /InvalidResponse;Transfer-Encoding400; per-serverNamerequestCert; fetch TLS session cache flag;udpSocket/password/RedisClient#expire/openInEditorvalidation;browserfield honored for polyfillsAlso corrected in the refresh: the runtime note about
.module.css(it follows the same{}rule as plain.cssunderbun run; onlybun buildproduces the class map).installation.mdx and bundler/executables.mdx
These pages still described a separate AVX2 build with a "baseline is slower" fallback, contradicting #34782 and the new guide they sit next to in the nav. Updated to one x64 download / target per platform, a one-row CPU table (SSE4.2 / Nehalem), and notes that the
-baseline/-modernnames are aliases.Why
There is no existing page that collects the 1.4 behavior changes in one place. A single reference page at a stable URL is what support threads and the release post can link to. The page lives at the docs root alongside
/typescript-6(the existing version-change page) and is surfaced in the "Get Started" navigation group alongside/installation.Verification
version_to_write()inbun.lock.rs,normalizeSSLModeinsql/shared.ts, thewebkit-upgrade-3722912fpinning test,docs/runtime/networking/dns.mdxfor thebackendoption).docs/docs.jsonvalidates;prettier --checkpasses on all changed files; MDX tag balance and fence parity checked.Docs-only change; no native code touched.
Related: #28792 (does not close it; that issue still has open "under consideration" items, and several of the refresh items above are not yet listed there).
no test proof · iteration 0 · docs-only change; test-proof not applicable