Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 28, 2020

Conversation

meeroslav
Copy link
Collaborator

  • Included in the PR: routes comparison function for state$ observable to reduce the overflow of events caused by d4bc65d

@meeroslav meeroslav added this to In progress in 0.4.0 release Dec 2, 2020
@brandonroberts
Copy link
Collaborator

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
Copy link
Collaborator Author

meeroslav commented Dec 21, 2020

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
Copy link
Collaborator Author

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

@brandonroberts brandonroberts merged commit d34dfc0 into master Dec 28, 2020
0.4.0 release automation moved this from In progress to Done Dec 28, 2020
@brandonroberts brandonroberts deleted the f/internal-path-parsing branch December 28, 2020 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants