Skip to content

Releases: cloudflare/containers

v0.3.5

27 May 00:28
4a50257

Choose a tag to compare

Patch Changes

  • a3fe15b: Use the canonical AlarmInvocationInfo type from @cloudflare/workers-types for the alarm() 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.

  • 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#onError from any to unknown. Subclasses that override onError can still return any value. This should be a no-op for most users.

  • 45274ea: Preserve original errors as cause when 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

11 May 20:37
d731038

Choose a tag to compare

Patch Changes

  • 8442f40: Fix a race in Container where concurrent container.fetch calls 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 running but the underlying container has already exited.

    Migrate the root unit test suite from Jest to Vitest and add a test:unit script for running src/tests directly.

  • cf41295: Fix subclass sleepAfter overrides being ignored during the initial activity timeout setup. Previously, the base Container constructor called renewActivityTimeout() inside blockConcurrencyWhile() before subclass class-field initializers ran, so the first sleepAfterMs was always computed from the base default ('10m') regardless of whether the subclass declared sleepAfter = '2h'. A container could then be killed by the activity timeout before the subclass's longer window took effect on the next renewActivityTimeout call. 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

21 Apr 16:03
805ad73

Choose a tag to compare

Patch Changes

  • 7901d0b: Attach custom labels to your containers to help with observability and attribution. Set a labels property on your Container subclass, or pass labels in the startOptions argument to start() / 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 via docker inspect.

    class MyContainer extends Container {
      labels = { tenant: 'acme', env: 'prod' };
    }

v0.3.2

15 Apr 23:46
4f0e0d4

Choose a tag to compare

Patch Changes

  • e8895f1: Preserve response headers when proxying WebSocket upgrades through Container.fetch().

v0.3.1

15 Apr 23:33
fe201dd

Choose a tag to compare

Patch Changes

  • 0c06874: Remove debug console.log(props) statement from ContainerProxy initialization

v0.3.0

09 Apr 21:02
c6d8f60

Choose a tag to compare

Minor Changes

  • 9b32add: Opt in to interceptOutboundHttps when interceptHttps = true

v0.2.4

07 Apr 21:35
0d4f80b

Choose a tag to compare

Patch Changes

  • ad96a97: Fix containerFetch() throwing on proxied bodyless responses by skipping response reconstruction when Response.body is null.

v0.2.3

06 Apr 14:11
590f381

Choose a tag to compare

Patch Changes

  • 1e29d6f: Handle Blob WebSocket messages by converting to ArrayBuffer before forwarding between client and container

v0.2.2

31 Mar 16:22
210e5fb

Choose a tag to compare

Patch Changes

  • c88e29f: Activity tracking refreshes timeout if inflight request instead of depending on alarm polling

v0.2.1

30 Mar 21:13
82ea775

Choose a tag to compare

Patch Changes

  • 828e8c8: Start tracking activity by piping the response body to a transform stream and proxying the websocket