Settings

Theme

New URLPattern API brings improved pattern matching to Node.js and Workers

blog.cloudflare.com

4 points by rita3ko a year ago · 1 comment

Reader

jauntywundrkind a year ago

Really good news. Being able to parse a URL really deserves to be an available capability.

Still, I can't help but hear a lot of the feel about URLPattern echoing through my head. It's super un-ideal a match for webs services, which often have many routes to match! It only passes a single URL!

Ideally there would be an API to register a bunch of urls, and then say, which if any does this match? That would open the door to smarter matching, to an engine that can work on all routes at once, rather than having to re-match route by route. Its how all fast routers work! https://hono.dev/docs/concepts/benchmarks

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection