Diffinery

homeflare/celldpublic

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