Diffinery

homeflare/celldpublic

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