RFC: Include custom url matcher in filesystem routing #1452
DevWedeloper
started this conversation in
Ideas
Replies: 1 comment
-
I think manually defining an additional route that uses a custom matcher would work better for this use case. Using regex for a filesystem-based route seems like it would get confusing fast. We added support for providing extra routes here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Which scope/s are relevant/related to the feature request?
router
Information
This RFC proposes adding support for Custom URL Matchers within the existing filesystem-based routing of Analog. This feature would allow developers to define custom logic for URL pattern matching directly within
.page.ts
files, enabling more flexible and complex routing patterns.Proposed Implementation:
$
) in.page.ts
filenames to signify that the file contains a custom URL matcher.[$example].page.ts
would indicate that this route uses a custom matcher instead of relying on standard static or dynamic routing..page.ts
:Developers would define a custom matcher function, similar to Angular’s UrlMatcher. This function would return a UrlMatchResult if the URL matches the defined logic.
Example:
Describe any alternatives/workarounds you're currently using
I'm using the provideRouter along with provideFileRouter
I would be willing to submit a PR to fix this issue
Beta Was this translation helpful? Give feedback.
All reactions