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

:all and :any not working properly. #17

Open
madc opened this issue Apr 25, 2017 · 4 comments
Open

:all and :any not working properly. #17

madc opened this issue Apr 25, 2017 · 4 comments
Labels

Comments

@madc
Copy link

madc commented Apr 25, 2017

This is a known bug. After consulting the author, we found out that /unternehmen/{slug:segments} works as a workaround.

On slack, @SahAssar wrote: "I'm planning to rewrite it to use common regexes instead, I never understood why it tries to define it's own DSL just for redirects"

@mikerockett
Copy link
Contributor

The DSL was influenced by a routing library I'd seen when I originally wrote the package. The purpose was simple: an easy to understand syntax for those who don't know regex well enough. As most redirects these days are slug-based (source and destination), I'd now recommend FastRoute as a handler - it provides the combination of simplicity and specificity.

@SvanteRichter
Copy link
Contributor

@mikerockett I see... My plan was to simplify it (implementation wise) to use regexes and then provide a "cookbook" of common regexes/redirects in a doc/wiki/readme to help people not used to regex. If you want to keep the syntax simple and readable perhaps we can simply prepend/append routes to the normal symfony/silex routing and provide a common controller endpoint to actually handle the actual redirect. The current approach feels a bit NIH to me (no offense intended). FastRoute looks great, but since bolt already ships with a routing lib it's probably easiest to just use that, no?

@mikerockett
Copy link
Contributor

Of course, no offense taken. Tbh, it was designed this way (implementation) as I had no clue how to work with the various routing packages available, even the Symfony one, but have come a long way since then. Additionally, thought it would have been a nice idea to build it from scratch and keep the package small. Only recommending FastRoute because of the syntax. Also, it's so ridiculously fast that it shouldn't really mean anything to include it. I'm using it in Jumplinks 2 for ProcessWire, and there are already some significant speed gains when there are a lot of redirects.

End of the day: I handed this over to you, so please feel free to do as you deem fit - you probably know what Bolt users want more than I do.

@madc
Copy link
Author

madc commented Apr 28, 2017

As said in #18, this extension is mainly for developers, so with a well enough documentation, regex gives you the most flexibility. Maybe an additional default wildcard (*) would be cool tough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants