The Dancer release that will get you hooked!

I've been waiting for this blog post for a few good months now.

We've finally released Dancer 1.3050 (codename "The Captain Hook Adventure", named after Franck Cuny, who will forever be known as Captain Hook!) which carries our new hook system, written by Franck. Special credit goes to JT Smith who pushed the design and implementation of this system (and had great input and feedback) until it saw sunlight.

So what's the new hook system? Basically Dancer (and Sinatra, and Flask, and others) have a before and after modifiers (or sometimes called "filters"), which are basically hooks for running code before and/or after your request has been handled. This is a good place for running checks, auth-related stuff and special logging or whatnot.

While these hooks were very useful for people, they weren't enough. People needed more. For example you might want to override the error handler, or perhaps to add special data before a auto-serialization process. Hell, maybe you want to even create your own hooks! :)

This is now all possible!

You should read more this and even this.

Enjoy!
(and if you see Franck or JT at a conference, feel free to get them a beverage of their choice :)

12 Comments

Wow, this looks like a direct copy of a Mojolicious feature, and you're not giving them the slightest bit of credit. Stay classy Dancer.

http://search.cpan.org/~kraih/Mojolicious-1.34/lib/Mojolicious/Lite.pm#hook
http://search.cpan.org/~kraih/Mojolicious-1.34/lib/Mojolicious.pm#hook

What unfortunate bickering. Can these posts be deleted?

Dancer can be all but accused of not giving credits to where the ideas come. You can check that finding lots of references to Sinatra all over Dancer documentation and webpage.

Hooks, in the other hand, are something that are around for decades. You can find hooks in your Subversion system. Does Mojolicious say their hooks were copied from Subversion? No, because using "hooks" is a method of accomplishing something. Just like using binary trees, linked lists, etc.

Robert, better these posts keep here, so that other people might read and learn what are features, what are algorithms and data structures, and why software patents really suck.

I need to add that "Sawyer X" has done nothing but give people credit for their ideas. Kudos to the Dancer team.

If Roberts attempt to censor valid and very civil criticism isn't proof of wrongdoing on your part i don't know what is. Stay classy Dancer.

Dan...your criticism wasn't valid and wasn't civil. I only read these blogs and I am not a part of the Dancer group at all. We must have different definitions of "classy" and yours is wrong.

Nice job guys, I will try to look at this to include it in my shortenizer.

So why all post for perl is an area to fight and yell. Are we open source ? did the same kind of idea come only from one person ?

Well, this apart, thanks Sawyer to tell us this kind of stuff, it's really nice and usefull to have it, so let's play Peter Pan and Captain Hook :)

Happy dancing !

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz