-
Notifications
You must be signed in to change notification settings - Fork 0
Home
double-meh-bundler is the server side of the double-meh bundle protocol: it accepts one bundled request (many GETs riding a single PUT), fans out to your services on the backend network, and returns every response in a single compressed envelope — or streamed part-by-part when the client asks for the +jsonl framing. The core is a web-standard fetch handler — it runs on Bun.serve, Deno.serve, service workers, and web-handler frameworks; callback servers are one dependency-free adapter away.
import {createBundler} from 'double-meh-bundler';
const bundler = createBundler({
isUrlAcceptable: url => url.startsWith('/api/'), // required — the security boundary
resolveUrl: url => new URL(url, 'http://api.internal:8080').href
});
Bun.serve({fetch: bundler});🔍 Search this wiki — ranked, deep-linked search via wiki-search; install the bookmarklet to search in place. Fallback: GitHub wiki search.
- Compression locality — many small JSON responses share one compression window: measured ~40–48% fewer bytes on bursts of small responses, ~16–22% on medium ones.
- Cross-origin aggregation — one bundler origin fans out to any backend service; HTTP/2 multiplexing is per-origin and structurally cannot.
- HTTP/1.1 paths — origins without an h2 edge also recover the classic connection-cap win.
The client keeps per-request semantics intact through bundling: per-URL caching, ETag/304 revalidation, retry, and per-request errors — see double-meh's bundle transport.
API
-
Bundler core —
createBundler(options), the security surface, part semantics, hooks -
Node & Express adapter —
toNodeHandler(), built-in gzip -
Koa adapter —
toKoaMiddleware(), structural typing
Protocol
- Wire format — the v1 envelope, part rules, error mapping
Project
Start
API
Protocol
Project