The best way to control Claude Code, Codex and more from any computer or phone

main
md 811 lines 35 KB
Rendered Raw
1 ---
2 title: 2.0.0-beta.84 - Monorepo, Domain & Faster Distilled
3 date: 2026-10-22T09:00:00Z
4 category: release
5 excerpt: One package per provider, bindings that work from any cloud, @alchemy.run/domain, faster distilled SDKs, and Cloudflare OAuth that can create Account API Tokens.
6 ---
7
8 beta.84 **splits `alchemy` into one package per provider**, so you install `@alchemy.run/aws` or `@alchemy.run/cloudflare`
9 next to `alchemy` instead of importing `alchemy/AWS`. Every AWS, GCP and
10 Cloudflare binding now works from any host, so a Worker can call SQS and a
11 Lambda can write to R2.
12
13 It also adds **`@alchemy.run/domain`**, a domain-driven design framework that
14 runs on Durable Objects, and **rebuilt distilled SDKs** that
15 add 5–100× less overhead per call than the official AWS, Cloudflare and GCP
16 SDKs, in bundles a third smaller than before. On AWS, there are **Lambda Web
17 Functions** with canary deploys. On Cloudflare, **`alchemy dev` for Vite
18 sites now behaves like `@cloudflare/vite-plugin`**, and the runtime bindings
19 use a lot less CPU.
20
21 :::caution
22 **Breaking changes**
23
24 - **Providers moved into their own packages**
25 ([#2348](https://github.com/alchemy-run/alchemy/pull/2348),
26 [#2316](https://github.com/alchemy-run/alchemy/pull/2316),
27 [#2313](https://github.com/alchemy-run/alchemy/pull/2313),
28 [#2311](https://github.com/alchemy-run/alchemy/pull/2311),
29 [#2309](https://github.com/alchemy-run/alchemy/pull/2309)). Install the
30 packages you use and update your imports. See
31 [below](#one-package-per-provider).
32 - **State store commands moved under `alchemy state`**
33 ([#2288](https://github.com/alchemy-run/alchemy/pull/2288)). The old
34 commands print the new one and exit 1:
35
36 ```diff lang="sh"
37 # Cloudflare state store
38 -alchemy provider cloudflare bootstrap
39 +alchemy state bootstrap --backend cloudflare
40 -alchemy prisma generate
41 +alchemy provider prisma generate
42 ```
43
44 In CI, a missing or outdated state store fails unless you pass `--yes`.
45 `AWS.state({ name })` is now a short logical name. Use `bucketName` to
46 pass a full bucket name.
47 - **`AWS.Lambda.isBindingHost` is removed**
48 ([#2260](https://github.com/alchemy-run/alchemy/pull/2260),
49 [#2347](https://github.com/alchemy-run/alchemy/pull/2347)). Custom AWS
50 bindings use `AWSBindings.Bind` and `AWSBindings.withCredentials`. EC2,
51 LaunchTemplate, AppRunner and Batch hosts now get IAM grants, so they
52 plan new IAM resources on the next deploy.
53 - **Distilled error classes are no longer Effect Schemas**
54 ([#2345](https://github.com/alchemy-run/alchemy/pull/2345)). Match them
55 with their `is` guard. Generated request and response schemas are no
56 longer exported; reach them through the operation:
57
58 ```diff lang="typescript"
59 // match a distilled error
60 -Schema.is(TooManyRequests)(error)
61 +TooManyRequests.is(error)
62 -PutDispatchNamespaceScriptRequest.ast
63 +putDispatchNamespaceScript.input.ast
64 ```
65
66 - **Prisma and Neon env values use the runtime wire format**
67 ([#2244](https://github.com/alchemy-run/alchemy/pull/2244)). Reading
68 them through `Prisma.Connect` or the Neon clients is unchanged. Code
69 that reads `process.env` directly sees secrets as
70 `{"_tag":"Redacted","value":"…"}`.
71 - **AWS framework sites run on Web Functions by default**
72 ([#2282](https://github.com/alchemy-run/alchemy/pull/2282),
73 [#2300](https://github.com/alchemy-run/alchemy/pull/2300)). The next
74 deploy creates a `WebServer` Web Function and deletes the old server
75 Lambda, keeping the CloudFront distribution and domain. Set
76 `server: "function"` to keep a Lambda Function URL server.
77 - **Effect 4.0.5** ([#2372](https://github.com/alchemy-run/alchemy/pull/2372)).
78 Bump `effect` and `@effect/*` to `^4.0.5`.
79 :::
80
81 ## One package per provider
82
83 `alchemy` keeps the engine, the CLI, and the local and in-memory state
84 stores. Every cloud and vendor now has its own package, and each one brings
85 its own resources, bindings and state store, such as `AWS.state()` or
86 `Cloudflare.state()`
87 ([#2348](https://github.com/alchemy-run/alchemy/pull/2348),
88 [#2316](https://github.com/alchemy-run/alchemy/pull/2316),
89 [#2313](https://github.com/alchemy-run/alchemy/pull/2313),
90 [#2311](https://github.com/alchemy-run/alchemy/pull/2311),
91 [#2309](https://github.com/alchemy-run/alchemy/pull/2309)):
92
93 ```sh
94 bun add alchemy@latest @alchemy.run/cloudflare@latest @alchemy.run/aws@latest
95 ```
96
97 ```diff lang="typescript"
98 import * as Alchemy from "alchemy";
99 -import * as AWS from "alchemy/AWS";
100 -import * as Cloudflare from "alchemy/Cloudflare";
101 -import * as Neon from "alchemy/Neon";
102 -import * as Drizzle from "alchemy/Drizzle";
103 -import * as Postgres from "alchemy/SQL/Postgres";
104 +import * as AWS from "@alchemy.run/aws";
105 +import * as Cloudflare from "@alchemy.run/cloudflare";
106 +import * as Neon from "@alchemy.run/neon";
107 +import * as Drizzle from "@alchemy.run/drizzle";
108 +import * as Postgres from "@alchemy.run/sql/Postgres";
109 ```
110
111 The same goes for `gcp`, `fly`, `railway`, `hetzner`, `prisma`,
112 `planetscale`, `turso`, `stripe`, `github`, `git`, `acme`, `axiom`,
113 `doppler`, `infisical`, `docker`, `kubernetes`, `redis` and `domain`.
114 Each package exports its directories and files, so
115 `@alchemy.run/aws/S3` and `@alchemy.run/aws/S3/Bucket` both resolve.
116
117 A few things moved within packages:
118
119 ```diff lang="typescript"
120 import * as Cloudflare from "@alchemy.run/cloudflare";
121 -solver: ACME.Cloudflare.ZoneSolver(zone),
122 +solver: Cloudflare.ACME.ZoneSolver(zone),
123 -Stripe.Cloudflare.ConsumeEventsLive
124 +Stripe.ConsumeEventsLive
125 -GitHub.Cloudflare.RepositoryEventSourceLive
126 +GitHub.RepositoryEventSourceLive
127 -import { ServerHost } from "alchemy/Server";
128 +import { ServerHost } from "alchemy/Runtime/Process";
129 -import { LibSQL } from "alchemy/SQL/LibSQL";
130 +import { LibSQL } from "@alchemy.run/sql/SQLite";
131 ```
132
133 The CLI finds each provider's auth, state store and `alchemy provider`
134 commands once your project depends on its package, through a new
135 `Contributions` module
136 ([#2288](https://github.com/alchemy-run/alchemy/pull/2288)). Named state
137 stores come with it:
138
139 ```typescript
140 state: Cloudflare.state({ name: "team-a" }),
141 ```
142
143 ```sh
144 alchemy state bootstrap --backend cloudflare --name team-a
145 ```
146
147 Runtime bundles shrank along the way. A Worker no longer bundles the
148 stack builder or CLI auth code (346 KB → 216 KB,
149 [#2240](https://github.com/alchemy-run/alchemy/pull/2240)), and a Lambda
150 that imports the Cloudflare barrel drops from 3.26 MB to 0.84 MB
151 ([#2267](https://github.com/alchemy-run/alchemy/pull/2267)). Thanks
152 [Rahul Mishra](https://github.com/BlankParticle), who did most of this
153 split!
154
155 ## OAuth can now create Account API Tokens
156
157 Cloudflare OAuth can now grant **Account API Token Provisioning**, so
158 alchemy can mint scoped API tokens on your behalf. To add it, re-run the
159 Cloudflare login and pick **All Scopes**:
160
161 ```sh
162 alchemy profile edit --reconfigure Cloudflare
163 ```
164
165 Then turn the scope on under **Sensitive scopes** on Cloudflare's consent
166 page. It's off by default:
167
168 ![Cloudflare's consent page with the Account API Token Provisioning toggle under Sensitive scopes](/cloudflare/oauth-api-token-provisioning.png)
169
170 Login now goes through the Cloudflare CLI's (`cf`) OAuth client with device
171 auth, the same flow as `cf login`
172 ([#2444](https://github.com/alchemy-run/alchemy/pull/2444)). Existing
173 profiles keep refreshing.
174
175 Docs: [Cloudflare setup](/cloudflare/setup).
176
177 ## Every binding works from every cloud
178
179 In beta.83, only the S3, Lambda and DynamoDB bindings worked outside AWS,
180 no GCP binding worked outside GCP, and Cloudflare's `*Http` bindings crashed
181 on any host that wasn't a Worker. As part of the package split, every
182 binding now works on any host: all ~2,850 AWS bindings across 205 services
183 ([#2260](https://github.com/alchemy-run/alchemy/pull/2260)), all 192 GCP
184 bindings across 57 services
185 ([#2347](https://github.com/alchemy-run/alchemy/pull/2347)), and every
186 Cloudflare `*Http` binding
187 ([#2267](https://github.com/alchemy-run/alchemy/pull/2267)).
188
189 A Cloudflare Worker sends to SQS with the same binding a Lambda uses. You
190 provide its `*Http` layer:
191
192 ```typescript
193 import * as AWS from "@alchemy.run/aws";
194 import * as Cloudflare from "@alchemy.run/cloudflare";
195 import * as Effect from "effect/Effect";
196 import * as HttpServerResponse from "effect/http/HttpServerResponse";
197
198 export default class Api extends Cloudflare.Worker<Api>()(
199 "Api",
200 { main: import.meta.url },
201 Effect.gen(function* () {
202 const queue = yield* AWS.SQS.Queue("Jobs");
203 const sendMessage = yield* AWS.SQS.SendMessage(queue);
204 return {
205 fetch: sendMessage({ MessageBody: "hello" }).pipe(
206 Effect.map(() => HttpServerResponse.text("queued")),
207 ),
208 };
209 }).pipe(Effect.provide(AWS.SQS.SendMessageHttp)),
210 ) {}
211 ```
212
213 On AWS hosts, a binding grants its permissions to the host's own role. On
214 any other host, such as a Worker or Cloud Run, Alchemy creates a
215 least-privilege IAM user and role for it and signs each call with that
216 role. GCP works the same way with a service account and key. The other
217 direction works too: a Lambda writes to R2 through
218 `Cloudflare.R2.WriteBucketHttp`, which binds a scoped Cloudflare API token.
219 Hosts that run as a role or service account leave this code out of their
220 bundles. Thanks [Rahul Mishra](https://github.com/BlankParticle)!
221
222 Docs: [Bindings](/infrastructure-as-effects/binding).
223
224 ## Domain-driven design with `@alchemy.run/domain`
225
226 `@alchemy.run/domain` models your backend in your business's terms
227 ([#2176](https://github.com/alchemy-run/alchemy/pull/2176)). Commands ask
228 for changes, aggregates decide them, and events record what happened.
229 Views, policies, sagas and projections react to those events. The same
230 model runs in memory for tests and on Durable Objects in production.
231
232 A command declares its target, input, events, rejections and reply:
233
234 ```typescript
235 import * as Domain from "@alchemy.run/domain";
236
237 export class MoneyDeposited extends Domain.Event("MoneyDeposited", {
238 amount: Schema.Int,
239 balanceAfter: Schema.Int,
240 }) {}
241
242 export class DepositMoney extends Domain.Command("DepositMoney", {
243 target: AccountId,
244 input: { amount: Schema.Int },
245 events: [MoneyDeposited],
246 rejects: [NotOpen],
247 reply: { balance: Schema.Int },
248 }) {}
249 ```
250
251 The aggregate decides it against its current state:
252
253 ```typescript
254 DepositMoney: (s, cmd) =>
255 s._tag !== "Open"
256 ? new NotOpen()
257 : [new MoneyDeposited({ amount: cmd.amount, balanceAfter: s.balance + cmd.amount })],
258 ```
259
260 A story tests it in memory: given this history, when this command, then
261 these events.
262
263 ```typescript
264 story(
265 Story.given(account, new AccountOpened({ owner: "sam" })),
266 Story.when(account, new DepositMoney({ amount: 100 })),
267 Story.then(account, new MoneyDeposited({ amount: 100, balanceAfter: 100 })),
268 Story.replied({ balance: 100 }),
269 );
270 ```
271
272 On Cloudflare, provide `DomainCloudflare.DurableObjects` and every
273 aggregate, view key and policy gets its own Durable Object. Views are
274 security boundaries, and clients can watch them live over WebSockets. The
275 package ships an `alchemy-domain` skill so your coding agent can build a
276 model with you.
277
278 Docs: [Domain](/domain) · [Tutorial](/domain/tutorial/part-1) ·
279 [Cloudflare Durable Objects](/domain/cloudflare).
280
281 ## Smaller, faster distilled SDKs
282
283 Alchemy's cloud SDKs come from [distilled](https://github.com/alchemy-run/distilled).
284 This release picks up a rebuilt distilled
285 ([distilled#873](https://github.com/alchemy-run/distilled/pull/873),
286 [#2345](https://github.com/alchemy-run/alchemy/pull/2345)) that dedupes
287 schemas, builds them lazily, and replaces Effect Schema with a lighter
288 schema tree. Medians over 98 one-auth, one-call programs:
289
290 | | Before | After | Change |
291 | --- | ---: | ---: | ---: |
292 | Bundle size (gzip) | 57.1 KB | 38.3 KB | −33% |
293 | Added latency per call (p50) | 19.5 µs | 4.0 µs | −79% |
294 | Import heap | 2.15 MB | 0.57 MB | −74% |
295 | First call (cold) | 4.9 ms | 3.3 ms | −34% |
296
297 Importing a whole provider is where it shows most. AWS has 438 services,
298 GCP 318 and Cloudflare 129:
299
300 | Provider | Import heap | Import time |
301 | --- | ---: | ---: |
302 | AWS | 227 MB → 13.9 MB | 1.61 s → 0.14 s |
303 | GCP | 111 MB → 9.4 MB | 0.75 s → 0.09 s |
304 | Cloudflare | 76 MB → 3.2 MB | 0.63 s → 0.05 s |
305
306 The packages you install from npm shrink too:
307
308 | Package | Download (tgz) | Unpacked |
309 | --- | ---: | ---: |
310 | `@distilled.cloud/aws` | 23.3 MB → 19.3 MB | 211 MB → 143 MB |
311 | `@distilled.cloud/gcp` | 42.3 MB → 36.1 MB | 345 MB → 262 MB |
312 | `@distilled.cloud/cloudflare` | 9.5 MB → 5.8 MB | 112 MB → 58 MB |
313
314 ### Faster than the official SDKs
315
316 The same calls through the official SDKs: AWS SDK v3, the Stainless-built
317 `cloudflare` package, and `@google-cloud/storage`. Each official program
318 imports one client. Each distilled program imports the whole provider and
319 is still smaller:
320
321 | Call | Added latency per call | Bundle (gzip) | Import heap |
322 | --- | ---: | ---: | ---: |
323 | GCP `storage.getBuckets` | 674 → **6.2 µs** | 239 → **40 KB** | 5.1 → **0.7 MB** |
324 | S3 `ListBuckets` | 140 → **19 µs** | 157 → **61 KB** | 4.4 → **1.1 MB** |
325 | EC2 | 97 → **16 µs** | 265 → **55 KB** | 12.2 → **1.5 MB** |
326 | DynamoDB | 87 → **14 µs** | 145 → **54 KB** | 3.3 → **1.0 MB** |
327 | Lambda | 79 → **15 µs** | 141 → **55 KB** | 3.6 → **1.1 MB** |
328 | Cloudflare `workers.scripts.list` | 15.5 → **3.0 µs** | 125 → **56 KB** | 15.3 → **0.7 MB** |
329
330 Distilled adds 5–100× less overhead per call, ships bundles 2–6× smaller,
331 and imports with 3–22× less memory. Its first cold call is faster too, except
332 on Cloudflare, where it takes 3.4 ms against the official SDK's 1.9 ms.
333
334 The Cloudflare package now signs R2 presigned URLs
335 with the standalone `@distilled.cloud/aws4signer`, so it no longer depends
336 on the AWS SDK ([#2370](https://github.com/alchemy-run/alchemy/pull/2370)).
337 Thanks [Michael K](https://github.com/Mkassabov)!
338
339 ## Plan and apply scale linearly
340
341 Plan and apply used to do work proportional to the square of the stack's
342 resource count. Apply rebuilt every resource's outputs once per resource, and
343 plan scanned every node to find each node's dependents. Both are now linear
344 ([#2419](https://github.com/alchemy-run/alchemy/pull/2419)):
345
346 | Stack shape | Resources | Before | After |
347 | --- | ---: | ---: | ---: |
348 | Independent | 4,000 | 3.4 s | 1.7 s |
349 | Independent | 8,000 | 9.5 s | 3.8 s |
350 | 20 dependencies each | 1,000 | 1.2 s | 1.1 s |
351 | 20 dependencies each | 2,000 | 3.3 s | 2.1 s |
352
353 Timings are engine overhead only, measured with no-op providers. Thanks
354 [gpu004](https://github.com/gpu004) for profiling it!
355
356 ## Foldkit SSR and prerendering
357
358 [Foldkit](https://foldkit.dev) apps can now render on the server and
359 prerender pages, on every website provider
360 ([#1313](https://github.com/alchemy-run/alchemy/pull/1313)). Turn on
361 `ssr.build` in the Foldkit Vite plugin:
362
363 ```typescript
364 // vite.config.ts
365 export default defineConfig({
366 plugins: [
367 foldkit({
368 ssr: {
369 serverEntry: "/src/entry.server.ts",
370 clientEntry: "/src/entry.ts",
371 build: { prerender: true },
372 },
373 }),
374 ],
375 });
376 ```
377
378 Alchemy deploys the server Foldkit generates and serves prerendered pages
379 as static files. On Cloudflare, Fly, Hetzner, Railway, Neon, Prisma and
380 GCP, the build decides whether the site is an SPA, static, SSR or a hybrid:
381
382 ```typescript
383 const site = yield* Cloudflare.Website.Foldkit("Web");
384 ```
385
386 On AWS, you choose between a server and a static site:
387
388 ```typescript
389 const app = yield* AWS.Website.Foldkit("Web", { output: "server" });
390 const docs = yield* AWS.Website.Foldkit("Docs", { output: "static", errorPage: "404.html" });
391 ```
392
393 Foldkit pairs with [`@alchemy.run/domain`](/domain/foldkit) for the
394 front end of a domain model. Thanks
395 [Filip Falcon](https://github.com/filipfalcon)!
396
397 Docs: [Foldkit on Cloudflare](/cloudflare/frontend/foldkit) ·
398 [Foldkit on AWS](/aws/frontend/foldkit).
399
400 ## Lambda Web Functions
401
402 `AWS.Lambda.WebFunction` runs your HTTP server on [Lambda Web
403 Functions](https://aws.amazon.com/blogs/aws/announcing-aws-lambda-web-functions-for-fast-consistent-web-app-performance-anywhere/)
404 ([#2243](https://github.com/alchemy-run/alchemy/pull/2243)). Each
405 environment serves up to 128 requests at once, responses stream, and every
406 function gets an HTTPS endpoint. An Effect Web Function returns `fetch`,
407 and existing bindings work unchanged:
408
409 ```typescript
410 export default class Api extends AWS.Lambda.WebFunction<Api>()(
411 "Api",
412 { main: import.meta.url, authType: "ApplicationManaged" },
413 Effect.gen(function* () {
414 const bucket = yield* AWS.S3.Bucket("Uploads");
415 const putObject = yield* AWS.S3.PutObject(bucket);
416 return {
417 fetch: Effect.gen(function* () {
418 yield* putObject({ Key: "hello.txt", Body: "Hello!" });
419 return HttpServerResponse.text("Saved");
420 }).pipe(Effect.orDie),
421 };
422 }).pipe(Effect.provide(AWS.S3.PutObjectHttp)),
423 ) {}
424 ```
425
426 Or bring your own server (Hono, Express, `node:http`). It listens on
427 `AWS_LAMBDA_HTTP_ENDPOINT`:
428
429 ```typescript
430 yield* AWS.Lambda.WebFunction("Api", {
431 main: "./src/server.ts",
432 authType: "ApplicationManaged",
433 regions: ["us-east-1", "eu-west-1"], // one global domain
434 });
435 ```
436
437 `canary` sends a share of traffic to each new deploy
438 ([#2280](https://github.com/alchemy-run/alchemy/pull/2280)). Edit the
439 weight to promote or roll back:
440
441 ```typescript
442 canary: { weight: 10 }, // the new revision gets 10%, the previous one 90%
443 ```
444
445 Every server-rendered `AWS.Website` (Nuxt, SvelteKit, Astro, React Router,
446 SolidStart, TanStack Start, Waku, Octane, Vinext) now runs on a Web
447 Function by default
448 ([#2282](https://github.com/alchemy-run/alchemy/pull/2282)). Next.js runs
449 as its own standalone server with an S3 cache, without OpenNext, SQS or
450 DynamoDB ([#2300](https://github.com/alchemy-run/alchemy/pull/2300)).
451 Existing sites roll forward on the next deploy.
452
453 Docs: [Web Functions](/aws/compute/web-functions) ·
454 [Next.js](/aws/frontend/nextjs).
455
456 ## Effect workflows on every engine
457
458 `alchemy/Workflows` runs `effect/workflow` workflows on Durable Objects,
459 Cloudflare Workflows, and Lambda durable functions
460 ([#2252](https://github.com/alchemy-run/alchemy/pull/2252),
461 [#2268](https://github.com/alchemy-run/alchemy/pull/2268),
462 [#2390](https://github.com/alchemy-run/alchemy/pull/2390)).
463
464 `Workflows.layer` implements a workflow. Pass it an Effect that resolves
465 bindings, here an R2 bucket, and return the handler that uses them:
466
467 ```typescript
468 // src/Onboard.ts
469 import * as Cloudflare from "@alchemy.run/cloudflare";
470 import * as Workflows from "alchemy/Workflows";
471 import * as Effect from "effect/Effect";
472 import * as Schema from "effect/Schema";
473 import { Activity, DurableClock, Workflow } from "effect/workflow";
474
475 export const Profiles = Cloudflare.R2.Bucket("Profiles");
476
477 export const Onboard = Workflow.make("Onboard", {
478 payload: { userId: Schema.String },
479 success: Schema.String,
480 idempotencyKey: ({ userId }) => userId,
481 });
482
483 export const OnboardLive = Workflows.layer(
484 Onboard,
485 Effect.gen(function* () {
486 const profiles = yield* Cloudflare.R2.WriteBucket(Profiles);
487 return Effect.fn(function* ({ userId }) {
488 yield* Activity.make({
489 name: "create-profile",
490 execute: profiles
491 .put(`${userId}.json`, JSON.stringify({ userId, plan: "trial" }))
492 .pipe(Effect.orDie),
493 });
494 // the run suspends for a week and costs nothing while it waits
495 yield* DurableClock.sleep({ name: "trial", duration: "7 days" });
496 yield* Activity.make({
497 name: "end-trial",
498 execute: profiles
499 .put(`${userId}.json`, JSON.stringify({ userId, plan: "free" }))
500 .pipe(Effect.orDie),
501 });
502 return `onboarded ${userId}`;
503 });
504 }),
505 );
506 ```
507
508 The Worker starts runs with `Workflows.RunWorkflow` and reads them back.
509 Give it the implementation, the R2 binding and an engine, here Durable
510 Objects:
511
512 ```typescript
513 // src/Api.ts
514 import * as Cloudflare from "@alchemy.run/cloudflare";
515 import * as Workflows from "alchemy/Workflows";
516 import * as Effect from "effect/Effect";
517 import { HttpServerRequest } from "effect/http/HttpServerRequest";
518 import * as HttpServerResponse from "effect/http/HttpServerResponse";
519 import * as Layer from "effect/Layer";
520 import { Onboard, OnboardLive } from "./Onboard.ts";
521
522 export default class Api extends Cloudflare.Worker<Api>()(
523 "Api",
524 { main: import.meta.url },
525 Effect.gen(function* () {
526 const onboard = yield* Workflows.RunWorkflow(Onboard);
527 return {
528 fetch: Effect.gen(function* () {
529 const request = yield* HttpServerRequest;
530 const url = new URL(request.url, "http://localhost");
531 if (request.method === "POST") {
532 const userId = url.searchParams.get("user")!;
533 const run = yield* onboard.start({ userId });
534 return HttpServerResponse.text(run.executionId);
535 }
536 const runId = url.searchParams.get("run")!;
537 // NotStarted | Running | Completed | Failed | Interrupted | Died
538 const status = yield* onboard.get(runId).status;
539 return HttpServerResponse.text(status._tag);
540 }).pipe(Effect.orDie),
541 };
542 }).pipe(
543 Effect.provide(
544 OnboardLive.pipe(
545 Layer.provide(Cloudflare.R2.WriteBucketBinding),
546 Layer.provideMerge(Cloudflare.Workflows.DurableObjectEngine),
547 ),
548 ),
549 ),
550 ) {}
551 ```
552
553 Swap `DurableObjectEngine` for `Cloudflare.Workflows.NativeEngine` to run
554 it on Cloudflare Workflows instead. On AWS, host workflows in an
555 `AWS.Lambda.WorkflowFunction` and start them from other functions with
556 `AWS.Lambda.DurableFunctionEngine`.
557
558 Docs: [Cloudflare](/cloudflare/compute/effect-workflows) ·
559 [AWS](/aws/compute/effect-workflows).
560
561 ## Vite dev that matches `@cloudflare/vite-plugin`
562
563 A `Website.Vite` Worker now behaves in `alchemy dev` as it does deployed,
564 and as it does under `@cloudflare/vite-plugin`
565 ([#2367](https://github.com/alchemy-run/alchemy/pull/2367),
566 [#2365](https://github.com/alchemy-run/alchemy/pull/2365),
567 [#2144](https://github.com/alchemy-run/alchemy/pull/2144)). Durable
568 Objects from other Workers, Workflows, Containers, WebSockets, `ctx.access`,
569 Node.js polyfills, HTTPS dev servers and Wrangler's `/cdn-cgi/local/*`
570 endpoints all work in dev. Asset routing follows your `htmlHandling`,
571 `notFoundHandling` and `runWorkerFirst`:
572
573 ```typescript
574 yield* Cloudflare.Website.Vite("App", {
575 main: "./api/index.ts",
576 assets: { notFoundHandling: "single-page-application", runWorkerFirst: ["/api/*"] },
577 });
578 // dev before: /api/some-file.txt → the file on disk
579 // dev now: /api/some-file.txt → the Worker, as deployed
580 ```
581
582 A Vite config that keeps `cloudflare()` from `@cloudflare/vite-plugin` now
583 runs, so RedwoodSDK, Flue and the Agents SDK build as documented. Tests
584 run the official plugin next to Alchemy's on the same projects and compare
585 config, build output and runtime behavior. The full list is in
586 [`PARITY.md`](https://github.com/alchemy-run/alchemy/blob/main/packages/cloudflare-runtime/src/vite/PARITY.md).
587
588 The dev server also refuses `.env`, `.dev.vars` and `.alchemy/`, and no
589 longer forwards a request like `//127.0.0.1:47667/x` to another local port
590 ([#2381](https://github.com/alchemy-run/alchemy/pull/2381)). Thanks
591 [Arman Charan](https://github.com/armancharan)!
592
593 ## Faster Cloudflare runtime
594
595 [Dan van der Merwe](https://github.com/danieljvdm) measured the runtime
596 bindings on deployed Workers and Durable Objects and cut their CPU time:
597
598 | Workload | Mean CPU before → after |
599 | --- | ---: |
600 | Copy a 16 MiB R2 object with `get` + `put` ([#2276](https://github.com/alchemy-run/alchemy/pull/2276)) | 630 → 3.8 ms |
601 | Prepare five 1 MiB Workers AI images ([#2274](https://github.com/alchemy-run/alchemy/pull/2274)) | 270 → 10.6 ms |
602 | 1,000 workflow result round trips ([#2271](https://github.com/alchemy-run/alchemy/pull/2271)) | 358 → 32 ms |
603 | 2 MiB through the RPC codec ([#2272](https://github.com/alchemy-run/alchemy/pull/2272)) | 85 → 20 ms |
604 | Pack 500 queue messages ([#2275](https://github.com/alchemy-run/alchemy/pull/2275)) | 235 → 92 ms |
605 | Drain 1,000 Durable Object scheduled events ([#2277](https://github.com/alchemy-run/alchemy/pull/2277)) | 33 → 8.4 ms |
606 | 2,000 env reads in a Durable Object ([#2279](https://github.com/alchemy-run/alchemy/pull/2279)) | 29 → 4.9 ms |
607
608 SQL cursors allocate only what you use
609 ([#2281](https://github.com/alchemy-run/alchemy/pull/2281)). RPC streams
610 whose values arrive after the method returns now deliver every value
611 ([#2273](https://github.com/alchemy-run/alchemy/pull/2273)), and durable
612 callbacks that keep failing now back off and park after eight attempts
613 instead of waking forever
614 ([#1908](https://github.com/alchemy-run/alchemy/pull/1908)).
615
616 ## RDS migrations everywhere
617
618 `migrations` now works on every PostgreSQL, MySQL and MariaDB
619 `DBInstance`, standalone or Aurora
620 ([#2125](https://github.com/alchemy-run/alchemy/pull/2125),
621 [#2289](https://github.com/alchemy-run/alchemy/pull/2289)). Aurora runs
622 them over the Data API. A public database connects directly, and a
623 private one runs them from a Lambda in the VPC:
624
625 ```typescript
626 const runner = yield* AWS.RDS.MigrationRunner("MigrationRunner", {
627 subnetIds: network.privateSubnetIds,
628 securityGroupIds: [runnerSecurityGroup.groupId],
629 });
630
631 const db = yield* AWS.RDS.DBInstance("Db", {
632 engine: "mysql",
633 // ...
634 migrations: "./migrations",
635 migrationsTransport: runner,
636 });
637 ```
638
639 Thanks [gegi](https://github.com/xofromthemoon)!
640
641 Docs: [RDS](/aws/data/rds) · [Drizzle on Aurora](/aws/data/drizzle-aurora).
642
643 ## GCP state store
644
645 `GCP.state()` keeps deploy state in a Cloud Storage bucket in your project
646 ([#2379](https://github.com/alchemy-run/alchemy/pull/2379)):
647
648 ```typescript
649 export default Alchemy.Stack(
650 "MyApp",
651 { providers: GCP.providers(), state: GCP.state() },
652 program,
653 );
654 ```
655
656 ```sh
657 alchemy state bootstrap --backend gcp
658 ```
659
660 `AWS.state()` now locks each stack and stage too, so two concurrent
661 deploys of one stage can no longer mix their state
662 ([#2145](https://github.com/alchemy-run/alchemy/pull/2145)). Thanks
663 [Arman Charan](https://github.com/armancharan)! The GCP docs are rebuilt
664 around a five-part tutorial
665 ([#2374](https://github.com/alchemy-run/alchemy/pull/2374)).
666
667 Docs: [GCP](/gcp) · [GCP setup](/gcp/setup).
668
669 ## Fly remote builds
670
671 `Fly.Service` images now build on Fly's remote builders, the same ones
672 `fly deploy` uses ([#2472](https://github.com/alchemy-run/alchemy/pull/2472)).
673 Only your bundled app leaves your machine: the builder pulls the base image,
674 builds, and pushes to `registry.fly.io` right next to it. Deploys no longer
675 upload the whole ~86 MB `node:26-slim` image for every Service, which made
676 them slow on home and CI connections. Nothing to change in your stack:
677
678 ```typescript
679 // builds on a Fly remote builder
680 yield* Fly.Service("Api", { main: import.meta.url });
681
682 // build and push with your local Docker engine instead
683 yield* Fly.Service("Api", { main: import.meta.url, build: { remote: false } });
684 ```
685
686 Docs: [Fly services](/fly/compute/services).
687
688 ## Also in this release
689
690 - **`GCP.IAM.ServiceAccount` and `ServiceAccountKey`** resources
691 ([#2347](https://github.com/alchemy-run/alchemy/pull/2347)).
692 - **`Cloudflare.Hyperdrive.lookup`**
693 ([#1345](https://github.com/alchemy-run/alchemy/pull/1345)) binds an
694 existing Hyperdrive configuration without managing it. Thanks
695 [Franz Rebaza](https://github.com/Franz1241)!
696 - **`ctx.props` and `ctx.exports`** in Effect Workers and Durable Objects
697 ([#2251](https://github.com/alchemy-run/alchemy/pull/2251)), and
698 hibernation `tags` on `Cloudflare.upgrade()`
699 ([#2265](https://github.com/alchemy-run/alchemy/pull/2265)). Thanks
700 [gegi](https://github.com/xofromthemoon)!
701 - **Container placement** `jurisdiction` and `regions` are typed
702 ([#2253](https://github.com/alchemy-run/alchemy/pull/2253)), local
703 containers can mount FUSE filesystems
704 ([#2362](https://github.com/alchemy-run/alchemy/pull/2362)), and
705 detached or adopted container applications redeploy cleanly
706 ([#2378](https://github.com/alchemy-run/alchemy/pull/2378),
707 [#2283](https://github.com/alchemy-run/alchemy/pull/2283)). Containers
708 built from inline Dockerfile content deploy ([#2341](https://github.com/alchemy-run/alchemy/pull/2341)), and `monitor()`
709 fails with the same typed placement errors as `start()` ([#2340](https://github.com/alchemy-run/alchemy/pull/2340)).
710 Thanks [Jakub Sieczczyński](https://github.com/jakvbs),
711 [Jonathan Beckman](https://github.com/jonbeckman),
712 [Yannic Charlon](https://github.com/JustYannicc) and
713 [Drew Powers](https://github.com/drwpwrs)!
714 - **`localUploads` on `Cloudflare.R2.Bucket`** ([#2424](https://github.com/alchemy-run/alchemy/pull/2424)).
715 - **Cloudflare fixes**: a failed ruleset read no longer wipes a zone's
716 other rules when a Worker sets `domain.redirects` or `version.affinity` ([#2339](https://github.com/alchemy-run/alchemy/pull/2339)),
717 `WorkerEntrypoint` targets a cross-stack `Worker.ref` ([#2414](https://github.com/alchemy-run/alchemy/pull/2414)), a
718 rotated `MtlsCertificate` uploads the new PEM ([#2428](https://github.com/alchemy-run/alchemy/pull/2428)), and a
719 Hyperdrive config replaces when its CA pin is dropped ([#2429](https://github.com/alchemy-run/alchemy/pull/2429)).
720 Thanks [Drew Powers](https://github.com/drwpwrs)!
721 - **Cloudflare website builds receive `env`**, so `NEXT_PUBLIC_*`,
722 `VITE_*` and similar values reach the client bundle
723 ([#2238](https://github.com/alchemy-run/alchemy/pull/2238)), and a full
724 Worker deploy returns its `versionId` and `deploymentId`
725 ([#2241](https://github.com/alchemy-run/alchemy/pull/2241)). Thanks
726 [Kevin](https://github.com/kevinquack0)!
727 - **Local dev fixes**: `/.well-known/` assets serve
728 ([#2212](https://github.com/alchemy-run/alchemy/pull/2212)), large D1
729 migrations and `importFiles` apply
730 ([#2380](https://github.com/alchemy-run/alchemy/pull/2380),
731 [#2258](https://github.com/alchemy-run/alchemy/pull/2258)), `publicDir`
732 files serve through `ASSETS`
733 ([#2290](https://github.com/alchemy-run/alchemy/pull/2290)),
734 `StaticSite` takes `dev.port`
735 ([#2331](https://github.com/alchemy-run/alchemy/pull/2331)), tail
736 consumers receive events and each Worker gets its own Cache store
737 ([#2383](https://github.com/alchemy-run/alchemy/pull/2383)), port
738 probes stay on loopback
739 ([#2237](https://github.com/alchemy-run/alchemy/pull/2237)), and early
740 responses no longer reset the connection
741 ([#2242](https://github.com/alchemy-run/alchemy/pull/2242)). Thanks
742 [birbprophet](https://github.com/birbprophet),
743 [Altay](https://github.com/altaywtf),
744 [Kevin](https://github.com/kevinquack0) and
745 [Matthew Ruiters](https://github.com/mcr5fh)!
746 - **Cloudflare deploys on Node 26** use HTTP/1.1 for API calls, avoiding
747 stream resets ([#2155](https://github.com/alchemy-run/alchemy/pull/2155)),
748 and Durable Object RPC retries through deploy propagation
749 ([#2294](https://github.com/alchemy-run/alchemy/pull/2294)).
750 - **`metadataOptions` on `AWS.EC2.Instance`** and `LaunchTemplate`
751 ([#2426](https://github.com/alchemy-run/alchemy/pull/2426)), `Redacted` `userData` on `Instance` ([#2421](https://github.com/alchemy-run/alchemy/pull/2421)), and a VPC
752 whose create was interrupted is recovered instead of leaked
753 ([#2416](https://github.com/alchemy-run/alchemy/pull/2416)).
754 - **`AWS.RDS.Aurora` accepts Outputs** for `kmsKeyId` and `migrations`
755 ([#2364](https://github.com/alchemy-run/alchemy/pull/2364)). Thanks [gegi](https://github.com/xofromthemoon)!
756 - **AWS fixes**: `Lambda.KafkaEventSource` grants the EC2 permissions MSK
757 mappings need ([#2401](https://github.com/alchemy-run/alchemy/pull/2401)), `EMRContainers.VirtualCluster` waits for a new
758 EKS cluster's connection ([#2412](https://github.com/alchemy-run/alchemy/pull/2412)), and
759 `DataZone.EnvironmentBlueprintConfiguration` removes the Lake Formation
760 admins DataZone added ([#2411](https://github.com/alchemy-run/alchemy/pull/2411)).
761 - **~200 more AWS resources run on [floci](/aws/local-development)** in
762 `alchemy dev` ([#1803](https://github.com/alchemy-run/alchemy/pull/1803)).
763 - **AgentCore Runtime V2** with `platformVersion`
764 ([#2301](https://github.com/alchemy-run/alchemy/pull/2301)), ECS dev
765 watcher keeps the recorded task definition
766 ([#2091](https://github.com/alchemy-run/alchemy/pull/2091)). Thanks
767 [Henry Marks](https://github.com/Henrymarks1) and
768 [TBIQ007](https://github.com/TBIQ007)!
769 - **Railway ephemeral environments**
770 ([#2117](https://github.com/alchemy-run/alchemy/pull/2117)) and a 768 MiB
771 Prisma Compute upload cap
772 ([#2257](https://github.com/alchemy-run/alchemy/pull/2257)). Thanks
773 [Mikkel](https://github.com/mbirkegaard) and
774 [Aman Varshney](https://github.com/AmanVarshney01)!
775 - **`GitHub.consumeRepositoryEvents` generates a webhook secret** when you
776 omit one, so every delivery's signature is checked ([#1932](https://github.com/alchemy-run/alchemy/pull/1932)).
777 `GitHub.Ruleset` takes `allowedMergeMethods` and
778 `requireExtraApprovalForUnattributedChanges` ([#2397](https://github.com/alchemy-run/alchemy/pull/2397)) and adopts an
779 existing ruleset by name ([#2129](https://github.com/alchemy-run/alchemy/pull/2129)), and `GitHub.BranchProtection`
780 deploys with `requiredStatusChecks.checks` ([#2076](https://github.com/alchemy-run/alchemy/pull/2076)). Thanks
781 [Jason Kuhrt](https://github.com/jasonkuhrt),
782 [Patt O'Brien](https://github.com/pattobrien) and
783 [Arman Charan](https://github.com/armancharan)!
784 - **Core fixes**: declaring a logical id already used by another type fails
785 with `DuplicateLogicalIdError` ([#2063](https://github.com/alchemy-run/alchemy/pull/2063)), `afterAll(destroy(Stack))` no
786 longer hangs under Vitest ([#2142](https://github.com/alchemy-run/alchemy/pull/2142)), a `Docker.Context` missing from a
787 fresh CI runner is re-created ([#2187](https://github.com/alchemy-run/alchemy/pull/2187)), log redaction no longer leaks
788 the tail of a secret that extends a shorter one ([#2418](https://github.com/alchemy-run/alchemy/pull/2418)), tarballs keep
789 long non-ASCII file names intact ([#2420](https://github.com/alchemy-run/alchemy/pull/2420)), and `alchemy/State`
790 type-checks under `exactOptionalPropertyTypes` ([#2413](https://github.com/alchemy-run/alchemy/pull/2413)). Thanks
791 [Arman Charan](https://github.com/armancharan) and
792 [Patt O'Brien](https://github.com/pattobrien)!
793 - **The CLI runs on Node 22.22.3+** again ([#2403](https://github.com/alchemy-run/alchemy/pull/2403)), and
794 `alchemy profile refresh --provider` matches case-insensitively
795 ([#2410](https://github.com/alchemy-run/alchemy/pull/2410)). Thanks [Rahul Mishra](https://github.com/BlankParticle)!
796 - **`alchemy profile`** no longer crashes with `Cannot find package 'react'`
797 ([#2295](https://github.com/alchemy-run/alchemy/pull/2295)), and Workers
798 bundle less core code
799 ([#2240](https://github.com/alchemy-run/alchemy/pull/2240)). Thanks
800 [birbprophet](https://github.com/birbprophet) and
801 [Juliaan](https://github.com/schutzelaars)!
802
803 ## Where to go next
804
805 - [Getting started](/getting-started) · [Cloudflare setup](/cloudflare/setup) · [AWS setup](/aws/setup) · [GCP setup](/gcp/setup)
806 - [Domain](/domain) · [Domain tutorial](/domain/tutorial/part-1) · [Foldkit](/cloudflare/frontend/foldkit)
807 - [Web Functions](/aws/compute/web-functions) · [Next.js on AWS](/aws/frontend/nextjs) · [RDS](/aws/data/rds)
808 - [Effect workflows on Cloudflare](/cloudflare/compute/effect-workflows) · [on AWS](/aws/compute/effect-workflows)
809 - [Vite on Cloudflare](/cloudflare/frontend/vite)
810 - [CHANGELOG](https://github.com/alchemy-run/alchemy/blob/main/CHANGELOG.md#v200-beta84)
811 - [Compare v2.0.0-beta.83 → v2.0.0-beta.84](https://github.com/alchemy-run/alchemy/compare/v2.0.0-beta.83...v2.0.0-beta.84)