Diffinery

homeflare/celldpublic

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