Live data from Hacker News

Miniflare – Local simulator for developing and testing Cloudflare Workers

github.com

1–10 of 30 posts

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#2
Oh awesome. Cloudflare Workers dev environment leaves something to be desired. Does this run in the same JS engine Cloudflare uses (V8 Chrome)? The particular subset of web standards that Cloudflare supports can be tricky to work around.

Is there any support for emulating the CPU runtime limitations that Cloudflare imposes (10ms or 50ms for paid plans)?

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#3

Oh awesome. Cloudflare Workers dev environment leaves something to be desired. Does this run in the same JS engine Cloudflare uses (V8 Chrome)? The particular subset of web standards that Cloudflare supports can be tricky to work around. Is there any support for emulating the CPU runtime limitations that Cloudflare imposes (10ms or 50ms for paid plans)?

As someone who's looking into workers, what problems do you experience when developing workers?

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#5

Oh awesome. Cloudflare Workers dev environment leaves something to be desired. Does this run in the same JS engine Cloudflare uses (V8 Chrome)? The particular subset of web standards that Cloudflare supports can be tricky to work around. Is there any support for emulating the CPU runtime limitations that Cloudflare imposes (10ms or 50ms for paid plans)?

As someone who's looking into workers, what problems do you experience when developing workers?

See the docs here for a better description than I can write: https://developers.cloudflare.com/workers/cli-wrangler/comma...

Basically your dev environment runs in the cloud on Cloudflare, then opens a mini browser - within your browser - (with it's own dev tools) for you to send HTTP requests to the dev environment.

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#6

Oh awesome. Cloudflare Workers dev environment leaves something to be desired. Does this run in the same JS engine Cloudflare uses (V8 Chrome)? The particular subset of web standards that Cloudflare supports can be tricky to work around. Is there any support for emulating the CPU runtime limitations that Cloudflare imposes (10ms or 50ms for paid plans)?

Miniflare author here. Miniflare uses the Node VM module (https://nodejs.org/api/vm.html#vm_class_vm_script) which is slightly higher level than V8 isolates used by Cloudflare Workers, but the same underlying engine.

Without low level isolate support in Node, it would be difficult to emulate CPU time limitations. Miniflare will report how long requests take, but this includes I/O time.

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#7
Nice - I love Cloudflare Workers but hate that debugging eventually breaks down to a lot of copy & paste and editing in their lackluster "IDE".

Was this built by someone at Cloudflare? If not, I hope they work there very soon and can turn this into a part of the Workers ecosystem

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#8
its a welcome addition to the cf worker ecosystem especially because of the features that are missing in most alternatives. however deno would lend itself much better to running cf workers locally and also i feel after the 4th cf workers testing environment it would be time to focus not on "simulation" or local testing but to start projects with the goal of being a compatible production ready implementation. such a project could be used for local testing and also for creating cf worker compatible services like deno deploy or just a compatible docker container that runs in your datacenter as an alternative to a nodejs express server, the possibilities are endless.

Re: Miniflare – Local simulator for developing and testing Cloudflare Workers

#10

its a welcome addition to the cf worker ecosystem especially because of the features that are missing in most alternatives. however deno would lend itself much better to running cf workers locally and also i feel after the 4th cf workers testing environment it would be time to focus not on "simulation" or local testing but to start projects with the goal of being a compatible production ready implementation. such a p…

> however deno would lend itself much better to running cf workers locally

What would be the reason for this?

Post reply on HN