https://web.dev/blog/baseline-urlpattern
#urls #apis #javascript #webplatform #browsers
https://web.dev/blog/baseline-urlpattern
#urls #apis #javascript #webplatform #browsers
web.dev/blog/baselin...
web.dev/blog/baselin...
WHATWGで定義されているAPIだが、WinterTC Minimum Common APIにも含まれている "New URLPattern API brings improved pattern matching to Node.js and Cloudflare Workers" https://blog.cloudflare.com/improving-web-standards-urlpattern/ #nodejs
WHATWGで定義されているAPIだが、WinterTC Minimum Common APIにも含まれている "New URLPattern API brings improved pattern matching to Node.js and Cloudflare Workers" https://blog.cloudflare.com/improving-web-standards-urlpattern/ #nodejs
The only problem is it's slow to match URLs against a large set of patterns by linearly scanning.
So I just made url-pattern-list: a utility that parses patterns into a efficient prefix-tree for 2-30x faster matching! 😲
www.npmjs.com/package/url-...
The only problem is it's slow to match URLs against a large set of patterns by linearly scanning.
So I just made url-pattern-list: a utility that parses patterns into a efficient prefix-tree for 2-30x faster matching! 😲
www.npmjs.com/package/url-...
🚧 Routing with URLPattern
🔍 Easier debugging with helpful error messages
🕸️ Browser request support (relative URLs, CORS)
Read more:
humanwhocodes.com/blog/2025/01...
🚧 Routing with URLPattern
🔍 Easier debugging with helpful error messages
🕸️ Browser request support (relative URLs, CORS)
Read more:
humanwhocodes.com/blog/2025/01...
developer.mozilla.org/en-US/docs/...
nodejs.org/en/blog/rel...
developer.mozilla.org/en-US/docs/...
nodejs.org/en/blog/rel...
URLPattern is now Baseline Newly available | Blog | web.dev
https://web.dev/blog/baseline-urlpattern
URLPattern is now Baseline Newly available | Blog | web.dev
https://web.dev/blog/baseline-urlpattern
Routes only need to export a string with the desired url params. The route function will then have them in the ctx
I also set up a thing for middleware. Individual routes have full control over the order
#javascript #buildinpublic #backend #webdev
Routes only need to export a string with the desired url params. The route function will then have them in the ctx
I also set up a thing for middleware. Individual routes have full control over the order
#javascript #buildinpublic #backend #webdev
github.com/ada-url/ada/...
github.com/ada-url/ada/...
This one is another great addition I'd use instead of custom code.
This one is another great addition I'd use instead of custom code.
@biomejs.dev v2.0 beta - with plugins, and linting++
@valibot.dev v1.0 - a 1kB schema library
@trpc.io v11 - with streaming responses & React Server Components
URLPattern API in @nodejs.org - for improved pattern matching
Which one are you most excited about?
@biomejs.dev v2.0 beta - with plugins, and linting++
@valibot.dev v1.0 - a 1kB schema library
@trpc.io v11 - with streaming responses & React Server Components
URLPattern API in @nodejs.org - for improved pattern matching
Which one are you most excited about?
```
# urls.py
def get_urlpatterns() -> Iterable[URLPattern]:
...
```
```
# urls.py
def get_urlpatterns() -> Iterable[URLPattern]:
...
```
I do backtracking in this impl and have the opportunity to do some ReDoS mitigation. At the very least I can limit the total amount of backtracking allowed per match, but I'd like to match what native URLPattern does.
I need to learn a lot more about this though!
I do backtracking in this impl and have the opportunity to do some ReDoS mitigation. At the very least I can limit the total amount of backtracking allowed per match, but I'd like to match what native URLPattern does.
I need to learn a lot more about this though!