unjs/rou3

URL pattern support

Closed this issue · 1 comments

pi0 commented

Investigating URL Pattern API compatibility.

There are different goals for a fast route matcher (radix3) and a general purpose URL pattern matching standard. I still think we might somehow make a compatibility layer to convert the URL pattern to radix3. Additional regex checks (after fast initial phase) can be applied using the URLPattern class api.

aquapi commented

The only reasonable URL patterns are wildcards and URL parameters, which we can basically implement with a radix tree. RegExp is not fast, and it may decreases performance on other runtimes as well (especially Bun because for some reason JSC has really bad RegExp implementation).