7 ms·
Miniflare – Simulator for developing and testing Cloudflare Workers
- pier25 5y agoThis is great because quite frankly wrangler dev is just terrible. I've had nothing but problems with it.
- jgrahamc 5y agoWhat problems have you had?
- pier25 5y ago- Incomprehensible errors. Like you have a undefined var and the worker just breaks and doesn't tell you what's happening. - Terrible console.log() messages. I had to resort to using JSON.stringify for anything other than primitive values. - Timeout errors when using wrangler dev on workers that work perfectly when deployed. - Wrangler dev just crashing frequently or being super slow at reloading the worker.
- threepointone 5y agoErrors - We're getting better at this. You can now use `--inspect` and use chrome devtools which should log proper exceptions (details to setup https://blog.cloudflare.com/profiling-your-workers-with-wrangler/ https://blog.cloudflare.com/profiling-your-workers-with-wran...) Console.logs - same as above! Real devtools, interactive and everything. Timeouts and crashes - This should be better now, timeouts and sessions expires now transparently heal and restart, so you shouldn't face errors (Please file an issue if you see different!) Overall we're working hard on making this experience better, please feel free to file issues if you see anything that's not expected. Thank you!
- greyivy 5y agoNo kidding. Wrangler was so bad I stopped using Workers altogether.
- thegagne 5y agoIt’s gotten better. Wrangler tail works consistently now.
- threepointone 5y agoYeah, we recently made improvements so `wrangler tail` works without falling over, and we also show logs directly in the dashboard now (https://blog.cloudflare.com/introducing-workers-dashboard-logs/ https://blog.cloudflare.com/introducing-workers-dashboard-lo...) More improvements coming, I promise.
- threepointone 5y agoThat bad, huh :( But I hear you. I'm working on making this better right now, I'd be happy to hear any complaints you have, and I hope we can get you back.
- greyivy 5y agoI'd love to help but it's been so long that I don't remember what exactly it was I was struggling with. Thanks for the offer, though!
- pier25 5y agoSame... I'm only using Workers for a very specific use case but otherwise I just prefer developing for any other serverless platform. Workers are great once they are deployed, but the DX is abismal...
- maxencecornet 5y agoI find wrangler really decent to work with, it's pretty minimalist but does everything I need What kind of issues did you have ?
- threepointone 5y agoHi there! I'm on the team, and we're going to invest a bunch of time and effort on making this experience much better. Happy to hear any specific feedback if you'd like, and I'll prioritise it. Feel free to reply here, or DM me on twitter @threepointone. Stay tuned, things should get better soon.
- protoduction 5y agoWhat I constantly ran into was disconnecting from the server I was connected to and wrangler not being able to handle that. At the time I had a somewhat spotty connection (nothing terrible), but it made wrangler dev very painful - so much so that I ended up writing my own node.js wrapper around it for local development. The lock-in to webpack also isn't great when I am nowadays accustomed to esbuild which is so much faster. Happy to see miniflare now :)
- threepointone 5y agoOhhh I remember this too, I hated how it consistently dropped connections. A community member fixed this for us (here https://github.com/cloudflare/wrangler/pull/2008 https://github.com/cloudflare/wrangler/pull/2008) so that it transparently and automatically reconnects now and the experience has gotten so much better. And of course, miniflare reduces even the chance of that to zero :)
- threepointone 5y agoWe also don't have a lockin to webpack anymore (you can choose custom builds with the "javascript" type, which I admit is a little confusing). We're going to move away from even this dependency and make everything much faster and lighter, stay tuned.
- yewenjie 5y agoMaking the esbuild based starter the default one in the docs will be much more helpful.
- k__ 5y agoI use CFW with Pulumi, but it doesn't offer local dev.
- jasongill 5y agoHooray, my dream came true: https://news.ycombinator.com/item?id=27748154 https://news.ycombinator.com/item?id=27748154
- jdcaron 5y agoI'm very happy about this, an official support to run Workers locally. I invested some of my personal time to get this tool, I submitted a patch on a community project (since Cloudflare wasn't officially supporting this). I think it was a very important missing piece for me to consider Workers a serious development tool. https://github.com/gja/cloudflare-worker-local/commit/ce600442247e6914cebd5900a7f008b74f9b921a https://github.com/gja/cloudflare-worker-local/commit/ce6004...
- asimpletune 5y agoWow, if I understand this correctly... this was posted on HN this morning, and by the afternoon it's already in the official cloudflare GH org? That reflects extremely well both on this repo as well as cloudflare.
- jorams 5y agoIt was first posted on HN 3 months ago[1], and moved to the cloudflare org a day ago[2]. [1]: https://news.ycombinator.com/item?id=27736706 https://news.ycombinator.com/item?id=27736706 [2]: https://twitter.com/_mrbbot/status/1441143456106094595 https://twitter.com/_mrbbot/status/1441143456106094595
- threepointone 5y agoFun fact, that post 3 months ago was what got us folks at cloudflare in touch with the author, who then interned with us for 2 months (today was his last day!)