Dancer 2, a Roadmap
OK, before we start, let's make it clear: this article won't answer the question everyone has in mind: When ???!!!??.
But it will give a complete overview of what has been done and what remains to be done. This should give you a good overview of where we are and will also enlight how you can help.
DSL
Of course the very first milestone is to have a working DSL over the new core. It has been my main target and it's almost finished.
All of the keywords we have in Dancer 1 are supported at the time of this
writing except send_error
and load_app
. All the other keywords you won't
find in Dancer 2 that exist in Dancer 1 will be deprecated (like
before_template
or load
for instance).
I plan to finish the DSL very soon (it's my top-priority for now) so I suppose it's a matter of weekends as that's when I'm able to work on Dancer 2.
Core Engines
We can find several engines in the Dancer distribution. Engines are specific components dedicated to handle sessions, templates, loggers and serializers.
The lists below show engines we found in Dancer 1, those in bold are the one ported in Dancer 2.
- Logger engines
Capture, Console, Diag, File, Note, Null.
- Session engines
Simple, YAML.
- Template engines
Simple, TemplateToolkit.
- Serializer engines
Dumper, JSON, Mutable, XML, YAML.
As you can see, there is still some work to do there, but it should not take
too long as all the Moo
roles used to build engines are ready. Also some of these
engines are really... dumb to implement!
Plugins
The support for plugins is namely the Dancer::Plugin
module. In Dancer 2,
lots of magic happens there because a plugin in Dancer 2 is actually a DSL role
that is consumed into the core DSL (which itself is built via a default DSL
role).
The interesting part is that all the role composition is hidden by the
syntactic sugar of Dancer::Plugin
, the very same syntax of Dancer 1 is
possible, but behind the scene, there are Moo
roles consumed, it's insanely
powerful and elegant! (I can say that without sounding pretentious, because
it's not my idea, but one of mst's ;).
So, in Dancer 1, we have one plugin shipped with the core, it's
Dancer::Plugin::Ajax
which provides a handy keyword ajax
to define ... Ajax
routes.
That plugin has been ported to Dancer 2 and works as expected.
Dancer::Test
The Dancer::Test
module is a helper to get Dancer tests, it provides lots of
handy function to test a Dancer application. The most used one,
dancer_response
is implemented, but all the other helpers remain to be done.
Also, due to design changes, Dancer::Test might not work exactly in the same conditions as with Dancer 1. So maybe some work here to polish it a bit more.
Ecosystem
The last part of the job will be quite a big challenge: we'll need to test every module on CPAN in the Dancer ecosytem with Dancer 2, see if it works and if not, patch it and send the patch to the author.
This is going to be - I think - a very interesting marathon, and I think the best way to do it will be in a hackaton dedicated to the task.
OK, so ... When ?
Well, not for Christmas! But we can say Dancer 2 will be out in 2012, is that precise enough? No? Well, didn't I say at the beginning that I won't answer that when question?
Author
This article was written by Alexis Sukrieh and reviewed by David Precious, for the Perl Dancer Advent Calendar 2011.