Denoflare – develop, test, and deploy Cloudflare workers with Deno
denoflare.dev
denoflare.dev
Ryan talked about it one hour in to the changelog interview published in June.
How is Denoflare compare / contrast with that?
[1] 1:00:00 @ https://podcasts.apple.com/us/podcast/the-changelog-software...
Denoflare is a way to run Cloudflare Workers locally, so not something that directly compares to Deno Deploy, which is a product used to run your code globally close to users.
Denoflare looks like a way to develop Cloudflare Workers locally, possibly as an alternative to Cloudflare's Wrangler CLI [0]. The Wrangler CLI has `wrangler dev` that serves a similar purpose by actually uploading local code to Cloudflare to run in the "real" Workers environment. Denoflare instead emulates it locally using Deno, given that both Workers and Deno provide Web Platform APIs.
There's also Miniflare [1], which emulates a large portion of the Cloudflare Workers runtime and adjacent services like Durable Objects and the Key/Value store locally. Miniflare was recently promoted to an official Cloudflare Workers project [2].
"dev": "yarn run miniflare dist/worker.js --watch --debug --disable-updater",> wrangler dev is a command that establishes a connection between localhost and an edge server that operates your Worker in development. A cloudflared tunnel forwards all requests to the edge server, which continuously updates as your Worker code changes. This allows full access to Workers KV, Durable Objects, etc. This is a great way to easily test your Worker while developing.
[0] https://developers.cloudflare.com/workers/cli-wrangler/comma...
It is a whole self-upgrade process that involves using Github CI to do the binary build on commit (and run the unit tests, of course) to produce a new version.
The app (running on each box) periodically queries a versions file stored in git (also proxied through a worker) so they know which build to download. I can segment versions of the app across CIDR so that I can do channel (alpha/beta/stable) based releases for testing.
It is a pretty epic solution since the workers only cost $5/month and totally saves my bacon with just a small bit of simple code.
$5 is minimum monthly payment.
They also have a free plan with 100,000 requests per day.
With denoflare, you can serve your Cloudflare Worker script locally and deploy it to Cloudflare with a single tool, without the need for Wrangler, Node, NPM, or a separate bundler.
Also makes writing/deploying ESM-module-based workers trivial - can even deploy a CF Worker to your own account from a URL, e.g. [1]
[1] denoflare push --name webtail https://raw.githubusercontent.com/skymethod/denoflare/v0.3.0...
Developing the worker in Deno brings you the benefit of first-class support for typescript and ESM-modules in your worker, and no need for Node polyfills.
Once you deploy your worker, it runs like any other javascript worker on the magical Cloudflare V8 worker runtime.