Skip to content

Commit

Permalink
Release preparations for 10.0
Browse files Browse the repository at this point in the history
kraih committed Dec 6, 2024
1 parent 2376b90 commit 2292890
Showing 13 changed files with 36 additions and 45 deletions.
13 changes: 12 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@

9.40 2024-11-24
10.0 2024-12-26
- Code name "...", this is a major release.
- Removed deprecated support for "'" package separators.
- Removed deprecated support for ?format=* parameter in favor of ?_format=* for content negotiation.
- Removed deprecated support for padded session cookies.
- Removed experimental status from top-level await support in Mojo::Promise.
- Removed experimental status from encrypted session cookie support.
- Removed experimental status from persistent cookie support.
- Removed experimental status from samesite cookie support.
- Removed experimental status from colourful log messages.
- Removed experimental status from freeze option in Mojo::IOLoop.
- Removed experimental status from check and raise functions in Mojo::Exception.

9.39 2024-11-23
- Added EXPERIMENTAL support for encrypted session cookies.
3 changes: 1 addition & 2 deletions lib/Mojo/Base.pm
Original file line number Diff line number Diff line change
@@ -249,8 +249,7 @@ signatures|perlsub/"Signatures">.
use Mojo::Base -role, -signatures;
If you have L<Future::AsyncAwait> 0.52+ installed you can also use the C<-async_await> flag to activate the C<async>
and C<await> keywords to deal much more efficiently with promises. Note that this feature is B<EXPERIMENTAL> and might
change without warning!
and C<await> keywords to deal much more efficiently with promises.
# Also enable async/await
use Mojo::Base -strict, -async_await;
4 changes: 1 addition & 3 deletions lib/Mojo/Cookie/Response.pm
Original file line number Diff line number Diff line change
@@ -135,9 +135,7 @@ Cookie path.
my $samesite = $cookie->samesite;
$cookie = $cookie->samesite('Lax');
SameSite value. Note that this attribute is B<EXPERIMENTAL> because even though most commonly used browsers support the
feature, there is no specification yet besides L<this
draft|https://tools.ietf.org/html/draft-west-first-party-cookies-07>.
SameSite value.
=head2 secure
5 changes: 2 additions & 3 deletions lib/Mojo/Exception.pm
Original file line number Diff line number Diff line change
@@ -196,7 +196,7 @@ L<Mojo::Exception> implements the following functions, which can be imported ind
my $bool = check $err => ['MyApp::X::Foo' => sub {...}];
Process exceptions by dispatching them to handlers with one or more matching conditions. Exceptions that could not be
handled will be rethrown automatically. Note that this function is B<EXPERIMENTAL> and might change without warning!
handled will be rethrown automatically.
# Handle various types of exceptions
eval {
@@ -249,8 +249,7 @@ handler matched.
raise 'MyApp::X::Foo', 'Something went wrong!';
Raise a L<Mojo::Exception>, if the class does not exist yet (classes are checked for a C<new> method), one is created
as a L<Mojo::Exception> subclass on demand. Note that this function is B<EXPERIMENTAL> and might change without
warning!
as a L<Mojo::Exception> subclass on demand.
=head1 ATTRIBUTES
3 changes: 1 addition & 2 deletions lib/Mojo/IOLoop.pm
Original file line number Diff line number Diff line change
@@ -432,8 +432,7 @@ These options are currently available:
freeze => 1
Freeze the current state of the event loop in time before resetting it. This will prevent active connections from
getting closed immediately, which can help with many unintended side effects when processes are forked. Note that this
option is B<EXPERIMENTAL> and might change without warning!
getting closed immediately, which can help with many unintended side effects when processes are forked.
=back
5 changes: 1 addition & 4 deletions lib/Mojo/Loader.pm
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ use Mojo::Base -strict;
use Exporter qw(import);
use Mojo::Exception;
use Mojo::File qw(path);
use Mojo::Util qw(b64_decode class_to_path deprecated);
use Mojo::Util qw(b64_decode class_to_path);

our @EXPORT_OK = qw(data_section file_is_binary find_modules find_packages load_class load_classes);

@@ -42,9 +42,6 @@ sub load_class {

# Invalid class name
return 1 if ($class || '') !~ /^\w(?:[\w:']*\w)?$/;
deprecated
q{Calling Mojo::Loader::load_class with a class name using the old package separator "'" is deprecated; use "::"}
if $class =~ m/'/;

# Load if not already loaded
return undef if $class->can('new') || eval "require $class; 1";
3 changes: 1 addition & 2 deletions lib/Mojo/Log.pm
Original file line number Diff line number Diff line change
@@ -193,8 +193,7 @@ L<Mojo::Log> implements the following attributes.
$log = $log->color($bool);
Colorize log messages with the levels C<warn>, C<error> and C<fatal> using L<Term::ANSIColor>, defaults to the value of
the C<MOJO_LOG_COLOR> environment variables. Note that this attribute is B<EXPERIMENTAL> and might change without
warning!
the C<MOJO_LOG_COLOR> environment variables.
=head2 format
9 changes: 4 additions & 5 deletions lib/Mojo/UserAgent/CookieJar.pm
Original file line number Diff line number Diff line change
@@ -215,8 +215,7 @@ L<Mojo::UserAgent::CookieJar> implements the following attributes.
my $file = $jar->file;
$jar = $jar->file('/home/sri/cookies.txt');
File to L</"load"> cookies from and L</"save"> cookies to in Netscape format. Note that this attribute is
B<EXPERIMENTAL> and might change without warning!
File to L</"load"> cookies from and L</"save"> cookies to in Netscape format.
# Save cookies to file
$jar->file('cookies.txt')->save;
@@ -291,7 +290,7 @@ Find L<Mojo::Cookie::Request> objects in the jar for L<Mojo::URL> object.
$jar = $jar->load;
Load cookies from L</"file">. Note that this method is B<EXPERIMENTAL> and might change without warning!
Load cookies from L</"file">.
=head2 prepare
@@ -303,13 +302,13 @@ Prepare request cookies for transaction.
$jar = $jar->save;
Save cookies to L</"file">. Note that this method is B<EXPERIMENTAL> and might change without warning!
Save cookies to L</"file">.
=head2 to_string
my $string = $jar->to_string;
Stringify cookies in Netscape format. Note that this method is B<EXPERIMENTAL> and might change without warning!
Stringify cookies in Netscape format.
=head1 SEE ALSO
8 changes: 3 additions & 5 deletions lib/Mojo/Util.pm
Original file line number Diff line number Diff line change
@@ -678,8 +678,7 @@ Decode bytes to characters with L<Encode>, or return C<undef> if decoding failed
my $value = decrypt_cookie $encrypted, 'passw0rd', 'salt';
Decrypt cookie value encrypted with L</encrypt_cookie>, returns the decrypted value or C<undef>. Note that this
function is B<EXPERIMENTAL> and might change without warning!
Decrypt cookie value encrypted with L</encrypt_cookie>, returns the decrypted value or C<undef>.
=head2 deprecated
@@ -704,7 +703,7 @@ Encode characters to bytes with L<Encode>.
my $encrypted = encrypt_cookie $value, 'passw0rd', 'salt';
Encrypt cookie value. Note that this function is B<EXPERIMENTAL> and might change without warning!
Encrypt cookie value.
=head2 extract_usage
@@ -728,7 +727,7 @@ function was called from.
my $secret = generate_secret;
Generate a random secret with a cryptographically secure random number generator if available, and a less secure
fallback if not. Note that this function is B<EXPERIMENTAL> and might change without warning!
fallback if not.
=head2 getopt
@@ -769,7 +768,6 @@ Compress bytes with L<IO::Compress::Gzip>.
my ($params, $remainder) = header_params 'one=foo; two="bar", three=baz';
Extract HTTP header field parameters until the first comma according to L<RFC 5987|http://tools.ietf.org/html/rfc5987>.
Note that this function is B<EXPERIMENTAL> and might change without warning!
=head2 hmac_sha1_sum
4 changes: 2 additions & 2 deletions lib/Mojolicious.pm
Original file line number Diff line number Diff line change
@@ -56,8 +56,8 @@ has types => sub { Mojolicious::Types->new };
has ua => sub { Mojo::UserAgent->new };
has validator => sub { Mojolicious::Validator->new };

our $CODENAME = 'Waffle';
our $VERSION = '9.40';
our $CODENAME = '...';
our $VERSION = '10.0';

sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
4 changes: 2 additions & 2 deletions lib/Mojolicious/Controller.pm
Original file line number Diff line number Diff line change
@@ -441,7 +441,7 @@ you want to access more than just the last one, you can use L</"every_cookie">.
Access encrypted request cookie values and create new encrypted response cookies. If there are multiple values sharing
the same name, and you want to access more than just the last one, you can use L</"every_encrypted_cookie">. Cookies
are encrypted with ChaCha20-Poly1305, to prevent tampering, and the ones failing decryption will be automatically
discarded. Note that this method is B<EXPERIMENTAL> and might change without warning!
discarded.
=head2 every_cookie
@@ -457,7 +457,7 @@ Similar to L</"cookie">, but returns all request cookie values sharing the same
my $values = $c->every_encrypted_cookie('foo');
Similar to L</"encrypted_cookie">, but returns all encrypted request cookie values sharing the same name as an array
reference. Note that this method is B<EXPERIMENTAL> and might change without warning!
reference.
# Get first encrypted cookie value
my $first = $c->every_encrypted_cookie('foo')->[0];
10 changes: 3 additions & 7 deletions lib/Mojolicious/Renderer.pm
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ use Mojo::DynamicMethods;
use Mojo::File qw(curfile path);
use Mojo::JSON qw(encode_json);
use Mojo::Loader qw(data_section);
use Mojo::Util qw(decamelize deprecated encode gzip md5_sum monkey_patch);
use Mojo::Util qw(decamelize encode gzip md5_sum monkey_patch);

has cache => sub { Mojo::Cache->new };
has classes => sub { ['main'] };
@@ -27,13 +27,9 @@ sub DESTROY { Mojo::Util::_teardown($_) for @{shift->{namespaces}} }
sub accepts {
my ($self, $c) = (shift, shift);

# DEPRECATED!
my $req = $c->req;
my $param = $req->param('format');
deprecated 'The ?format=* parameter is deprecated in favor of ?_format=* for content negotiation' if defined $param;

# List representations
my $fmt = $param // $req->param('_format') || $c->stash->{format};
my $req = $c->req;
my $fmt = $req->param('_format') || $c->stash->{format};
my @exts = $fmt ? ($fmt) : ();
push @exts, @{$c->app->types->detect($req->headers->accept)};
return \@exts unless @_;
10 changes: 3 additions & 7 deletions lib/Mojolicious/Sessions.pm
Original file line number Diff line number Diff line change
@@ -63,8 +63,7 @@ sub store {
$c->$method($self->cookie_name, $value, $options);
}

# DEPRECATED! (Remove once old sessions with padding are no longer a concern)
sub _deserialize { Mojo::JSON::decode_json($_[0] =~ s/\}\KZ*$//r) }
sub _deserialize { Mojo::JSON::decode_json($_[0]) }

sub _serialize { Mojo::JSON::encode_json($_[0]) }

@@ -147,17 +146,14 @@ A callback used to deserialize sessions, defaults to L<Mojo::JSON/"j">.
my $bool = $sessions->encrypted;
$sessions = $sessions->encrypted($bool);
Use encrypted session cookies instead of merely cryptographically signed ones. Note that this attribute is
B<EXPERIMENTAL> and might change without warning!
Use encrypted session cookies instead of merely cryptographically signed ones.
=head2 samesite
my $samesite = $sessions->samesite;
$sessions = $sessions->samesite('Strict');
Set the SameSite value on all session cookies, defaults to C<Lax>. Note that this attribute is B<EXPERIMENTAL> because
even though most commonly used browsers support the feature, there is no specification yet besides L<this
draft|https://tools.ietf.org/html/draft-west-first-party-cookies-07>.
Set the SameSite value on all session cookies, defaults to C<Lax>.
# Disable SameSite feature
$sessions->samesite(undef);

0 comments on commit 2292890

Please sign in to comment.