2.0.0-beta.50 - Reliable Dev Ports
v2.0.0-beta.50 is a small patch release with two Cloudflare
fixes, both from
John Royal.
Reliable Worker/Vite ports in alchemy dev
Section titled “Reliable Worker/Vite ports in alchemy dev”Port-conflict detection in cloudflare-runtime wasn’t firing
reliably, and it was worst with Vite. beta.50 has Vite listen on
a random port and places a WorkerProxy in front of it, so ports
are assigned deterministically and conflicts are actually
detected. The conflict detection and WorkerProxy implementation
in cloudflare-runtime were both tightened up along the way.
(#513)
Binding an Output into a Worker’s env
Section titled “Binding an Output into a Worker’s env”Passing an Output value — like another Worker’s URL — into a
Worker’s env crashed at deploy time with
Service not found: RuntimeContext:
const backend = yield* Cloudflare.Worker(/* ... */);
const website = yield* Cloudflare.Vite("Website", { rootDir: path.resolve(import.meta.dirname, "frontend"), env: { VITE_API_URL: backend.url.as<string>(), // crashed during deploy },});bindWorkerAsyncBindings was yield*ing the value, which called
.bind() on the Output prematurely — and bind() needs
RuntimeContext, which doesn’t exist at deploy time. beta.50
checks whether the value is an Output before yielding, so
output references thread through to runtime as intended.
(#514)