Another year of Dancing...

Welcome to the Dancer advent calendar, for the third year running! Previous year's calendars have been well received, let's hope this one can live up to them.

More and more dancers...

More and more people are using Dancer to power their sites - recent additions to the dancefloor include CrowdTilt, Daystack, eLibraryUSA (US Department of State), Maxi Tip, FreeBSD Monitor, Dancebin, The Anarchist Library and others. (Using Dancer, and happy to have your site featured? Let us know!)

Dancer2 - almost!

Dancer2 has been coming along well, and is already being used in production. We're at the point now it needs polish, documentation improvements and some migration guides, and it can hit CPAN! Dancer2 is a complete rewrite of Dancer's core, using much better designs, for better maintainability and extendability, whilst maintaining backwards compatibility with Dancer1's API - so migrating to Dancer 2 should be quite straightforward.

Expect further articles in the upcoming days with plenty more information on Dancer 2!

New features in Dancer

Most of our development effort has been going towards Dancer 2, Dancer 1 however has had many minor improvements and bugfixes, but a few more notable changes culled from the changelog:

  • Wallflower now shipped separately

    BooK's 'wallflower' tool for generating static websites has been removed from the Dancer distribution, and is now distributed separately as a more general-purpose tool under the name App::Wallflower.

  • dancer_response can take HTTP::Headers

    You can now pass a HTTP::Headers object to dancer_response

  • Dancer2 compatibility features in Dancer::Plugin

    Some new keywords are added to Dancer::Plugin to make writing plugins which can work on both Dancer and Dancer 2 a little easier. (There are a few minor differences in how plugins work in Dancer 2; expect an upcoming post on how to make a plugin compatible with both versions. Some of the more popular Dancer plugins have already been updated in readyness.)

  • new test function response_redirect_location_is

    Dancer::Test now provides a response_redirect_location_is, which does as the name would suggest - tests that the response to a request is a redirect to the expected location.

New Dancer plugins

The Dancer plugin ecosystem continues to grow, with several new Dancer plugins appearing in 2012:

  • Dancer::Plugin::Auth::Extensible

    User authentication and authorisation is a common requirement; we had the old RBAC plugin, but it was in need of some serious work to make it pleasant to use. In the end, I decided to rock up a new authentication framework plugin for Dancer, designed to be simple and easy to use, and also easy to extend to support various authentication sources. A full article on this will appear in the upcoming days.

  • Dancer::Plugin::DictionaryCheck

    A new plugin appearing just before this post went up, it's designed to make it easy to check a password to see if it is a dictionary word, to help stop users supplying insecure passwords.

  • Dancer::Plugin::CDN

    Provides URLs for static files including a content hash so that the URLs will change when the content changes, to deal with caching. Uses HTTP::CDN which can be configured to perform automatic minification/compiling of CSS/JS/LESS.

  • Dancer::Plugin::Res

    Provides syntactic sugar to easily set the response status and return a response in one go, rather than two steps.

  • Dancer::Plugin::I18N

    Provides internationalisation support for your Dancer apps, using Locale::Maketext::Simple.

  • Dancer::Plugin::EmptyGIF

    Allows you to easily respond with an empty GIF image, with the headers set appropriately. This is useful for tracking purposes, if you want to embed an IMG tag in your HTML to call a route with certain params; in the route, you can then do whatever logging/other actions you need, then simply return an empty GIF to the browser.

Dancer at LPW2012

Andrew Solomon ran a free two-hour training course at this year's London Perl Workshop - 13 people were registered to attend, but I haven't yet heard how many did attend. Andrew's course was a hands-on training session to develop a website with dynamic content using Dancer, during which the attendees would:

  • learn to use the Dancer framework
  • learn to use Template Toolkit
  • understand the concept of Model-View-Controller
  • experience structuring code for maintainability
  • experience using object oriented Perl modules

Dancer-powered documentation

James Aitken (LoonyPandora) gave a talk at LPW 2012 on Documentation For Fun and Profit highlighting why good high-level documentation is important, and what you can do to make it even more useful. He gave a sneak peak of the REST API documentation and test console we use at UK2 - more details on this should be coming in a future post.

Dancer IRC channel community grows

The community of helpful users on the Dancer IRC channel continues to grow! You can find us on irc.perl.org in #dancer - or irc://irc.perl.org/dancer if your system is configured to support irc:// links.

If you do not regularly use IRC but wish to join us, there is also a web IRC client available at http://dancer.pm/irc for ease of use.

At the time of writing, there are 98 people present in #dancer!

Dancer repository move

Dancer's GitHub repository has been moved to the PerlDancer organisation on GitHub, to make sharing management of the repository and distributing commit bits where needed far easier - the repository is now found at:

https://github.com/PerlDancer/Dancer

Dancer mailing list move

Some users were finding that their posts didn't always reach the old mailing list. The list has been moved to a new list server, with a new list posting address: dancer-users@dancer.pm. The old address redirects to the new list.

Conclusion

Well, this was a hastily-put-together look back at 2012; the following days will have various articles regarding Dancer which I hope will be of interest. Not all days are filled yet, so if you wish to write a post for the advent calendar, please contact me - all assistance would be greatly appreciated!

AUTHOR

David Precious (BIGPRESH)