Mojolicious 9.0 Released
Written by Nikos Vaggalis   
Tuesday, 23 February 2021

There's a new major version of Perl's realtime web framework, Mojolicious. Codenamed "Waffle, Mojolicious 9.0 comes with improvements but also with breaking changes. 

First of all since version 8.50 Mojolicious requires Perl 5.16 which allowed the framework to adopt more advanced functionality. Breaking change it might be but still when you consider that Perl's latest version is 5.32.1 it's not that major. The outlook however is to move to Perl 5.20 in the near future.

The full list of the changes are:

- Added support for deployment specific plugins.

- Removed Mojo::IOLoop::Delay.

- Removed hidden attribute from Mojolicious::Routes.

- Removed hide and is_hidden methods from Mojolicious::Routes.

- Removed deprecated success method from Mojo::Transaction.

- Removed deprecated detour, over, route and via methods from Mojolicious::Routes::Route.

- Removed deprecated local_address method from Mojo::UserAgent.

- Removed deprecated tls_ciphers, tls_protocols, tls_verify and tls_version options from Mojo::IOLoop::TLS.

- Removed deprecated local_address option from Mojo::IOLoop::Client.

- Removed deprecated config stash value.

- Changed Mojo::Log to join mutiple log messages with a whitespace instead of a newline.

- Added is_reserved method to Mojolicious::Routes::Route.

- Improved Mojolicious::Routes to disallow the use of reserved stash values, such as "/:action", in route patterns.

- Improved Mojolicious::Routes to throw exceptions for missing controllers.

- Improved Mojolicious::Routes to throw exceptions for routes with controllers but without action.

- Improved Mojolicious::Routes to disallow namespace without controller for routing.

- Improved Mojolicious::Routes to die if auto rendering failed.

- Improved render method in Mojolicious::Controller to die if no response could be rendered.

- Improved reply->static helper to die if the requested file does not exist.
- Improved contextual logging feature in Mojo::Log not to concatenate log messages and context.

- Improved all_text method in Mojo::DOM to exclude "<script>" and "<style>" from text extraction in HTML documents.

- Improved error messages in config plugins to be more consistent.

Let's look in more detail at what has been going on to result in this release: 

Removed Mojo::IOLoop::Delay, which has become obsolete since the introduction of Mojo::Promise.This removal could also prompt the subsequent removal of ioloop attribute from Mojo::Promise, but since many tests still rely on it, it was postponed for a later day.

Added support for deployment specific plugins.This need arose from the fact that you shouldn't have to modify the code in order to load the plugin.The initial proposal was to auto-load any plugins defined in the MOJO_PLUGINS environment variable, but in the end they settled with integrating it in places like Mojolicious::Plugin::Config.Therefore the deployment of specific 3rd party plugins such as Mojolicious::Plugin::SetUserGroup:

"do not need to be included in the application code.They can also be loaded later on via the reserved plugins value for Mojolicious applications that are using any one of the built-in configuration plugins Mojolicious::Plugin::Config, Mojolicious::Plugin::JSONConfig or Mojolicious::Plugin::NotYAMLConfig"

Improved Mojolicious::Routes to disallow the use of reserved stash values, such as "/:action", in route patterns.Special stash values like :controller and :action in route patterns were a security risk, which required special features in order to mitigating them that costed in performance.

Improved the render method in Mojolicious::Controller to die if no response could be rendered.$c->render should be raising an exception if nothing could be rendered, instead of generating a 404 response, something that never made any sense anyway.

 "when a route points to a missing controller, a namespace without a controller or a controller without an action, you now get an exception rather than a 404, which would often confuse people."

Removed deprecated success method from Mojo::Transaction.
In 8.02 the Mojo::Transaction::success was marked deprecated in favor of Mojo::Transaction::result and Mojo::Transaction::error. But since this method was used a lot in legacy code, its removal wasn't attempted till version 9.0.

Changed Mojo::Log to join multiple log messages with a whitespace instead of a newline.Multiple messages ($log->debug('foo', 'bar')) are currently joined with newline characters. But since the context was being prepended to the first debug message such as ($log->debug('[12345] foo')), it was deemed necessary to change the joining default was dimmed to whitespace,so that the context could be written as a separate message like ($log->debug('[12345]', 'foo')).

Removed deprecated config stash value.Since 8.19 marked deprecated.Deprecated the use of the config stash value and $config variable in templates by Mojolicious::Plugin::Config. You can use the config helper instead. Unfortunately there was no good way to warn users, so this deprecation was in effect until the next major release 9.0.Having a stash default "config" which pointed to the app's config was a backcompat measure ages ago.Finally removed.

Finally the documentation was updated to look more elegant and better organized.

Thus the cutting edge Perl realtime framework keeps on moving.The future is bright. But if you want to get behind the history of its beginnings, an overview of its roots? then make sure to check the following interviews with Sebastian Riedel back from 2014.

All about Mojolicious – interview of Sebastian Riedel part 1

All about Mojolicious – interview of Sebastian Riedel part 2


More Information

Announcing Mojolicious 9.0

Related Articles

Mojolicious Web Clients Book review

Perl for the Web: Mojolicious 8.0 Released

All about Mojolicious – interview of Sebastian Riedel part 1

All about Mojolicious – interview of Sebastian Riedel part 2


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.


Open-CV Python Now Official Project
25/02/2021 has announced that the popular and long-running package OpenCV-Python is now an official OpenCV project.

Amazon Amplify Adds Flutter And Vue Support

Amazon Amplify, the open source library for interacting with cloud services that use JavaScript applications, now has support for Flutter and Vue 3.

More News





or email your comment to:

Last Updated ( Tuesday, 23 February 2021 )