For our latest project we need to escape parenthesis since they occur in the URLs (which is uncommon but valid). This PR is based on this old one (#2533 by @Zoxive) which has been closed since at some point in time you wanted to refactor the URL matching into a separate module - unfortunately that has not happened yet so it would be very nice if the PR would make it this time.
Adding support for escaped parentheses in Route Paths
As far as I can see Router v4 can handle escaped parenthesis by delegating the matching mechanism to this module: https://github.com/pillarjs/path-to-regexp
Is it something desirable for v3 as well? I could work on a PR that uses that module instead of having a custom implementation? Are there any barriers that I don't see right now?
I believe that using path-to-regexp in v3 may actually break some existing apps that use our custom path syntax. I'm not opposed to merging this into v3. Looks like you've got some decent tests around it too.
Ok didn't know that path-to-regexpwould break stuff. Would be lovely if the PR could make it in the next release. If you need anything - I'm glad to help.
Changing something like that would require a major version bump. And the next major is already reserved 😉
Why would the change require a major version bump? Did I change a public API that behaves different now?
No no, I mean if we switched out matchPattern for path-to-regexp in 3.0.
I think we can merge this and ship a patch release of 3.0 with it
Yeah, it LGTM too.
I'll package this up as 3.0.1 soon. There's some other outstanding bug fixes to push out too.
Uhh thanks a lot <3