Roda 3.97.0 Released #402
jeremyevans
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Roda 3.97.0 has been released!
New Features
A map_matcher plugin has been added, for matching the next segment
in the request path to a hash key, yielding the hash value. This
allows for a better approach for metaprogramming routes.
When dealing with many similar routes, it is common to use a hash
keyed by route segment, and then match against an array of the keys:
For large maps, this approach is suboptimal, since the array matcher
will iterate over each element in the array, checking whether it
matches.
The map_matcher plugin allows for:
This gets the next route segment and checks whether it is a key in
the map, instead of iterating over an array of hash keys, so it is
more efficient for large maps. It also results in simpler code.
Thanks,
Jeremy
Beta Was this translation helpful? Give feedback.
All reactions