itty-router
itty-router copied to clipboard
Feedbdack on deprecation of router.handle
All the documentation everywhere on the Internet has router.handle
I spent an entire day trying to diagnose why my itty stuff wasn't working.
Eventually by chance I saw in the release notes:
router.fetch replaces router.handle
I don't know what can be done about this if anything but it sure cost me alot of time.
Yeah, sorry about that - we should probably make that change more in-your-face, since the low-byte nature of itty means there are no nice error messages or catches to guide users that slipped up or didn't catch the memo!
The Backstory
v0-v3 started with "handle" because that (still) makes more sense to me as it "handles" requests, but as more environments started settling on an exported "fetch" method (e.g. Workers, Bun, etc), v4 wasted the extra bytes to support both "fetch" and "handle"... and we reclaimed those bytes with the rest of the breaking changes in v5 by dropping legacy support for handle.
I understand, though breaking all the documentation for itty everywhere on the internet seems a fairly high price for those bytes.
shit bro!!!! I am using Deno and want to deploy it to Cloudflare Workers. I can receive network requests using router.handle, but I cannot return a response. When I use router.fetch, it can return a response normally.This process wasted me 3 hours!!!!
same happened to me