Releases: cloudflare/containers
v0.3.5
Patch Changes
-
a3fe15b: Use the canonical
AlarmInvocationInfotype from@cloudflare/workers-typesfor thealarm()parameter instead of an inline type. This is a no-op for users (the shape is identical), but keeps the override aligned with the Durable Object base class signature. -
ca72a22: Refreshed the
examples/projects:- All examples now use the latest TypeScript, Vitest, and Wrangler, and target a current Workers
compatibility_date. - Worker types are generated by
wrangler types, matching current Cloudflare guidance. - The
examples/timeout/snippet is now a fully runnable example. - Integration tests now run on arm64 hosts (e.g. Apple Silicon) and reliably clean up after themselves.
No changes to the published library API.
- All examples now use the latest TypeScript, Vitest, and Wrangler, and target a current Workers
-
fc7e7f4: Add return types to exported functions and public methods to satisfy ESLint and improve type checking.
-
eabe7ac: Clarify the license for this library matches that of
@cloudflare/workers-sdk, which is dual licensed under either MIT OR Apache-2.0. -
df8699a: Tighten the return type of
Container#onErrorfromanytounknown. Subclasses that overrideonErrorcan still return any value. This should be a no-op for most users. -
45274ea: Preserve original errors as
causewhen wrapping abort/timeout errors during container startup, making it easier to debug the underlying failure. -
19c1709: Reset container state after failed startup or terminal monitor errors, avoid stale monitor callbacks updating newer instances, and apply configured constructor startup options.
v0.3.4
Patch Changes
-
8442f40: Fix a race in
Containerwhere concurrentcontainer.fetchcalls to a cold container could throw"start() cannot be called on a container that is already running.". -
cf01432: Ensure pending stop events are processed when the persisted container lifecycle state is still
runningbut the underlying container has already exited.Migrate the root unit test suite from Jest to Vitest and add a
test:unitscript for runningsrc/testsdirectly. -
cf41295: Fix subclass
sleepAfteroverrides being ignored during the initial activity timeout setup. Previously, the baseContainerconstructor calledrenewActivityTimeout()insideblockConcurrencyWhile()before subclass class-field initializers ran, so the firstsleepAfterMswas always computed from the base default ('10m') regardless of whether the subclass declaredsleepAfter = '2h'. A container could then be killed by the activity timeout before the subclass's longer window took effect on the nextrenewActivityTimeoutcall. Declarations like:class BigContainer extends Container { sleepAfter = '2h'; }
are now honored from the very first alarm check.
-
07fedbb: Preserve Cloudchamber startup rate-limit errors in the Containers helper and return HTTP 429 from
containerFetch()when startup is rate limited.
v0.3.3
Patch Changes
-
7901d0b: Attach custom labels to your containers to help with observability and attribution. Set a
labelsproperty on yourContainersubclass, or passlabelsin thestartOptionsargument tostart()/startAndWaitForPorts(), and tag containers by tenant, environment, feature flag, canary cohort, or any other dimension you want to track. In local development, labels are visible on the underlying Docker container viadocker inspect.class MyContainer extends Container { labels = { tenant: 'acme', env: 'prod' }; }