Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you talk more about this… I was under the impression that was the EXPLICIT reason [1] why it was added in the first place or did I misread your comment?

It’s also something the Lit team uses like here: https://www.npmjs.com/package/@lit-labs/router

I think maybe we are just debating the data structure the hold the patterns? Like it should be a trie rather than say a Set or Map.

[1] https://developer.chrome.com/docs/web-platform/urlpattern





Hono for example has a RegExpRouter and a TrieRouter, both of which seek for a matching route from amid multiple options. URL Patterns, plural!

They also have a linear search router, which they even say could have wins in some cases. But for relatively complex apps, with lots of possible sub-routes, the idea of running theonesr search feels so bad to me.

https://hono.dev/docs/concepts/routers




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: