Skip to main content

Module containers

Module containers 

Source
Expand description

#3477 (slice C1): the Durable Object classes of a Worker’s Container instances.

One file per Worker, containers.ts, re-exported from index.ts because Cloudflare resolves a class_name against the exports of the Worker’s main. Each class is built by the runtime’s containerClass from the declaration’s literals, so the generated file holds data and no logic, as the agent classes’ serialiseAgentClass wrapper does.

Functions§

container_class_names
The classes index.ts re-exports, one per container binding, in binding order. Empty when the Worker has no container.
emit_containers_ts
containers.ts, or None when the Worker has no container.