[dancer-users] Dancer2 0.300000 Released

Jason Crome cromedome at gmail.com
Tue Dec 24 06:15:19 GMT 2019


The Dancer Core Team has one more holiday treat in store for you: Dancer2 0.300000 is headed to CPAN, and it's a good one: Dancer now offers typed route parameters!

To be clear, all of the existing route syntax is unaffected. You don't have to use types, and typed parameters might not be good for all situations. There is a lot to be gained from having them though, and we're excited to bring them to you!

Using them in your own code is simple:

    get '/thing/:id[Int]' => sub {};

    # if not Int then perhaps a Num...
    get '/thing/:id[Num]' => sub {};

The default type checking library is Type::Tiny, but you can also specify your own type checking library too. See the manual for more information.

A big thanks to SysPete for making this long-standing request a reality.

I'd also like to apologize to Tom Hukins. I erroneously listed a PR of his in the last release that didn't seem to make it in. I believe that I have made things better in this release.

Happy holidays from your friends at Dancer! See you in 2020.

Jason A. Crome / CromeDome
CPAN: https://metacpan.org/author/CROMEDOME
github: https://github.com/cromedome
Twitter: https://twitter.com/cromedome






More information about the dancer-users mailing list