kwhitley / itty-router

A little router.
MIT License
1.79k stars 78 forks source link

Different structure for the router #40

Closed taralx closed 3 years ago

taralx commented 3 years ago

As noted in Discord, I have a different way of constructing the Router that is much faster and smaller: https://github.com/taralx/itty-router/blob/v2.x/src/itty-router.js

I note that uglifyjs saves a few more bytes, and I'm working on some more hackery to spin off a few more bytes. I'm not PRing this yet, but feel free to take what works for you. :)

mvasigh commented 3 years ago

This looks neat! Easier to read too despite the smaller code size.

kwhitley commented 3 years ago

I'll wait for a PR unless you sit on this too long - I want you to have the lines/contrib credit! Looks pretty sick though, def stoked to have this!

kwhitley commented 3 years ago

Did some trials with your fork in #41 with some continued discussion points - but either way, I absolutely love that someone's finally taking a crack at golfing this further!!! 🥳

Now if we could just get those 4 regex passes down a bit...

taralx commented 3 years ago

Closing in favor of PR #42.