Major Dancer 2 release: 0.140000

(cross-posted from the Dancer users mailing list)

Hey everyone!

I just released a new version of Dancer 2. It's a major one. I'd like to share a bit about it.

Semver:
First of all, you probably noticed a completely different release version. Previous ones were 0.12, 0.13, which is why it would make sense for this one to be 0.14. In fact, it is! We've decided to use a convention called Semver[1]. It allows us to indicate to you, the users and developers, what changes we've done.

Changelog:
Additionally, if you check the Changes file, you will see a few more interesting gems. We only have features in this release, there are four changes which were introduced by the same three people (Stefan Hornburg, Mickey Nasriachi, and myself - Sawyer X).

Hackathon:
The reason for many of these changes were a Dancer 2 core hackathon that was conducted at Booking.com's HQ with the aforementioned three core devs last Thursday, a day before the Dutch Perl Workshop. We have worked hard on cleaning up several things that bugged us for a while. Allow me to fill you in on those:

Deliverables:
* Replace Config role with better ConfigReader role.
* Move App-related attributes (engines) to App instead of config role.

Dancer2::Core::Role::Config has been a sore point for a long while. It was pushing attributes to unrelated classes, contained triggers which caused us several attempts to untangle, and was something we wanted to clean up.

The new ConfigReader just reads a configuration, allows local and global triggers, and the necessary attributes went into the appropriate class.

Yay!

* Untangle Runner-Server (removing Server entirely).

Dancer2 had a setup of Server handlers (under the ::Server class name), one for PSGI app handling, and the other for a standalone server. The idea was: you call "dance()" (or "start()") and Dancer will either return a PSGI coderef (which goes to Plack) or start a local development web server. Thus we had ::Server::PSGI and ::Server::Standalone.

While this makes total sense, it doesn't make any sense at all. First of all, the standalone server is, in fact, a PSGI server. The PSGI server handler (::Server::PSGI) was not a server, but a coderef. Secondly, the standalone server would still need the PSGI coderef. Confused? Good. Now you understand why we wanted to remove it.

What we did was keep the Runner class, have it hold a "server" attribute, which will be lazily evaluated to a PSGI development standalone server. If you will need a standalone server run, it will build it, and call it with a PSGI coderef. There is now no ::Server handler classes. That entire layer has been removed.

* Replace HTTP::Server::Simple::PSGI with HTTP::Server::PSGI.

Since Plack comes with HTTP::Server::PSGI, we could remove a dependency, while replacing it with a much better module. It is more maintained, doesn't require (monkey-)patching (which we introduced in HTTP::Server::Simple::PSGI) and already does all we need.

There is now also no ability to daemonize the development server within Dancer2 since 1. Plack already allows it by command line, and 2. you should not be running the development server in the background. If you do, please consider changing it.

Non-hackathon changes:
Cookie building improvements and using Plack::Middleware::Head to serve the head (instead of an ugly around() method), both by Russell Jenkins, and supporting deserializing from DELETE methods as well, done by Russell, Yanick Champoux, and Sawyer.

Thanks:
Major thanks goes to all people mentioned in the changelog in this release: Mickey Nasriachi, Stefan Hornburg, Russell Jenkins, Yanick Champoux, and Sawyer X.

Another major thanks goes to our fantastic community. Thank you for the feedback, support, and help!

Please try out this new version and update us on any issue you may find!

[1] Semantic Versioning: semver.org.

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz