runtime-cloudflare

Cloudflare Workers. D1, KV, rate limiting, R2 and wait_until mapped to ports.

With cargo

cargo add cratefield-runtime-cloudflare

What it is

runtime-cloudflare.

Cloudflare Workers runtime for the Cratefield harness: maps Workers bindings to the harness ports and serves a Harness on #[event(fetch)] / #[event(scheduled)].

From the crate’s own README.

Read more

History

Changelog.

From the crate’s CHANGELOG.md in the harness, as of 0c5560b. 6 versions recorded, newest first. Every published version is on crates.io.

  1. 0.5.0

    crates.ioReleaseDiff

    Other

    • breaking supported module logging on Workers and native (#846) (#883)
  2. 0.4.3

    crates.ioReleaseDiff

    Other

    • streaming completions (text, reasoning, tool-call and usage deltas) with idle/total timeouts and cancel-on-drop (#869)
4 earlier versions 0.3.0 to 0.4.2
  1. 0.4.2

    crates.ioReleaseDiff

    Fixed

    • close eight concurrency races across the pool cache, auth caches, realtime rooms, waitlist confirms and tracker adapters (#823)
  2. 0.4.1

    crates.ioReleaseDiff

    Other

    • runtime-cloudflare HttpClient: cap the response body while streaming, and don't follow redirects (#809)
    • Actor port: per-key serialized state with transactional storage and alarms, on Durable Objects (#583) (#743)
    • Blob port: streamed reads and writes, multipart uploads and listing for objects above MAX_BLOB_BYTES (#586) (#741)

    Security

    • The response body is read as a stream under the HttpPolicy cap, so an upstream that never declares a content-length is refused at the chunk that crosses the cap rather than buffered first. Reading stops there and drops the platform's handle on the fetch, so an endless body costs one chunk past the cap instead of the isolate's memory. The platform offers no stream at all for a null-body status (204/205/304, or the reply to a HEAD), which is read as an empty body rather than a failed send, so the cap does not cost those replies the buffered read used to answer (#714).
    • Redirects are answered, not taken: the transport request asks for redirect: "manual", so no upstream can move the exchange to another host or down to http after the destination was vetted (#714).

    Added

    • StatusOnly request marker honoured: a request carrying it is answered from the status line alone, its body never read, and its body-describing headers (Content-Length, Content-Encoding, Transfer-Encoding) dropped, so a liveness probe of a large resource does not fail on a length it never asked for (#714).
  3. 0.4.0

    crates.ioReleaseDiff

    Changed

    • Breaking: requires cratefield-core 0.8 (was 0.7), and so a minor rather than a patch bump: a venture still on core 0.7 does not pick this release up through a caret requirement and end up with two copies of core (#712).

    Other

    • updated the following local packages: cratefield-core
  4. 0.3.0

    crates.ioRelease

    Added

    • core breaking name problem type URIs under the venture's own base (#557) (#581)

    Other

    • Blob port: presigned GET and PUT URLs for R2 through the S3 API (SigV4) (#622) (#663)
    • Stream request and response bodies for routes a module declares (#585) (#635)
    • CustomHostnames port in core, with a Cloudflare for SaaS adapter (#590) (#630)
    • VectorIndex and Embedder ports, with Cloudflare Vectorize and exact in-process adapters (#561) (#568)
    • Production readiness fails when a module declares RateLimiter and none is mounted; a missing Workers limiter binding fails closed (#562) (#569)

One of 76 crates in the harness, all of them MIT and all of them in one repository.