[HN Gopher] Denoflare - develop, test, and deploy Cloudflare wor...
       ___________________________________________________________________
        
       Denoflare - develop, test, and deploy Cloudflare workers with Deno
        
       Author : e12e
       Score  : 79 points
       Date   : 2021-11-07 19:45 UTC (3 hours ago)
        
 (HTM) web link (denoflare.dev)
 (TXT) w3m dump (denoflare.dev)
        
       | bredren wrote:
       | Deno's company was planning to release something like this,
       | called Deno Deploy. (Not sure of the status of that product)
       | 
       | 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...
        
         | lucacasonato wrote:
         | Deno Deploy is in public beta right now:
         | https://deno.com/deploy
         | 
         | 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.
        
         | jacobwg wrote:
         | Not affiliated with Deno or Denoflare, but you can try Deno
         | Deploy today! See https://deno.com/deploy/. Here's a recent
         | status update from the blog: 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
         | 
         | [1] https://miniflare.dev/
         | 
         | [2] https://twitter.com/_mrbbot/status/1441143456106094595
        
           | latchkey wrote:
           | I switched from wrangler to miniflare for my stuff. Highly
           | recommend. Super easy...                 "dev": "yarn run
           | miniflare dist/worker.js --watch --debug --disable-updater",
        
           | eli wrote:
           | I thought "wrangler dev" ran locally with node and "wrangler
           | preview" ran in the cloud?
        
             | jacobwg wrote:
             | Perhaps 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/comma...
        
               | kentonv wrote:
               | That'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.
        
       | andrew_ wrote:
       | What I didn't see in the docs that would be of great interest is
       | benchmarks for Deno in Cloudflare workers versus vanilla Node.
        
         | samjmck wrote:
         | Cloudflare Workers aren't running Node or Deno though, they
         | just use the V8 runtime and implement a few web APIs (this is
         | oversimplified of course but you get what I mean)
        
       | z3t4 wrote:
       | What do you guys use Cloudflare Workers for ?
        
         | picardo wrote:
         | I built an API proxy using a CF Worker today. The deploy takes
         | only 2 seconds. Its speed is its killer feature.
        
         | tyingq wrote:
         | It's almost perfect for a url shortener, even with custom urls
         | if paired with the kv store. Trivial, I know, but go look at
         | what some people pay for these services.
        
         | latchkey wrote:
         | I run multiple physical data centers with thousands of
         | individual machines that operate autonomously. I proxy/cache
         | API hits to the Github API so that each machine can download a
         | small binary app that runs on each of them that works to ensure
         | each machine is operating as it should.
         | 
         | 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.
        
       ___________________________________________________________________
       (page generated 2021-11-07 23:00 UTC)