Diffinery

homeflare/celldpublic

celld/docs/cloudflare-compat.md
246 lines · 11.3 KBRaw History
1# Cloudflare compatibility
2
3This page lists only the differences from the linked Cloudflare APIs. An entry
4without a note matches Cloudflare.
5
6- **Yes**: implemented, except for the listed differences.
7- **Partial**: a substantial part is unavailable.
8- **Experimental**: can change without notice.
9- **No**: not implemented.
10
11celld rejects an unsupported configuration or API at deployment or first use.
12An unsupported feature that does not cause an error is a defect.
13
14## Services
15
16| service | status |
17| --- | --- |
18| [Workers](services/workers.md) | **Yes** |
19| [Durable Objects](services/durable-objects.md) | **Yes** |
20| [Durable Object Facets](services/durable-object-facets.md) | **Yes** |
21| [Containers](services/containers.md) | **Experimental** |
22| [Static assets](services/static-assets.md) | **Yes** |
23| [Cron Triggers](services/cron-triggers.md) | **Yes** |
24| [Dynamic Workers](services/dynamic-workers.md) | **Yes** |
25| [KV](services/kv.md) | **Yes** |
26| [Queues](services/queues.md) | **Yes** |
27| [D1](services/d1.md) | **Yes** |
28| [Workflows](services/workflows.md) | **Yes** |
29| [R2](services/r2.md) | **Yes** |
30| Version metadata (`version_metadata` binding) | **Yes** — `{ id, tag, timestamp }`; a platform can set all three in the config (Homeflare patch) |
31| Rate Limiting (`ratelimits`) | **Yes** — `limit({ key })`, counted per node in fixed windows of the period (Homeflare patch) |
32| Email Sending (`send_email` binding) | **Partial** — the Email Sending message object (no raw `EmailMessage`); needs an email service at `CELLD_EMAIL_URL`, such as Homeflare's relay to Cloudflare Email Sending (Homeflare patch) |
33| Media Transformations (`media` binding) | **Partial** — needs a media service at `CELLD_MEDIA_URL`, such as Homeflare's `homeflare-media` (Homeflare patch) |
34| Workers AI | **No** |
35| Vectorize | **No** |
36| Hyperdrive | **No** |
37| Browser Rendering | **No** |
38| Email Workers | **No** |
39| [Python Workers](services/workers.md#python-workers) | **Partial** — `fetch` handlers on the Pyodide 0.28 runtime line |
40
41## Runtime APIs
42
43| API | status |
44| --- | --- |
45| [Fetch, Request, Response, and Headers](#fetch-request-response-and-headers) | **Yes** |
46| [Bindings](#bindings) | **Yes** |
47| [Context](#context) | **Yes** |
48| [Handlers](#handlers) | **Yes** |
49| [RPC](#rpc) | **Yes** |
50| [Streams](#streams) | **Yes** |
51| Encoding | **Yes** |
52| [WebSockets](#websockets) | **Yes** |
53| [Web Crypto](#web-crypto) | **Yes** |
54| [Web standards](#web-standards) | **Yes** |
55| WebAssembly | **Yes** |
56| [Performance and timers](#performance-and-timers) | **Yes** |
57| Console | **Yes** |
58| [Node.js compatibility](#nodejs-compatibility) | **Partial** |
59| [Cache](#cache) | **Partial** |
60| HTMLRewriter | **Yes** |
61| [TCP sockets](#tcp-sockets) | **Yes** |
62| EventSource | **Yes** |
63| MessageChannel | **Yes** |
64| BroadcastChannel | **No** |
65
66### [Fetch, Request, Response, and Headers](https://developers.cloudflare.com/workers/runtime-apis/fetch/)
67
68- The `cache` request option is unavailable.
69- An inbound `Request` has a `cf` object without Cloudflare edge fields. celld
70 cannot prove the geolocation, colo, or TLS metadata.
71- celld removes `Content-Length` from a Worker response, except for a `HEAD`
72 response.
73- A remote Durable Object call cannot retry after request-body transmission
74 starts because celld keeps no replay copy.
75- A remote Durable Object call waits for a rejected owner generation to change
76 for at most `CELLD_OPERATION_DEADLINE_MS`.
77
78### [Bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/)
79
80Only the binding types in the [services table](#services) are available.
81
82### [Context](https://developers.cloudflare.com/workers/runtime-apis/context/)
83
84- `passThroughOnException()` has no effect because celld has no CDN fallback.
85- `ctx.facets` is available only inside a Durable Object.
86
87### [Handlers](https://developers.cloudflare.com/workers/runtime-apis/handlers/)
88
89The `tail` and `email` handlers are unavailable.
90
91### [RPC](https://developers.cloudflare.com/workers/runtime-apis/rpc/)
92
93- An RPC stub cannot cross an isolate boundary.
94- An `AbortSignal` in a Durable Object RPC call does not cross a node boundary.
95- A remote RPC retries only when the failed peer attempt did not start the
96 method. Use a stable operation ID for an application retry.
97
98### [Streams](https://developers.cloudflare.com/workers/runtime-apis/streams/)
99
100- celld expires an unclaimed and inactive HTTP stream after 60 seconds. A
101 successful stream operation starts a new 60-second period.
102- An expired or unknown stream reports an error instead of EOF.
103
104### [WebSockets](https://developers.cloudflare.com/workers/runtime-apis/websockets/)
105
106- An outbound Worker socket closes when its event and `waitUntil` work end. A
107 socket returned in the response stays open.
108- Each isolate-polled input queue has a 1 MiB budget for non-terminal frames. A
109 message larger than 1 MiB uses the complete budget.
110- If the isolate stops polling, celld discards unread frames during cleanup. A
111 later pull reports an abnormal close.
112- A WebSocket transport cannot move to a new cell owner. A client must reconnect
113 with the same application operation ID.
114- A tunneled connection forwards the owner's Close without an additional Close.
115 If the owner connection fails between frames before a Close, the ingress sends
116 code 1012. If a frame is incomplete, the ingress closes the transport instead.
117- `acceptWebSocket()` throws above 90 percent of the V8 heap limit.
118- A response with a WebSocket to a request without `Upgrade: websocket` fails,
119 as in workerd. A Durable Object's `stub.fetch()` call then rejects, and an
120 HTTP client receives status 500. The server end of the socket receives a close
121 event with code 1006.
122- A Durable Object's `stub.fetch()` call rejects when the handler fails, on the
123 owner node and on any other node.
124
125### [Web Crypto](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
126
127- HMAC accepts MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512.
128- ECDSA supports only the P-256 curve with SHA-256.
129- AES-GCM accepts authentication tags from 96 through 128 bits in 8-bit steps.
130- RSA-OAEP accepts SHA-1, SHA-256, SHA-384, and SHA-512. A nonempty label must
131 contain valid UTF-8.
132- A secret key cannot use `jwk` with `exportKey()` or `wrapKey()`.
133- Ed25519 signs and verifies, and `NODE-ED25519` names the same algorithm. A
134 signature from one spelling verifies under the other.
135- X25519 derives bits and keys. A peer key of a low order gives a shared secret
136 of all zero bytes, so `deriveBits()` rejects that key instead.
137- An Ed25519 or X25519 public key uses its 32-byte point for the `raw` format,
138 so `importKey()` and `exportKey()` both carry the point alone.
139
140### [Web standards](https://developers.cloudflare.com/workers/runtime-apis/web-standards/)
141
142### [Performance and timers](https://developers.cloudflare.com/workers/runtime-apis/performance/)
143
144`performance.timeOrigin` is `0`, and `performance.now()` matches `Date.now()`.
145Both clocks advance at an I/O boundary and stay fixed during JavaScript
146execution.
147
148### [Node.js compatibility](https://developers.cloudflare.com/workers/runtime-apis/nodejs/)
149
150- celld implements `node:assert`, `node:async_hooks`, `node:buffer`,
151 `node:diagnostics_channel`, `node:events`, `node:fs`, `node:os`, `node:path`,
152 `node:stream`, `node:timers/promises`, and `node:util`.
153- `node:diagnostics_channel` does not export messages to a tail Worker.
154- `node:crypto` does not implement Diffie-Hellman, streaming signatures,
155 ciphers, RSA-PSS, or DSA signatures and key generation.
156- `KeyObject.toCryptoKey()` applies the requested algorithm, extractability,
157 and usages to an asymmetric key.
158- `node:zlib` implements only the synchronous gzip and deflate functions.
159- `node:net` provides `isIP`, `isIPv4` and `isIPv6` (Homeflare patch).
160- `node:dns` and `node:dns/promises` provide `lookup()`, which resolves
161 through the node's own resolver. The `resolve*()` functions are not
162 implemented (Homeflare patch).
163- `node:url` provides `URL`, `URLSearchParams`, `domainToASCII`,
164 `domainToUnicode`, `fileURLToPath`, `pathToFileURL`, `urlToHttpOptions` and
165 `format`. The legacy `parse`, `resolve` and `resolveObject` are not
166 implemented (Homeflare patch).
167- `node:process` is the global `process` object (Homeflare patch).
168- `node:fs` provides `access`, `mkdir`, `realpath`, `stat`, `lstat`, and
169 `readFile`. It exposes an empty, request-local `/tmp` and a read-only
170 `/bundle` that contains the Worker modules.
171- The global `process` matches workerd for each field that it defines, such
172 as `process.execPath`, `process.argv`, and `process.title`. Other fields,
173 such as `process.kill` and `process.features`, are undefined.
174- The celld bundler supports a synchronous CommonJS `require()` of a Node.js
175 built-in module. A raw ESM Worker has no global `require()`.
176- A Node.js built-in module object is writable, so a dependency such as
177 `graceful-fs` can patch it at load. The patch stays in its isolate.
178- An import of another Node.js module succeeds, but its first call throws an
179 error.
180
181### [Cache](https://developers.cloudflare.com/workers/runtime-apis/cache/)
182
183celld provides an always-miss cache because it has no shared edge cache.
184`put()` validates and consumes a response but stores nothing, `match()` returns
185`undefined`, and `delete()` returns `false`.
186
187### [TCP sockets](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/)
188
189- A socket cannot outlive its event. A Durable Object must reconnect during a
190 later event.
191- celld verifies a TLS server against its bundled Mozilla root store.
192- celld does not block the destination ports that Cloudflare blocks. The fleet
193 network controls the egress policy.
194
195### BroadcastChannel
196
197The class exists so that a bundle can load, but its constructor throws.
198
199## Compatibility flags
200
201celld honors these compatibility flags:
202
203- `delete_all_deletes_alarm`
204- `js_rpc`
205- `fetcher_no_get_put_delete`
206- `sqlite_vec`
207- `websocket_standard_binary_type`
208- The static-assets navigation flags
209
210celld accepts every other flag without effect.
211`Cloudflare.compatibilityFlags` reports only the honored flags.
212
213## Wrangler configuration
214
215`celld deploy` accepts `wrangler.jsonc` or `wrangler.json`, not
216`wrangler.toml`.
217
218The `name` value must contain 1 to 63 lowercase ASCII letters, digits, or
219internal hyphens. It cannot start or end with a hyphen.
220
221The accepted top-level keys:
222
223- `$schema`, `name`, `main`, and `no_bundle`
224- `compatibility_date` and `compatibility_flags`
225- `durable_objects` and `migrations`
226- `assets`, `services`, `triggers`, and `vars`
227- `d1_databases`, `kv_namespaces`, `queues`, `workflows`, and
228 `r2_buckets`
229- `worker_loaders` and `containers`
230- `define` and `rules`
231
232Any other top-level key, including `routes`, stops the deployment.
233
234`define` and `rules` go to the esbuild run. Each `define` value is a
235JavaScript expression, as in Wrangler. A rule `type` must be `Text`, `Data`,
236or `CompiledWasm`, and each glob must have the form `**/*.ext` or `*.ext`,
237because esbuild selects a loader by extension. Two rules that give one
238extension different types stop the deployment. celld already applies
239`CompiledWasm` to `**/*.wasm`, so only that type is valid for `.wasm`.
240`no_bundle` skips esbuild, so `no_bundle` with `define` or `rules` stops the
241deployment.
242
243An asset-only project can omit `main`. `celld deploy` refuses an unsafe asset
244path, and `.assetsignore` requires Wrangler.
245
246See [Limitations](limitations.md) for the operational limits.