Bun.serve: rename `h3`/`h1` options to `http3`/`http1`
Merged
JA
6mo ago+130+130+012345678901234567890123456789-83-83-01234567890123456789
What
Renames the Bun.serve() ServerConfig HTTP/3 options from the abbreviated h3 / h1 to the spelled-out http3 / http1.
// before
Bun.serve({ tls, h3: true, h1: false, fetch })
// after
Bun.serve({ tls, http3: true, http1: false, fetch })
These options have not shipped in a release yet, so this is a clean rename with no backwards-compat aliases.
Changes
src/runtime/server/ServerConfig.zig/server.zig: rename theServerConfigstruct fields and the JS option lookups (arg.get(global, "http3"), etc.); update the validation error messages and the unix-socket warning.packages/bun-types/serve.d.ts: rename the type declarations, drop the incorrect "(and HTTP/2)" from thehttp1JSDoc (Bun.serve does not support HTTP/2), and mark both options@experimental.docs/runtime/http/server.mdx: add an "HTTP/3 (QUIC)" section documentinghttp3/http1, Alt-Svc, the unix-socket limitation, and the experimental status.- Tests: update
Bun.serve({ http3, http1 })call sites, test names, and the validation error-message assertion across the HTTP/3 suites (serve-http3.test.ts,serve-protocols.test.ts,body-stream.test.ts,fetch-http3-client.test.ts,fetch-http3-adversarial.test.ts,direct-readable-stream.test.tsx,fetch-h3.ts,packages/h3blast/).
Notes
- The internal
uws.AnyRequestunion variants (.h1/.h3) are left as-is — those tag a transport, not a config option. - The
fetch()protocoloption ("http1.1" | "h1" | "http2" | "h2" | "http3" | "h3") is unchanged; it already accepts both spellings. zig:checkand thebun-typestsctest pass locally. The full HTTP/3 test suite will run in CI.