Diffinery

homeflare/celldpublic

celld/docs/cloudflare-compat.md
336 lines · 14.4 KBRaw History
1# Cloudflare compatibility
2
3celld implements the Cloudflare Workers APIs that this page links to. The notes
4list only the celld gaps and differences.
5
6- **Yes** means that celld implements the complete applicable API.
7- **Partial** means that celld does not implement a listed input, operation, or
8 behavior.
9- **No** means that celld does not implement the API.
10
11celld must reject an unsupported configuration or API at deployment or first
12use. An unsupported feature that does not cause an error is a defect. This page
13identifies each known exception.
14
15## Services
16
17| service | status |
18| --- | --- |
19| [Workers](https://developers.cloudflare.com/workers/runtime-apis/) | **Partial** |
20| [Durable Objects](https://developers.cloudflare.com/durable-objects/) | **Partial** |
21| [Static assets](https://developers.cloudflare.com/workers/static-assets/) | **Yes** |
22| [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) | **Partial** |
23| [Worker Loader](https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/) | **Partial** |
24| [KV](https://developers.cloudflare.com/kv/api/) | **Partial** |
25| [Queues](https://developers.cloudflare.com/queues/configuration/javascript-apis/) | **Partial** |
26| [D1](https://developers.cloudflare.com/d1/worker-api/d1-database/) | **Partial** |
27| [Workflows](https://developers.cloudflare.com/workflows/build/workers-api/) | **Partial** |
28| [R2](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) | **Partial** |
29| [Workers AI](https://developers.cloudflare.com/workers-ai/) | **No** |
30| [Vectorize](https://developers.cloudflare.com/vectorize/) | **No** |
31| [Hyperdrive](https://developers.cloudflare.com/hyperdrive/) | **No** |
32| [Browser Rendering](https://developers.cloudflare.com/browser-rendering/) | **No** |
33| [Email Workers](https://developers.cloudflare.com/email-routing/email-workers/) | **No** |
34| [Python Workers](https://developers.cloudflare.com/workers/languages/python/) | **No** |
35
36### [Workers](https://developers.cloudflare.com/workers/runtime-apis/)
37
38**Partial**
39
40- The [runtime API table](#runtime-apis) lists the Worker runtime gaps.
41- celld does not manage a custom domain or terminate TLS. Terminate TLS in the
42 ingress proxy.
43- An experimental Workers AI HTTP adapter is available through
44 `CELLD_AI_URL`.
45
46### [Durable Objects](https://developers.cloudflare.com/durable-objects/)
47
48**Partial**
49
50- An RPC stub cannot cross an isolate boundary. See [RPC](#rpc).
51- An outbound WebSocket does not continue after the object moves to another
52 node.
53- celld refuses invalid UTF-8 from a SQLite `TEXT` value. Store arbitrary
54 bytes in a `BLOB`.
55- `SqlStorage.Cursor.toArray()` gives a celld-specific error when the isolate
56 is near its V8 heap limit.
57
58### [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/)
59
60**Partial**
61
62- celld rejects a descending range such as `SAT-SUN` or `NOV-FEB`.
63- celld rejects `*` inside a list such as `1,*`.
64- celld runs one handler for each occurrence across the complete fleet.
65- After fleet downtime, celld runs the most recent missed occurrence one time.
66- celld runs one handler at a time for each script. It retries a failed handler
67 until the next occurrence unless the handler calls `noRetry()`.
68- A service-binding target cannot run its own Cron Triggers.
69
70### [Worker Loader](https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/)
71
72**Partial**
73
74- Worker Loader is experimental and requires `CELLD_WORKER_LOADER=LOADER`.
75- A `globalOutbound` Fetcher is not available.
76- A loaded Worker cannot receive a capability stub in `env`.
77- Awaitable and pipelined properties are not available.
78
79### [KV](https://developers.cloudflare.com/kv/api/)
80
81**Partial**
82
83- celld has no edge cache. `cacheTtl` has no effect, and `cacheStatus` is
84 `null`.
85- A value above 1 MiB requires a fleet bucket.
86- celld stores a separate object when an application writes an identical large
87 value after a namespace changes owners. The separate object prevents an old
88 owner from deleting the current value.
89- celld reads a large-value row from an older release, but it does not reclaim
90 the legacy object after the row is removed.
91- A namespace has one writer. Use more namespaces to increase write capacity.
92- A namespace ID can use the Cloudflare hexadecimal form or another stable
93 string.
94
95### [Queues](https://developers.cloudflare.com/queues/configuration/javascript-apis/)
96
97**Partial**
98
99- A queue has one writer. Use more queues to increase write capacity.
100- A Queue owner accepts two concurrent producer operations. One operation can
101 run and one operation can wait, so an overload cannot delay Queue alarms.
102 The owner refuses an additional operation, and the producer can retry it.
103- A queue can have one consumer script. The consumer cannot also export a
104 `fetch()` handler.
105- celld retains a message for four days. You cannot configure this period.
106- Pull consumers and the Queues HTTP API are not available.
107- Dashboard controls, manual consumer attachment, R2 event notifications, and
108 Queue event subscriptions are not available.
109
110### [D1](https://developers.cloudflare.com/d1/worker-api/d1-database/)
111
112**Partial**
113
114- A binding result can contain at most 100,000 rows or 32 MiB.
115- celld refuses invalid UTF-8 from a SQLite `TEXT` value. Store arbitrary
116 bytes in a `BLOB`.
117
118### [Workflows](https://developers.cloudflare.com/workflows/build/workers-api/)
119
120**Partial**
121
122- `create()` replaces a terminal instance that has the same ID. Cloudflare
123 refuses each duplicate ID.
124- celld replays `run()` from the start, so code outside a step runs again.
125- A crash after a step side effect can run the step callback again.
126- `retention` and `locationHint` are not available.
127- Non-step work cannot remain pending for more than 60 seconds.
128- A step result, an event payload, and the workflow parameters each have a
129 1 MiB limit.
130- `pause()` stops a queued or waiting instance immediately. It lets an active
131 step finish, and the status changes from `waitingForPause` to `paused` before
132 the next step starts.
133- `resume()` starts a paused instance and cancels a pending pause. A paused
134 retry, sleep, or event wait keeps its remaining wait duration.
135- `restart()` starts a new generation from the beginning by default. Its
136 `from` option can select a step by its `name`, `count`, and `type`. The
137 `count` value defaults to `1`, and the `type` value defaults to `do`.
138- A selected restart reuses each result before the selected step and reruns
139 that step and each later step. The runtime rejects a selector that does not
140 match the execution history.
141- `delete()`, `deleteBatch()`, and rollback are not available.
142- A sensitive step result and a `ReadableStream` step result are not
143 available.
144
145### [R2](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/)
146
147**Partial**
148
149- An R2 binding uses the fleet bucket under `r2/<bucket_name>/`.
150- `ssecKey` is not available.
151- A conditional write cannot use a streamed body larger than 8 MiB.
152- `createMultipartUpload()` does not accept a checksum.
153- A multipart upload cannot resume on another node or after a restart.
154- celld cannot replace a multipart part that the object store already holds.
155- Out-of-order parts can use at most 256 MiB of memory, and completion cannot
156 change the order of stored parts.
157- `jurisdiction` is not available.
158
159## Runtime APIs
160
161| API | status |
162| --- | --- |
163| [Fetch, Request, Response, and Headers](https://developers.cloudflare.com/workers/runtime-apis/fetch/) | **Partial** |
164| [Bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/) | **Partial** |
165| [Context](https://developers.cloudflare.com/workers/runtime-apis/context/) | **Partial** |
166| [Handlers](https://developers.cloudflare.com/workers/runtime-apis/handlers/) | **Partial** |
167| [RPC](https://developers.cloudflare.com/workers/runtime-apis/rpc/) | **Partial** |
168| [Streams](https://developers.cloudflare.com/workers/runtime-apis/streams/) | **Partial** |
169| [Encoding](https://developers.cloudflare.com/workers/runtime-apis/encoding/) | **Yes** |
170| [WebSockets](https://developers.cloudflare.com/workers/runtime-apis/websockets/) | **Partial** |
171| [Web Crypto](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/) | **Partial** |
172| [Web standards](https://developers.cloudflare.com/workers/runtime-apis/web-standards/) | **Partial** |
173| [WebAssembly](https://developers.cloudflare.com/workers/runtime-apis/webassembly/) | **Yes** |
174| [Performance and timers](https://developers.cloudflare.com/workers/runtime-apis/performance/) | **Partial** |
175| [Console](https://developers.cloudflare.com/workers/runtime-apis/console/) | **Partial** |
176| [Node.js compatibility](https://developers.cloudflare.com/workers/runtime-apis/nodejs/) | **Partial** |
177| [Facets](https://developers.cloudflare.com/dynamic-workers/usage/durable-object-facets/) | **No** |
178| [Cache](https://developers.cloudflare.com/workers/runtime-apis/cache/) | **No** |
179| [HTMLRewriter](https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/) | **No** |
180| [TCP sockets](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/) | **No** |
181| [EventSource](https://developers.cloudflare.com/workers/runtime-apis/eventsource/) | **No** |
182| [MessageChannel](https://developers.cloudflare.com/workers/runtime-apis/messagechannel/) | **No** |
183| BroadcastChannel | **No** |
184
185### [Fetch, Request, Response, and Headers](https://developers.cloudflare.com/workers/runtime-apis/fetch/)
186
187**Partial**
188
189- The `cache` request option is not available.
190- celld removes `Content-Length` from a Worker response. It preserves the
191 header for a `HEAD` response.
192- A remote Durable Object call streams the request body to the owner. The call
193 cannot retry after body transmission starts because celld keeps no replay
194 copy.
195
196### [Bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/)
197
198**Partial**
199
200- The [services table](#services) lists the available binding types.
201- celld supports Durable Objects, services, variables, assets, D1, KV, Queues,
202 Workflows, and R2 bindings. Each other binding type is not available.
203
204### [Context](https://developers.cloudflare.com/workers/runtime-apis/context/)
205
206**Partial**
207
208- `passThroughOnException()` has no effect because celld has no CDN fallback.
209- `ctx.facets` is not defined.
210
211### [Handlers](https://developers.cloudflare.com/workers/runtime-apis/handlers/)
212
213**Partial**
214
215- The `tail` and `email` handlers are not available.
216
217### [RPC](https://developers.cloudflare.com/workers/runtime-apis/rpc/)
218
219**Partial**
220
221- A cross-isolate named service binding supports only a single method call. It
222 does not support `fetch()`, awaitable properties, or pipelined paths.
223- An RPC stub cannot cross an isolate boundary.
224- `ctx.exports` contains only the entrypoints that the configuration declares.
225
226### [Streams](https://developers.cloudflare.com/workers/runtime-apis/streams/)
227
228**Partial**
229
230- `ReadableStream.from()` is not available.
231
232### [WebSockets](https://developers.cloudflare.com/workers/runtime-apis/websockets/)
233
234**Partial**
235
236- `getTags()` is not available.
237- A caller must call `accept()` on the socket from a subrequest upgrade.
238- An outbound Worker socket closes after the response and `waitUntil` work
239 end.
240- celld rejects an upgrade when the response status is not 101.
241- celld removes Worker-supplied protocol and connection headers from an upgrade
242 response.
243- An outbound upgrade combines repeated values for one header name.
244- `acceptWebSocket()` throws when the isolate uses more than 90 percent of its
245 V8 heap limit.
246
247### [Web Crypto](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
248
249**Partial**
250
251- `wrapKey()` and `unwrapKey()` are not available.
252- RSA-PSS signing is not available.
253- Web Crypto does not provide HKDF or PBKDF2 through `deriveBits()`. Use
254 `node:crypto` for these algorithms.
255
256### [Web standards](https://developers.cloudflare.com/workers/runtime-apis/web-standards/)
257
258**Partial**
259
260- An `AbortSignal` does not abort an RPC call.
261- `signal.onabort` has no effect. Use `addEventListener("abort", ...)`.
262- `structuredClone()` is not conformant for some exotic types.
263
264### [Performance and timers](https://developers.cloudflare.com/workers/runtime-apis/performance/)
265
266**Partial**
267
268- An active interval keeps a Worker request open.
269- `performance.now()` has millisecond resolution.
270- The other `performance` properties are stubs.
271
272### [Console](https://developers.cloudflare.com/workers/runtime-apis/console/)
273
274**Partial**
275
276- `debug`, `trace`, `group`, and `table` have no effect.
277- `assert`, `time`, and `count` are not available.
278
279### [Node.js compatibility](https://developers.cloudflare.com/workers/runtime-apis/nodejs/)
280
281**Partial**
282
283- celld implements `node:assert`, `node:async_hooks`, `node:buffer`,
284 `node:events`, `node:path`, `node:stream`, `node:timers/promises`, and
285 `node:util`.
286- `node:crypto` does not implement Diffie-Hellman, streaming signatures,
287 ciphers, RSA-PSS, or DSA signatures and key generation.
288- `node:zlib` implements only the synchronous gzip and deflate functions.
289- `node:fs` returns `ENOENT` from each read.
290- Each other Node.js module returns an inert stub. This behavior is a known
291 silent gap.
292
293### [TCP sockets](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/)
294
295**No**
296
297- `connect()` returns an inert stub. This behavior is a known silent gap.
298
299### EventSource, MessageChannel, and BroadcastChannel
300
301**No**
302
303- These classes are inert stubs. This behavior is a known silent gap.
304
305## Compatibility flags
306
307celld honors these compatibility switches:
308
309- `delete_all_deletes_alarm`
310- `js_rpc`
311- `fetcher_no_get_put_delete`
312- `sqlite_vec`
313- `websocket_standard_binary_type`
314- The static-assets navigation flags
315
316celld accepts each other compatibility flag without effect.
317`Cloudflare.compatibilityFlags` reports only the flags that celld honors.
318
319## Wrangler configuration
320
321`celld deploy` accepts `wrangler.jsonc` or `wrangler.json`. It does not
322accept `wrangler.toml`. The deployment accepts these top-level keys:
323
324- `$schema`, `name`, `main`, and `no_bundle`
325- `compatibility_date` and `compatibility_flags`
326- `durable_objects` and `migrations`
327- `assets`, `services`, `triggers`, and `vars`
328- `d1_databases`, `kv_namespaces`, `queues`, `workflows`, and
329 `r2_buckets`
330
331Each other top-level key, including `routes`, stops the deployment.
332An asset-only project can omit `main`. celld refuses a symlink or special file
333in an asset directory, and `.assetsignore` requires Wrangler.
334
335See [Limitations](limitations.md) for the operating-system, networking,
336security, pressure, and update boundaries.