Ben Kelly

Results 228 comments of Ben Kelly

I believe you can `JSON.stringify(urlpattern)` and then `new URLPattern(JSON.parse(stringified))`. Basically the URLPattern has the same form as the URLPatternInit dictionary, so if you can serialize it as an object it...

Right, URLPattern is not very useful for filtering on specific query parameters because of the ordering issue. We could enahance the API to better support this, but right now its...

Yea, seems like a real problem to me. I'm not sure when I will have the bandwidth to look at this, though. Do you have a proposed fix?

This is working as intended. For pathname patterns the path-to-regexp `prefix` [option](https://github.com/pillarjs/path-to-regexp#path-to-regexp-1) is effectively set to `/`. This means that a `/` preceding a group is considered to be a...

I think it comes down to which is the more common scenario we optimize for: 1. An in-fix optional group where we want to avoid doubled-slashes like `/foo/:hmm?/bar` 2. Or...

> But I'm saying you can have both. This would be a pretty big processing model change. There is no concept in the spec of looking at future characters to...

> But this is still an experimental API, isn't it? And as such, it would be fine if it changes. Every change is a tradeoff and requires balancing different stakeholder...

Yes, it is possible to change things to make this kind of behavior work. I wasn't trying to say its impossible. But it does seem like a big conceptual change...

Re-opened per Andrew's last comment.

Sure. This original issue is a holdover from the original explainer that proposed a service worker enhancement together with URLPattern. Maybe this issue should be ported over to the service...