French Perl Workshop 2010 report

I’m just back from FPW 2010 and I want to write this blog entry right now, while everything is still fresh in my mind. Lots of things happened regarding Dancer and I want to sum them up here.

my Perl Dancer talk (update)

Now that Slideshare has finally processed my slides, I can embed them here, enjoy.

BibLibre, Dancer and authentication middlewares

First of all I’ve met Marc Chantreux who works for BibLibre and wants to use Dancer at work.

Marc is looking for the good way to implement an authentication layer for his Dancer app. Looks like the way to go is with a Plack::Middelware. Indeed, Franck Cuny explained us that middlewares are a really great way to address this kind of feature. That way the authentication layer is separated from the application. Thanks to his Dancer::Session::PSGI, this could be done really easily.

I’m really glad Marc and his company give so much interest and trust into Dancer, I’m pleased to see such things happening and I’m going to give them as much help as I can in their daily needs with Dancer.

Not to mention that Marc already contributed an interesting patch to Dancer’s code, providing better pattern matching and named-captures support in our route handlers. He also appeared to be very motivated and had plenty of ideas and questions regarding Dancer’s development. I’m sure he can become quickly a regular contributor to the project.

About WebSocket support in Dancer

I’ve talked a lot with Franck about Dancer, that was really interesting to met him in real life for a couple of days and share ideas and remarks regarding our code.

I’ve asked him about websocket support and it appears that it’s “just” a matter of having a non-blocking “request handler”. Dancer is not currently non-blocking, unless you choose to deploy with Plack and Twiggy. What we plan to do is to provide a third handler, named Dancer::Handler::Async which would depend on Twiggy and would force a non-blocking context. But we have to investigate more prcesiely that. Franck is willing to dig in that direction, so maybe we can have more to say in a month or two.

A Dancer implementation in Perl 6 ?

After my talk about Dancer – you can grab the slides here – I’ve been at a Perl 6 workshop that was handled by Martin Berends. We first started to install rakudo and he showed me some Perl 6 stuff. Then we ended up talking about … well, guess what, Dancer :)

He was very excited about the project. He then suggested the idea of a Perl 6 implementation. Martin already implemented an HTTP::Daemon module for Perl 6, and I suggested to look at HTTP::Server::Simple::PSGI which would be the very first dependency Dancer would need. That would be awesome to have Dancer in Perl 6, wouldn’t it?

Well, I hope I don’t forget anything important to say in this report, the event was great, and I should stop writing now and go take some rest :)

Happy hacking.

Redesign contest for perldancer.org

As you can see when you visit the Perl Dancer’s website, I suck at webdesign :) My skills are limited to a couple of Gimp tricks and the ability to find some Creative-Commons material on Flickr

That’s why the design of our website is not as shiny, webbish and cool as it could be. At first, we were thinking at raising some money via donations for paying a profesionnal designer. But quickly some people volunteered here and there, and the idea to build a new design on goodwill did fit better the Free Software philosophy than paying someone to do it.

Today, more than 3 people volunteered to submit a proposal, so this gave me the idea to run a contest, let me explain what I have in mind:

The contest is to build a complete new visual identity for the Perl Dancer project. There are 3 categories in the contest: Website design, Logo, Web Banner for dancer-powered websites.

Here are the instructions a proposal must follow to be accepted:

  • The artist is totally free regarding colors, visual elements, logo and CSS techniques.
  • The following baseline should be visible: The easiest way to write web applications with Perl
  • If any visual element is added to the design, it should recall the idea of one or more of the following concepts: Lightness, Easiness, Extensibility

Here is how to submit your proposal:

Update

After some feedback I’ve received, I’m now aware that asking someone to submit a full, finished project on the off chance that it might be used, is a bit unfair. It’s indeed a lots of work to polish the design completely. So I’m now changing the conditions for accepting a proposal: any design can be submited as a static HTML file, or as a screenshot.

This will be enough to let users vote. That way, the designer will work on all the details when they know they’ve won the contest.

First, install Dancer in order to be able to run your website clone locally:

$ curl -L http://cpanmin.us | perl - Dancer

Then create an account on GitHub if you don’t already have one.

Fork the perldancer-website project and clone it:

    $ git clone YOUR_FORK_URL
    $ cd perldancer-website

You can now work on your design by editing views and see your changes by running the dancer script:

$ ./perldancer.pl
>> Dancer server 527 listening on http://0.0.0.0:3000

Open a browser at http://localhost:3000 and see your design in action with the real website content. That’s how we dance ;)

When your design is ready for a proposal, make sure you’ve commited all your changes and push to your fork. Then ask for a pull request:

$ git push origin master
...

Note that there is no deadline yet, but we could choose one soon.
As soon as we have enough proposals, we’ll be able to open a vote for electing the winner.
All dancer users will be allowed to vote, this will probably happen on the users mailing list.

Dancer 1.18 released

I’m glad to announce a new major release of Dancer, version 1.18 is now out and waiting for you on the dancefloor.

Please fire up your beloved cpanminus and try it out.

This release provides some new features such as new logging facilities, better filters and plugins support, complete documentation cleanup and of course, has many bugfixes as we can manage to commit.

The next major release will be 1.2.

Note that the French Perl Workshop 2010 is coming very soon and that I’ll give a talk there about Dancer.

UPDATE If you upgrade to 1.18, please make sure you’re aware of Issue #69 (Expect 1.1801 to come soon for fixing this issue).

Re: Mojo vs Dancer Week 2 – Templates and Images

This is a follow-up to Alias’ second round report of his “Mojo vs Dancer” contest. You can find my follow-up to the first round here.

Dancer – Bootstrapping a website

Since my review last week, a couple of new releases of Dancer hit the CPAN claiming to fix installation on Win32. Just to prove it, I’ve done this week’s testing on my conference presentation laptop instead of my desktop machine.

Dancer installed first time cleanly on the new machine. And the hello world script from last week runs correctly. So all good there.

The first round of the contest put some light on something we weren’t aware of: support for Win32 environments. Indeed, none of the core developers of the project are Windows users. We did work last week on that, and started a basic-yet-strict QA procedure to avoid test regressions.

Our GitHub repository is now splitted into two main branches: master is dedicated to prepare CPAN releases. Only documentation, packaging and bugfix commits are allowed there. New features are developed in the devel branch, and when we want to release a new major version of Dancer, we’ll start by packaging some DEVELOPER releases from the devel branch before merging it into the master branch.

So we now have a sane development/release cycle, thanks to the packaging/QA issues enlightened by Alias’ first report.

After a more-complete-than-last-week read through the main Dancer search.cpan.org page one thing jumps out quite sharply about the Dancer API in general. And this is that it isn’t object-oriented, which is something or a rare thing these days.

Indeed, this a choice that goes in the same way as Sinatra does: provide powerful, expressive and intuitive syntactic sugar to the end user to avoid as much as possible administrative code. This is – if you ask me – one of the best idea of Sinatra, and I clearly want it to be a key-feautre of Dancer.

Or at least, it doesn’t LOOK object-oriented. Judging from the distribution page there’s plenty of classes and I’m sure the internals are all done largely in an OO fashion.

You’re absolutely right, everyting inside Dancer’s internals are made in an OO fashion, Dancer::Object is the base-class of every object you can find, and some abstract class are also heavily used for engine (see Dancer::Engine, Dancer::Template::Abstract or even Dancer::Session::Asbtract if you want to see some examples).

This is also for this reason why I chose to provide access to the params and request objects through function calls, rather than forcing the user to unroll @_ in the route handlers:

For instance, this route handler…

get '/' => sub {
    my ($request) = @_;
    $request->params->{foo};
};

…becomes with Dancer syntax:

get '/' => sub {
    params->{foo};
};

So yes, Dancer is a DSL and it’s a major design choice behind the project (so don’t expect it to change in the future).

The main API that you get with “use Dancer” sports a similar kind of “Do What I Mean” command interface that reminds me a bit of the Module::Install command interface.

This means that the code to show the index template is going to look like this.

get ‘/’ => sub {
    template ‘index’;
};

I’m not entirely sure what I think about this idea, despite the fact that I’m the maintainer of M:I and created it’s Domain Specific Language inteface. This kind of thing usually raises red flags.

I can see this API strategy either descending into API chaos or becoming one of Dancer’s best and most loved features. Or quite possibly both depending on the scale of the project.

For the moment, given Dancer is meant to be taking a micro-framework approach (which should be optimised more for small websites) I’m willing to suspend my disbelief and run with it until I can make a better judgement.

Well, considering the success of Sinatra, I won’t reconsider this API choice, this to me one of the key-feature of micro-framework: allowing expressive-yet-powerful syntax. If you have to deal with objects everywhere in your application code, you can’t have the benefits of lightweight DSL syntax.

The documentation in general is oddly structured. For a command-oriented API like this I would expect to find documentation for each of the available commands. This section of the documentation does exist, but it doesn’t contain a list of all the commands.

Instead, some of the commands are described down in sub-headings related to a logical area instead. And if you look at the table of contents on the search.cpan page the logical grouping doesn’t appear very, well, logical.

There’s some other indications the documentation has built up in bits and pieces rather than being addressed in a complete fashion. Some features are glossed over quickly, leaving me a bit stumped still. Other go into way more detail than is needed for a small website to the point of information overload.

Yes, we’re totally aware of that, and we started a complete documentation rewrite in the development branch.

We target a full and complete rewrite of the docs for the next major release: 1.2. When this rewrite is complete, we’ll have the following documentation structure:

  • Dancer : evry syntactic keyword will be documented here, this will be the documentation of all exported symbols
  • Dancer::Tutorial will provide the user with concrete, step-by-step example in order to start working with Dancer
  • Dancer::Cookbook will be a good assistant for anyone who wants to solve common issues you can face when developing a web application
  • Finally, Dancer::Deployment will provide help and configuration examples for deployment issues, most of the time involving Plack and webservers

The section on config files seems to suggest I should make three config files, a global config and then a pair of development/production config files that overlay the global. And these files go in different directories for some reason, unless I “put it all at the top of the program” (without saying how I embed this YAML in the program). A bit later on I realised they meant embed via the “set” command.

This is an idea that comes from Rails, which I like and decided to port into Dancer’s conventions: You can set common and global configuration in a single file (here named config.yml. But if you want to be able to switch between different configuration contexts easily (like development to a production) then you can use environment configuration files.

When starting your Dancer app, you can choose which environment you want to enable, dancer will then first load the config.yml file, and then the environment-specific one.

This is pretty convinient for switching log levels, or even the strictness of the code. But again, all of this is optional, you can go without configuration files, putting all your settings along with your code, using – as you spoted it – the set keyword.

Overall, I think the documentation is reasonably thorough but just needs some love to clean it up into a more learning-friendly structure, with some sections shrunk down in the main Dancer page to just the most basic and common uses and references out to other pages for using more advanced features.

As I said above, this is a work-in-progress in the devel branch and should be released, if not with 1.18 (the next stable release), with 1.2.

Stuck on something I wasn’t sure about, I resorted to running the built in skeleton generator (mentioned prominently on the Dancer::Cookbook page) to at least get a better idea of what I was supposed to be doing.

C:\Users\Adam>dancer -a top100
+ top100
+ top100\views
+ top100\views\index.tt
+ top100\views\layouts
+ top100\views\layouts\main.tt
+ top100\environments
+ top100\environments\development.yml
+ top100\environments\production.yml
+ top100\config.yml
+ top100\app.psgi
+ top100\public
+ top100\public\css
+ top100\public\css\style.css
+ top100\public\css\error.css
+ top100\public\images
+ top100\public\404.html
+ top100\public\dispatch.fcgi
+ top100\public\dispatch.cgi
+ top100\public\500.html
+ top100\top100.pm
+ top100\top100.pl

For a few seconds this shocked me, because compared to the simplicity of helloworld.pl this is a lot more files.

Well, I understand it can shock you if you expect to build your app with only one Perl script, but wait, you’re asking the scaffolding script to… well scaffold something! :) So yes, it creates a full-featured application skeleton, and that’s what it’s designed for.

We could imagine some kinds of scaffolding-levels maybe though, in order to let the user choose which features they want in their scaffolded application.

At this point I hadn’t even remotely considered the idea of site-customising my error pages, and there’s 5 entirely different types of Perl application files in this list. I (newbie me) don’t even know what PSGI is, let alone why I need one. And don’t get why I have a dispatch.cgi in addition to my top100.pl script.

Frankly, I don’t even really WANT to know what all these things are (yet?). But this did at least confirm where all the files should be living and the demo app did actually start and run properly. So in my case, it solved the problem I needed to solve.

But I certainly don’t want to use it as the basis of my Top 100 site. It’s just a bit overwhelming for my level of experience, and I don’t want to have to go exploring and work out what all these different files do, so I know which ones are safe to delete.

Well, the scaffolding tool is here to makes your life easier if you want to build a full-featured application with Dancer. So yes, it provides you with any file you might need for Plack deployment, layout design, and error pages customizations. It’s designed for that actually.

Templating was largely straight forward, mostly because the docs do everything to steer me towards Template Toolkit short of installing it for me (yes, you have to install Template Toolkit yourself to get the generated skeleton website working).

I suspect the reason for this is because their embedded default templates are not PARTICULARLY featured. The documentation sums up the feature set of the built in templates as the following.

< % var1 %>

No other features are described, making Template Toolkit the obvious choice.:)

Indeed the default template engine that comes with Dancer is utterly limited, and that was also a choice. If the user wants complex template support, they have to upgrade to a powerful template engine, and CPAN has plenty of them.

I’m totally fine with this, but what I’m not entirely sure about is why on earth they have chosen to make Dancer’s default tag style for Template Toolkit different to Template Toolkit’s default tag style for Template Toolkit.

The only reason I could uncover from the documentation is that it makes TT compatible with their built in template engine. The one whose list of features is “variables”.

The only other guess other than “we like it more that way” I can make are that it’s done to be compatible with Sinatra, the Ruby toolkit I’ve never heard of but which I’m told was the inspiration for Dancer.

Yes, I must say this was a bad idea, my fault here. At the very begining of Dance’s development I was really in the idea of porting Sinatra into Perl, and I thought it should be a good idea to use the same template tags as they do in Rubyland. Time said it wasn’t, as every Perl developer expect TT to use [% %]. So we might consider going back on this, in the future, but that would mean some backward compatibility issues, which is something I want to avoid.

Switching it back to regular Template Toolkit tag style requires a slightly annoying block of config file entries I can easily imagine myself repeating in every Dancer program I will ever write.

To help you in gauging my annoyance level on this topic, allow me to show you now the complete working Dancer application at the end of this week.

#!/usr/bin/perl
 
use Dancer;
use Template;
use CPANDB {
    maxage => 3600 * 24 * 7,
};
 
# Configuration block
set template => ‘template_toolkit’;
set engines  => {
    template_toolkit => {
        start_tag => ‘[%',
        stop_tag  => '%]‘,
    },
};
 
# Route block
get ‘/’ => sub {
    template ‘index’;
};
 
dance;

Well, you could have put that in config.yml. But I agree with you, this is too much configuration for making Dancer behaving “the default TT way”. We should fix that I suppose.

It’s not a problem as such, but I’m sure it’s one of those things that’s going to niggle at me. If I wasn’t trying to emulate a newbie, I’d probably switch over to the Template::Tiny plugin in the short term. Unfortunately, it’s not particularly well known and so is probably out of bounds for this competition.

Given their strong preference for Template Toolkit, in their situation I’d probably have inlined the entire Template::Tiny package as the “house template” engine. Then you still have a direct upgrade path when people hit a feature T:Tiny didn’t support but you get to keep the default tag style. But the current predates Template::Tiny, and so be it.

I also had a momentary confusion over whether I should call my template “index” or “index.tt” or “index.html” or “index.html.tt”, but I put that mostly down to playing with Mojo’s double-dotted templates (which I’ll get to later). A quick look at the generated skeleton made it pretty clear what the naming is.

In the future, I plan to let template engines define their template extensions. So it will be less confusing for the user.

Adding the static files was very simple and easy to understand, following the convention of “if there’s a “public” directory, everything in it is a static file”.

However, I did hit a problem when I tried to add my logo image.

Weirdly, although my Dancer application was happily sending me css and my favicon.ico file, it didn’t appear to support PNG images. Bemused, I placed my first (legitimate) visit to the #dancer channel to ask a What The Hell.

Dancer uses MIME::Types under the covers, and the bug only happens on Windows, and they confirmed they can replicate it. Beyond that there’s no more information yet, but I’ve worked around the problem temporarily on my Dancer application by converting the PNG files to GIF.

And given the speed with which they chased down the previous Windows problems, I’m hopefully that by next week the problem will have gone away.

Indeed, I think we’re doomed with Windows environments ;) We have a lead though on this PNG-Win32-IE-only (!!) issue, and we coudl imagine it’s fixed by the next round, hopefully.

[...]
Overall, the process was relatively straight forward with the exception of the PNG problem and a general feel that the documentation/tools dump you in the deep end a bit too quickly and need polishing.

So as I understand it, no major issue there, except for the overkill configuration needs to get TT behaves as you expected. The documentation is being completely reorganized for the next stable release and we should fix that PNG issue pretty soon.

See you next round, and happy dancing!

Posted in Main

Tags: , ,

Permalink 7 Comments

Re: Mojo vs Dancer Week 1 – Installer, Support and Hello World

As you may have noticed, Adam Kenedy aka Alias has started a competition between Mojolicous and Dancer.

First of all, let me say that I find this idea pretty interesting and, well, refreshing. This is an original way of evaluating software, with a rather objective point of view (Adam is not involved in Mojo development neither in Dancer’s).

The contest will be divided into rounds, which will occur once a weekend, and the first round has just happened. I’ll try to follow Adam in this project and will post a reply to every round-report he posts on his Perl journal.

Round 1:

The Dancer website seems quite a bit more enticing than the Mojo website, at least superficially. There’s evidence of more attention to some of the visual details, with more design elegance and things like source code syntax highlighting.

That’s true I tried to make a shiny website for Dancer, as the key target here is to provide a modern feeling to the visitor. But I’m aware I’m not a web designer and that could be far better that the quite amateur skin I’ve made. That’s why we’ve launched a call for volunteers for a website makeup and we’re glad we now have someone working a new design. So hopefully, the Dancer’s website will be even more attractive soon.

Clicking through the links, however, it’s clear information is still a bit thin on the ground. And the “latest release” version on the download page is behind the version on CPAN, but not by much.

The website generally has more of a “new and undeveloped” feel to it, compared to Mojo’s “mild neglect” feel.

Well, I’m not surprised you got this feeling, because that’s the reality, Dancer is a young project. It’s not even one year old. So I guess as time goes, all that “cutting-edge’ feelling will fade out.

One nice thing about the website, is that they’ve dropped a Hello World example directly on the front page for me to copy and paste.

The main target of the website is to show how simple it is to start working with Dancer, so yes, providing a “Hello World” example is mandatory here.

After some small tweaks for Perl correctness (the Dancer guys also don’t use strict of warnings…)

Well, we do use strict and warnings. Even better: Dancer imports these pragmas for you, automatically. I suppose we should say that in the documentation, even if already mentioned it in the Cookbook.

Oh, Franck already patched the documentation, so it will be shipped with the next release.

The Dancer example is smaller and simpler than Mojo example, and doesn’t make template use compulsory. Again, I can’t stand this use of non-descriptive functions to end these programs. But at least dance is cleaner and less tragic than shagadelic.

It’s a matter of personal taste I suppose wether you like or not the term “dance” to declare that your app is ready to serve. It sounded reasonable to me, but we could imagine a more serious term as an alias, like ‘start’.

Instead, for Dancer tragedy strikes during when I install it.

Because it doesn’t install. Or at least, it doesn’t install on Windows. Or perhaps it’s just my Vista machine.

A redirect test is failing with this…

t/03_route_handler/11_redirect.t …………. 1/?
# Failed test ‘location is set to http://localhost/’
# at t/03_route_handler/11_redirect.t line 36.
# got: ‘//localhost/’
# expected: ‘http://localhost/’

# Failed test ‘location is set to /login?failed=1′
# at t/03_route_handler/11_redirect.t line 44.
# got: ‘//localhost/login?failed=1′
# expected: ‘http://localhost/login?failed=1′
# Looks like you failed 2 tests of 9.
t/03_route_handler/11_redirect.t …………. Dubious, test returned 2 (wstat 512, 0×200)
Failed 2/9 subtests

I reckon Win32 support has been our Achilles’ heel recently. We did *lots* of feature additions recently, and yes, I agree, we failed at maintaining a high level of quality assurance for non-unix platforms.

That will change, as we’re entering a phase where the 1.2 release becomes closer, and then, feature additions will be blocked soon, and QA will be our priority.

The one saving grace is at least it failed quickly. While not keeping dependencies to zero, they’ve done a fairly decent job of keeping the dependency list down to a minimum.

But the most damning factor here is a look at their CPAN Testers results. These show failure rates all over the place, up and down, with some big regressions.

This kind of pattern usually suggests that Dancer is seriously lacking in their QA procedures, or a complete disregard for platforms or Perl versions other than newer Perl on their own operating systems. This makes Dancer a risky choice for me to bet on, because it means it could all go pair shaped down the line.

As I said above, QA has suffered recently because we add a lot of new features. We’re aware of that and will now focus on having a very stable release soon, so we can release and announce Dancer 1.2.

Let the dancer rest!

Ok, forgive me for that easy wordplay, I haven’t take my coffee yet. I just wanted to underline the recent work Franck did. It’s just awesome, Dancer 1.170 (to be released very soon) will clearly be the “REST” release.

Most of the work has been done by Franck, so the credit for that should be his. My contribution was mainly about refactoring and suggesting some enhancement ideas, in order for the whole to fit well with the existing source code.

The main idea behind this new feature is about adding automatic serialization/deserialization support to route handlers, which makes Dancer a super-swissknife for writing API servers:

  • Whenever a route handler’s response is a ref (instead of being a string), it should be serialized with the current serializer.
  • Whenever a POST or PUT request is processed, if the content-type matches the serializer’s one, its request body should be deserialized.

This way of doing things is again fitting the philosophy of “Convention over Configuration” and does provide a real ease-of-use to the end-user. This is clearly my key-goal when I’m thinking at Dancer’s syntax, it should be context-aware as much as possible. Isn’t that Perlish afterall? :)

The serializers classes have been based on Dancer::Engine in order to let anyone who wants to implement another to be able to (just like template, logger and session engines are handled in Dancer’s core, anything is triggered by a setting).
So basically, if you feel like adding a new serializer to Dancer, you just have to implement Dancer::Serializer::Abstract, like explained previously on this blog.

Kudos to Franck and stay tuned until 1.170 is out ;)

Dancer 1.160 released

A new version of Dancer has been published to CPAN a few minutes ago, it’s also available from the official website, in the download section.

As you can see, the project has now its own domain name: http://perldancer.org, it’s clearly more shiny than the previous subdomain I used ;) So feel free to update your bookmarks (even though the old domain name now redirects to the new one).

Oh, and there is also a mailing list now, for people who like to share experiences about Dancer; feel free to join.

The change set for 1.160 is impressive, thanks a lot to everybody who got involved!

Happy dancing.

About performances

I recently focused on Dancer’s core with a single target in mind: optimization.
After having heavily refactored the Dancer::Route class, I started benchmarking Dancer.

To start with, I’ve created a set of test applications, in order to bench different kinds of application (from a hello world app to a huge one).

All these applications are available in this repository, if you like to see more precisely what I did.

The first test I did was to bench a “hello-world” application, with PSGI, Dancer 1.150 and the last version of the master branch.

hello.psgi .................... 1420 req/s
hello.dancer (1.150) .......... 1260 req/s
hello.dancer (github/master) .. 1320 req/s

You can see that Dancer “master” is about 100 req/s faster than 1.150, this is mainly thanks to Dancer::Route::Builder: Dancer now compiles all the routes defined by the application at startup time, and don’t spend time whenever a request is handled to do that job.

Moreover, thanks to SawyerX, Dancer now caches route resolution via Dancer::Route::Cache, and that increases response-time drastically when accessing an application with lots of routes.

Here is another bench that I did against an application with 676 routes handlers.

big.dancer (1.150, no cache, no route compiler) ...  110 req/s
big.dancer (GH, no cache, route compiler) .........  130 req/s
big.dancer (GH, cache, route compiler) ............ 1300 req/s

It appears clearly here that with a big number of route handlers, Dancer’s response-time decreases. I wanted to see more precisely how that occurs, and I run a bench in order to compare the response-time when varying the number of route hanlders.

As you can see on this graph, thanks to route caching, we now have a roughly constant response-time, no matter how many route handlers we have in the applicaiton.

These improvements will be shipped with the next CPAN version, either 1.151 or 1.160 if we have the time to add some new features as well.

Stay tuned.

Dancer 1.150 released

I’m happy to announce the release of Dancer 1.150.

This release has been made possible by six people, so it’s quite the first community-driven release of Dancer, and nothing could make me more happy than that.

I really like the fact that different people, from different places come and contribute ideas, documentation and patches. This is how open source works, and this is how great tools are written. I’m glad to see Dancer taking that path. I can only hope that it will be like that for a long time.

This new version provides mostly bugfixes and documentation updates. See the changelog for full details. Oh, and thanks to David Precious, we now have a shiny Cookbook!

Major new features will come with 1.160, but that’s for another blog entry ;)

Enjoy your dances.

Dancer’s development update, near to release 1.140

Lots of good things happened recently in Dancer’s development, here they are:

HTTP::Server::Simple::PSGI

After my last post about Dancer, Tatsuiko Miyagawa suggested to build Dancer’s standalone server upon a PSGI-aware layer, rather than on HTTP::Server::Simple::CGI.

A couple of days later, he released HTTP::Server::Simple::PSGI, which is actually based HTTP::Server::Simple (which itself doesn’t depend on any non-core modules).

A few patches later, the standalone server was refactored and running on this new guy. That means when writing a Dancer app, you can now always rely on PSGI environment goodness, whereas you’re using the standalone server, or the Plack architecture. That just rocks, again kudos to @miyagawa.

Dancer::Request

The Dancer::Request class got also heavily refactored and enhanced, it can now provide the user with an access to the raw body of the incoming request (thanks to RasterBurn for the report).

By the way, this class needs still so more features, and I’m actively working on it. I may release Dancer 1.2 when I’m happy with that one.

Oh and it also now provides a complete documentation. POD FTW.

Dancer::Route

I also gave a shot at Dancer::Route, which has been recently patched to support some new features (prefix and conditional matching, thanks to Frank Cuny)

No more CGI.pm, really!

I also found that CGI.pm was still used in one very place for rendering and HTML page. This was a shame as we wanted Dancer to be 100% CGI.pm-free. Hence the patch that actually allow us to say it now, for REAL ;)

All of this freash meat is available on my GitHub repo and will be soon released to CPAN, under version 1.140. Stay tuned!

Get Adobe Flash playerPlugin by wpburn.com wordpress themes