Skip to content
Dan Book edited this page Jul 18, 2016 · 26 revisions

Upgrading to Mojolicious 6.63

multi_accept removal

The multi_accept attribute was removed from Mojo::IOLoop, Mojo::IOLoop::Server, and Mojo::Server::Daemon, along with the multi_accept setting for Hypnotoad and the -M option for the daemon and prefork commands. Instead there is a new single_accept option for the listen methods in Mojo::IOLoop::Server and Mojo::Server::Daemon. If single_accept is not enabled, servers will accept as many connections as are available.

Template methods

The build and compile methods were removed from Mojo::Template, and the interpret method was removed in favor of the new process method which compiles the template if needed.

Morbo check method

The check method was removed from Mojo::Server::Morbo in favor of a new modified_files method which returns all files that have been modified instead of just one at a time.

Upgrading to Mojolicious 6.62

Log level methods

The methods is_debug, is_error, is_info, and is_warn methods of Mojo::Log were removed, use is_level instead.

Upgrading to Mojolicious 6.59

Removed xss_escape from Mojo::Util

The xss_escape function was removed from Mojo::Util, since it is now equivalent to xml_escape.

Upgrading to Mojolicious 6.58

WebSocket frame methods

The methods build_frame and parse_frame were removed from Mojo::Transaction::WebSocket in favor of the equivalent methods in Mojo::WebSocket.

Upgrading to Mojolicious 6.44

Removed format_regex from Mojolicious::Routes::Pattern

Upgrading to Mojolicious 6.43

Removed client_close and server_close from Mojo::Transaction

The methods client_close and server_close were removed from Mojo::Transaction and replaced by the method closed.

Upgrading to Mojolicious 6.40

Refactor of WebSocket transactions

The following methods were removed in a refactor of WebSocket transactions, replaced by the new module Mojo::WebSocket to handle the WebSocket protocol.

  • Mojo::Transaction::WebSocket: client_challenge, client_handshake, server_handshake, server_open
  • Mojo::Transaction: is_writing

Also, the upgrade event of Mojo::Transaction::HTTP was removed.

Upgrading to Mojolicious 6.35

Removed collecting from Mojo::UserAgent::CookieJar

The method collecting has been removed from Mojo::UserAgent::CookieJar. Use the ignore attribute instead.

Upgrading to Mojolicious 6.15

Removed build_body/build_headers from Mojo::Content

The methods build_body and build_headers have been removed from Mojo::Content. Instead, use get_header_chunk, get_body_chunk, headers_contain, or body_contains.

Upgrading to Mojolicious 6.10

Removed User/Group switching

Support for switching user and group in Mojo::Server has been removed as it was untested and not correctly implemented. This also means the related user and group options have been removed:

  • Mojo::Server: user and group attributes, and setuidgid method
  • Mojo::Server::Hypnotoad: user and group configuration settings
  • daemon and prefork commands: user and group switches

There are several possible alternatives to this functionality such as the SetUserGroup plugin, see here for more information.

Upgrading to Mojolicious 6.0

Parameter name listing

Name listing support was removed from the Mojolicious::Controller and Mojo::Parameters param methods, in favor of the more appropriate Mojolicious::Parameters names method. For example, my @names = $c->param should now be written as my @names = @{$c->req->params->names}, if you wish to retrieve all GET/POST parameter names. The previous behavior of including names of placeholders and uploads has been removed. Similarly, the names of validated parameters in Mojolicious::Validator::Validation have been moved from param to passed and failed, which also now return arrayrefs instead of lists.

Multi-name parameter retrieval

Multi-name support was removed from various methods that retrieved parameters by name; these methods can only be used to retrieve one parameter at a time now. The affected methods include: Mojolicious::Controller cookie, param, and signed_cookie; Mojolicious::Validator::Validation param; Mojo::Parameters param; Mojo::Message cookie and upload.

Removed Mojo::Log methods

The log method was removed from Mojo::Log; use the individual logging methods instead (e.g. debug, info). The is_level method was also removed, use is_debug and similar methods to test the log level. The is_fatal method was removed because fatal logging is always enabled.

Mojo::UserAgent::CookieJar return values

The all and find methods now return arrayrefs instead of lists.

Removed Mojo::UserAgent custom socket support

Mojo::Transaction no longer supports receiving a prepared socket in $tx->connection, which means the UserAgent cannot be coerced into using a special socket. This is only relevant to you if you rely on UA over Unix domain sockets or similar. Sri has indicated that a patch to factor out some UA internals into Mojo::UserAgent::ConnectionPool might be a reasonable way to restore this, if you're interested.

Removed Mojo::Loader object-oriented API

The Mojo::Loader OO API has been removed, use the exported-on-demand functions data_section, find_modules, and load_class directly instead.

Exception and Not-Found rendering

The deprecated Mojolicious::Controller methods render_exception and render_not_found have been removed, use the helpers $c->reply->exception and $c->reply->not_found instead.

Removed accept mutex

The accept mutex behavior was removed from Mojo::IOLoop and Mojo::Server::Prefork for better performance, along with the related attributes and options:

  • Mojo::IOLoop: accept_interval, lock, and unlock
  • Mojo::Server::Prefork: accept_interval, lock_file, and lock_timeout
  • prefork command -a/--accept-interval, --lock-file and -L/--lock-timeout options
  • Hypnotoad settings accept_interval, lock_file, and lock_timeout

Other removals

  • Mojo::Reactor is_readable method
  • Mojolicious::Routes::Route bridge method - use under instead
  • Mojolicious::Routes auto_render method

Mojo::DOM renaming

Mojo::DOM methods have been reorganized to better match the DOM spec.

  • all_contents => descendant_nodes
  • contents => child_nodes
  • match => matches (also renamed in Mojo::DOM::CSS)
  • following_siblings => following_nodes
  • preceding_siblings => preceding_nodes
  • next_sibling => next_node
  • previous_sibling => previous_node
  • siblings => Replaced by following and preceding methods
  • node => type
  • type => tag

Other renames

  • Mojo::UserAgent::CookieJar:
  • extracting => collecting
  • extract => collect
  • inject => prepare
  • Mojo::Template: template => unparsed
  • Mojolicious::Types: types => mapping
  • Mojolicious::Routes::Match:
  • current => position
  • match => find
  • Mojolicious::Routes::Pattern: pattern => unparsed
  • Mojo::UserAgent::Proxy: inject => prepare
  • Mojo::Parameters: params => pairs
  • prefork command switch: -A => -a
  • Hypnotoad option: keep_alive_requests => requests

Upgrading to Mojolicious 5.73

Removed Mojo::JSON object-oriented API

The Mojo::JSON object-oriented API has been removed, encode_json and decode_json functions should be used instead.

Mojo::Collection changes

Mojo::Collection stringification support has been removed, use the join method instead. Mojo::Collection also no longer uses AUTOLOAD; the map method should be used for this functionality (as well as to replace the removed pluck method).

Mojo::DOM changes

Mojo::DOM no longer uses AUTOLOAD, the children method should be used instead. The val method has also been removed.

Mojo::JSON::Pointer data arguments

Mojo::JSON::Pointer methods no longer take a $data argument to specify the data structure to traverse, and only uses its data attribute.

Upgrading to Mojolicious 5.69

Static rendering

The render_static method of Mojolicious::Controller has been removed, use the $c->reply->static helper instead.

Removed methods

  • Mojo::EventEmitter: emit_safe
  • Mojolicious::Routes::Route: has_conditions

Upgrading to Mojolicious 5.48

Context sensitivity

Methods that previously worked differently in scalar than in list context now always assume scalar context, and new methods (every_*) have been added to cover the list context functionality, returning an arrayref. For example, my @things = $c->param('thing') should now be written my @things = @{$c->every_param('thing')}.

  • Mojo::Message:
  • cookie / every_cookie
  • upload / every_upload
  • Mojo::Message::Request: param / every_param
  • Mojo::Parameters: param / every_param
  • Mojolicious::Controller:
  • cookie / every_cookie
  • param / every_param
  • signed_cookie / every_signed_cookie
  • Mojolicious::Validator::Validation: param / every_param

This change addresses a security vulnerability when working with context-sensitive functions in perl; see here for more information.

Clone this wiki locally