kwhitley / itty-router

A little router.
MIT License
1.69k stars 77 forks source link

Feedbdack on deprecation of router.handle #245

Open bootrino opened 1 month ago

bootrino commented 1 month ago

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.

kwhitley commented 1 month ago

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.

bootrino commented 1 month ago

I understand, though breaking all the documentation for itty everywhere on the internet seems a fairly high price for those bytes.