You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First let me start by expressing my thanks for the time and effort spent creating bidi. We use enjoy bidi as part of our routing.
There is something I came to notice about route matching which I think that could be improved. Often one will have to create routes with an optional param like a page postfix so that paths such as "/foo" and "/foo/page-2" are recognised.
As far as I understand this can be achieved like so:
However, since there is support for regex I tried to write a more compact version by using non-capturing groups to exclude irrelevant parts such "/page-" like so:
I'm not sure if it's worth the effort but such a change might be helpful in reducing certain redundancies when defining routes with optional path-params. What do you think?
Regards,
Roman
The text was updated successfully, but these errors were encountered:
Hello,
First let me start by expressing my thanks for the time and effort spent creating bidi. We
useenjoy bidi as part of our routing.There is something I came to notice about route matching which I think that could be improved. Often one will have to create routes with an optional param like a page postfix so that paths such as "/foo" and "/foo/page-2" are recognised.
As far as I understand this can be achieved like so:
Without page:
With page:
Both combined:
However, since there is support for regex I tried to write a more compact version by using non-capturing groups to exclude irrelevant parts such "/page-" like so:
Apparently the capturing and non-capturing groups are ignored. What I was hoping for was something like the previous result:
I'm not sure if it's worth the effort but such a change might be helpful in reducing certain redundancies when defining routes with optional path-params. What do you think?
Regards,
Roman
The text was updated successfully, but these errors were encountered: