angular-component / router

Angular Component Router - A declarative router for Angular applications
MIT License
253 stars 16 forks source link

feat(router): replace path-to-regexp with internal matcher. resolves #58 #64

Closed meeroslav closed 3 years ago

meeroslav commented 3 years ago
brandonroberts commented 3 years ago

We don't currently adding a matcher as part of the route component, but if we did, would the custom matcher also have to return the matchRoute signature?

meeroslav commented 3 years ago

Any custom regex matcher will return RouteMatch | undefined when used in the matchRoute function.

It's just mapping the param names taken from the URL definition onto the result of the regex match.

The only "problem" I've seen while testing custom matchers was when the URL did not specify params (e.g. /:something) but regex did. In this case, param names could not be parsed. But the same issue exists with path-to-regex.

This is solvable, of course, but i's a corner case that might never be hit.

meeroslav commented 3 years ago

Hi, is there anything left to be added to this PR?