-
Notifications
You must be signed in to change notification settings - Fork 0
bundle window
Transparent request bundling for pages that do not run double-meh: eligible GET fetch events collect in a micro-window, ride one PUT to a double-meh-bundler endpoint, and fan back out — wire format v1.
import {createBundleWindow} from 'double-meh-sw/bundle-window.js';
const window = createBundleWindow({url: '/bundle', waitTime: 10});
const response = await window.intake(request);Through the assembly it activates with bundler: {url, match}; pages that announced double-meh over io:hello are never bundled (client-wins).
| Option | Default | Meaning |
|---|---|---|
url |
— | The bundler endpoint. Required. |
waitTime |
10 |
The micro-window, ms. |
maxSize |
20 |
A window reaching this flushes immediately. |
minSize |
2 |
Below this the flush degrades to direct fetches. |
onPart |
— | Observes every non-synthetic part — the assembly writes them through to the cache tier. |
Every failure path resolves waiters with direct fetches, never synthetic errors: a lone request below minSize, a failed or malformed bundler response (the whole window), an omitted part (that waiter alone). A transparent adornment must never hand a page an error it didn't earn — error semantics belong to page libraries, and pages with one aren't bundled here in the first place.
See also: The assembly, Cache tier.
Start
Modules
Project