Greedy routes aren't that common and the way it is currently implemented degrades the performance of the router if they are enabled (since it loops through all the routes even if it already matched another route) so it makes sense to remove this feature or at least disable it by default (crossroads.greedyEnabled = false).
I feel that greedy routes makes the router logic more complex than needed and I can't remember the last time I needed this feature on a real app. I feel that "chaining" multiple routers is more than enough in most cases and also a better approach:
The only problem on removing this feature is that I think some people are using it (based on #46 and a couple other comments). Maybe this should be a change for v1.0.0 since it's a breaking change. Will probably wait a few weeks to think about it better and wait for feedback... Maybe do the changes on a separate branch to check if it will really reduce complexity.
Greedy routes aren't that common and the way it is currently implemented degrades the performance of the router if they are enabled (since it loops through all the routes even if it already matched another route) so it makes sense to remove this feature or at least disable it by default (
crossroads.greedyEnabled = false
).I feel that greedy routes makes the router logic more complex than needed and I can't remember the last time I needed this feature on a real app. I feel that "chaining" multiple routers is more than enough in most cases and also a better approach:
The only problem on removing this feature is that I think some people are using it (based on #46 and a couple other comments). Maybe this should be a change for v1.0.0 since it's a breaking change. Will probably wait a few weeks to think about it better and wait for feedback... Maybe do the changes on a separate branch to check if it will really reduce complexity.