Looking back on 2011

Firstly, a big welcome to the 2011 Dancer advent calendar - last year's advent calendar was successful and well-received, hopefully this year's will be even better. You can look forward to a series of posts on getting the most from Dancer and what's happened in 2011.

So, let's start by taking a look back on 2011 and see what's new in the Dancer world.

Dancer workshop at LPW2011

Andrew Solomon presented a hands-on training session at this year's London Perl Workshop entitled "Web development for beginners with Dancer".

The workshop was popular and well received, with 20 registered attendees.

A full writeup will follow later in the calendar :)

Dancer ecosystem better than ever

Currently, the Dancer repository on GitHub has 378 watchers and has been forked 116 times!

The number of individual contributors according to GitHub is 70 - great to see such a vibrant and helpful community springing up around Dancer. Speaking of the community, our IRC channel has 87 people present at the time of writing, with many helpful volunteers providing valuable assistance.

More and more Dancer-powered sites are being added to the Dancefloor (Websites using Dancer) page.

Many more plugins to make life easy

Many more valuable and useful plugins have been released - a search on MetaCPAN for Dancer::Plugin:: gives 73 results.

Later advent calendar posts will showcase some of the useful plugins which can make your life easier :)

Better Unicode support - it should Just Work

Unicode support has been extended and corrected, with some helpful guidance from Mike Whitaker (Penfold). With charset: UTF-8 in your application's config, using Unicode should Just Work. If you're using Dancer::Plugin::Database, that setting will also cause UTF-8 support in your database engine to be automatically enabled (for MySQL, Postgres or SQLite), so unicode strings fetched from the database should need no special handling.

Support for HTTP PATCH

The HTTP 'PATCH' verb is defined in RFC 5789, allowing clients to perform a partial resource modification, and is slowly being adopted by RESTful APIs etc - GitHub's V3 API being one such example.

Dancer now supports PATCH requests.

One caveat is that it won't work in standalone mode until HTTP::Server::Simple has been updated to recognise PATCH requests. A pull request addressing this has been submitted, but, at the time of writing, has not been merged:

https://github.com/bestpractical/http-server-simple/pull/2

Get hooked!

Support for hooks, both defined by Dancer itself and additional hooks registered by your app or plugins, to make it possible to customise how Dancer behaves easily.

Configurable XML serialising

Options can now be passed to control serialisation to XML via XML::Simple.

send_file can send data from a scalar and set filename

The send_file keyword can now be used to send data from a scalar and set the Content-Disposition header to suggest a filename, for example:

send_file \$img_data, { filename => 'myimage.png' };

send_file supports streaming

The send_file keyword now supports PSGI streaming, with callbacks to control what happens.

Exceptions

The exceptional Damien Krotkine has added a continuations-style exceptions system to provide much more powerful error handling.

behind_proxy setting

The behind_proxy setting tells Dancer that it is deployed behind a proxy, causing it to honour the X_FORWARDED_PROTOCOL, X_FORWARDED_HOST etc env vars.

And, of course, many more improvements and bug fixes - thanks to the awesome community.