Cloudflare Workers gets an edge-based local dev loop

Cloudflare’s serverless platform runs application code across its network of 200 data centers, placing compute close to end users. Historically, developing for that environment meant either working against a local emulation of the runtime or pushing changes to production to see how they behaved. With the general availability of wrangler dev in wrangler 1.11, the company is positioning the tool as an edge-based development environment: code executes on Cloudflare’s infrastructure rather than on a developer’s machine.

Why not develop locally?

Local development is the default assumption for most platforms, but the Workers team argues that it doesn’t fit the edge model. The Workers runtime depends on more than just the JavaScript engine: DNS resolution, the Cloudflare cache, and other edge components all shape how a request is handled. A standalone runtime, without those pieces, can’t accurately represent production behavior. Rather than trying to package the entire edge onto a laptop, wrangler dev pushes code to Cloudflare and runs it there, keeping the quick iteration cycle developers expect from a local environment while maintaining high fidelity with production.

This mirrors the pattern of tools like Docker, which standardize environments across machines. But the complexity of Cloudflare’s edge, with its distributed dependencies, makes a different approach necessary. Running workloads on the actual edge avoids the maintenance burden of keeping a local simulation in sync with reality.

What wrangler dev provides

  • Live reloading: Save changes to your code and wrangler dev automatically detects them, pushing the updated version to the edge.
  • Terminal logs: console.log() output is delivered directly to your terminal, instead of requiring the Workers Preview browser window to stay open.
  • Cache API and KV: Because wrangler dev runs on the edge, you can exercise the Cache API and test cache.put() behavior without deploying. The command spins up a new KV namespace for development, isolating your work from production data.
  • Request metadata: request.cf properties — such as geo-location — are populated from real Cloudflare data centers.

wrangler dev is available in the latest version of Wrangler, Cloudflare’s official CLI for Workers.

Looking ahead

The company frames wrangler dev as a first step toward better developer visibility and agility on the platform. Upcoming work includes a testing framework for Workers and tools to observe Worker behavior in production.