Dancer 1.2 - a micro web framework milestone

Dancer?

Dancer is a micro web framework that allows you to get a website up and running within a minute, if not sooner. It abstracts away a lot of nastiness that exists in web programming and lets you focus just on the important details, without compromising on control and strength.

The inspiration for Dancer is the Ruby micro web framework Sinatra, which we started to port and since then started diverging from Sinatra to our own path.

It supports Plack/PSGI so you can enjoy the new modern Perl world, but it also supports an internal web server to allow you to rapidly develop your web application without setting up a web server.

The following synopsis shows just how strong and yet simple Dancer really is:

get '/view/user/:id' => sub {
    my $id      = params->{'id'};
    my $details = database->selectrow_hashref(
        'select * from users where id=?', undef, params->{id}
    );
    template user => { user => $details };
};

This shows off an HTTP GET request route with a variable in it which is attached to an anonymous subroutine which gets the ID, performs a simple database query (using Dancer::Plugin::Database) and passes the data to a template to render the resulting page.

It really is that simple!

If you like this, you should check out the Dancer website and documentation for more information on what Dancer can do to ease your web programming pain and leaving you with the fun, interesting parts.

Dancer 1.2 is finally out

We've been speaking our heads off on the 1.2 release of Dancer for a while now. Why are we so excited, you ask? Well, for a few reasons!

The community blossomed

The Dancer community has grown with time and provided a nice warm place for people to raise questions, ideas and create things together. Version 1.2 presents a culmination of the communal work of a very large number of people, all from the community, in a wide variety of areas from documentation, bug tracing, bug fixes, features and even design.

Therefore this release is dedicated to the Dancer community itself!

UTF-8 FTW!

One of the issues the community stressed is having Unicode support, and we've decided it was about time to implement it fully.

Unicode support isn't as trivial as it sounds, though. You have to support it in the core of the framework for parameter and environment parsing, in the different template engines (and Dancer has quite a few) and all around.

So now we have that! It's also on by default for you!

Use the docs, Luke!

If you like reading documentation (and who doesn't, really?), we made a lot of improvements to the docs. We've added a lot and changed quite a bit to make it clearer.

While it still isn't perfect, it's a great place to start and you'll be able to understand more and more core layers of Dancer, and it will even give you a heads up if you feel like playing with the core, adding a feature, fixing a bug or simply better understand how Dancer works.

All Dancer's features and keywords are documented; we also have a tutorial, a cookbook for those who prefer to see short examples of how to achieve common tasks, and full in-depth examples too.

Stable solid foundations

Users should always be able to trust Dancer to be stable. We've put countless hours into fixing bugs and improving the quality to ensure that now, more than ever, Dancer is a solid foundation you can depend upon.

While some of this work went into code, a major part went as well to documenting the code and writing plenty of tests to have a very high code coverage.

Some of the work also included our internal policies, such as the deprecation policy. When Dancer 1.2 finds you're doing something deprecated, it will not break, but instead inform you of it (via warning) so you will be able to fix it at your leisure. The entire 1.2xxx release series promises not to break your app, unless it is a critical fix (such as a security concern - which is business-critical). You are assured stability in upgrading to any 1.2xxx release.

Deployability

Yes, deployability is indeed a word (we checked) and it is something that all web applications dread. Since Dancer itself supports PSGI/Plack, deploying your Dancer applications is easy and flexible.

However, the point that people find tricky is how. How do I configure my Apache for Dancer? What if it's Lighttpd, or Nginx? What about.. what about...?

Therefore, we put effort in preparing Dancer::Deployment which provides instructions on how to configure web servers for your Dancer application.

We've also put more work for the CGI and FCGI runner files and they should prove to be more correct and aid you better in deploying your app.

Oh, the pretty pretty colors

Dancer comes with a scaffolding script that gives you a nice layout to play with when you just start programming. We've decided to give it a whirl as well and improved it quite a bit.

Your new scaffolded app should be prettier and more impressive, without making any effort. It even uses the jQuery JavaScript library! OMG jQuery!

What's in the future for Dancer

While we hope you enjoy version 1.2, we're not about to rest on our laurels. We're still working on improving the core, the documentation, the code testing coverage, provide new features, expand and flex other features and provide a stable set of community plugins to remove more and more clutter from your work.

Advent calendar? You too? Really?

The advent calendar is our way of showcasing Dancer's ability by showing you how to write Dancer applications, plugins and engines. You'll learn how to deploy your applications on various backends and understand the beauty of simplicity that Dancer offers using its clean DSL and route-based structure.

Stay tuned for more awesomeness!

Credits

Credit goes to the entire Dancer community for our 1.2 release and the advent calendar. Dancer would definitely not be where it's at right now without the love and care the community has given it.

A great thanks goes (and not limited) to the following people (in alphabetical order):

  • Adam J. Foxson
  • Al Newkirk
  • Alexis Sukrieh
  • Anton Ukolov
  • Boris Shomodjvarac
  • crujones
  • Damien Krotkine
  • Danijel Tasov
  • Dave Doyle
  • David Precious
  • Franck Cuny
  • Gabor Szabo
  • Igor Bujna
  • Ivan
  • Mark Allen
  • Maurice
  • Mike Schroeder
  • Naveed Massjouni
  • Naveen Manivannan
  • Nick Langridge
  • Philippe Bruhat
  • Puneet Kishor
  • Rafał Pocztarski
  • Roman Galeev
  • Sawyer X
  • Sebastian de Castelberg
  • snearch
  • Stefan Oberwahrenbrock
  • Yanick Champoux
  • and everyone in the community we've missed.
blog comments powered by Disqus