5 ms·
Not affiliated with Deno or Denoflare, but you can try Deno Deploy today! See https://deno.com/deploy/ https://deno.com/deploy/. Here's a recent status update f
by jacobwg 5y ago
Not affiliated with Deno or Denoflare, but you can try Deno Deploy today! See https://deno.com/deploy/ https://deno.com/deploy/. Here's a recent status update from the blog: https://deno.com/blog/deploy-beta3/ https://deno.com/blog/deploy-beta3/
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].
[0] https://github.com/cloudflare/wrangler https://github.com/cloudflare/wrangler
[1] https://miniflare.dev/ https://miniflare.dev/
[2] https://twitter.com/_mrbbot/status/1441143456106094595 https://twitter.com/_mrbbot/status/1441143456106094595
- latchkey 5y agoI switched from wrangler to miniflare for my stuff. Highly recommend. Super easy... "dev": "yarn run miniflare dist/worker.js --watch --debug --disable-updater",
- eli 5y agoI thought “wrangler dev” ran locally with node and “wrangler preview” ran in the cloud?
- jacobwg 5y agoPerhaps it used to, but today `wrangler preview` previews your worker in the cloud using the "preview service", and `wrangler dev` uses a private tunnel to an edge node to serve local development requests [0]. Neither of them use Node. > 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/commands#dev https://developers.cloudflare.com/workers/cli-wrangler/comma...
- kentonv 5y agoThat's correct, and it has always worked that way. Wrangler has never used Node to run Workers. Miniflare is the tool that runs locally with Node.
- eli 5y agoThanks!
- eli 5y agoAh that's right. I was misremembering; it was the jest test suite that ran with node and had to contend with differences between node and Workers' V8 engine. I don't suppose anyone's come up with anything better?
- nathancahill 5y agoMiniflare is an amazing piece of software, I'm so glad Cloudflare is taking an official role with it.