X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FManual%2FDelta.pod;h=93fd31b676b36709c3a2617eac5dc0d9b3674116;hb=aee0741bbed3076af07a989bd8fb2362cc1d4711;hp=c5dc50bf23c7fd20882519926b44f4f382cb5586;hpb=fbf7ba85ac7e8501afa88682f7ffdf67eaee7d58;p=gitmo%2FMoose.git diff --git a/lib/Moose/Manual/Delta.pod b/lib/Moose/Manual/Delta.pod index c5dc50b..93fd31b 100644 --- a/lib/Moose/Manual/Delta.pod +++ b/lib/Moose/Manual/Delta.pod @@ -16,9 +16,317 @@ feature. If you encounter a problem and have a solution but don't see it documented here, or think we missed an important feature, please send us a patch. -=head1 Version 0.80 +=head1 1.09 -Update test suite for subname change in Class::MOP +=item C, C, and C no longer unimport strict and warnings + +This change was made in 1.05, and has now been reverted. We don't know if the +user has explicitly loaded strict or warnings outside on their own, and +unimporting them is just broken in that case. + +=head1 1.05 + +=over 4 + +=item L methods are now called when calling C + +Previously, C methods would only be called from C, +but now they are also called when constructing an object via +C. C methods are an inherent part of the +object construction process, and this should make C<< $meta->new_object >> +actually usable without forcing people to use C<< $meta->name->new >>. + +=item C, C, and C now unimport strict and warnings + +In the interest of having C clean up everything that C +does in the calling scope, C (as well as all other +L-using modules) now unimports strict and warnings. + +=item Metaclass compatibility checking and fixing should be much more robust + +The L checking +and fixing algorithms have been completely rewritten, in both Class::MOP and +Moose. This should resolve many confusing errors when dealing with non-Moose +inheritance and with custom metaclasses for things like attributes, +constructors, etc. For correct code, the only thing that should require a +change is that custom error metaclasses must now inherit from +L. + +=back + +=head1 1.02 + +=over 4 + +=item Moose::Meta::TypeConstraint::Class is_subtype_of behavior + +Earlier versions of L +would incorrectly return true when called with itself, its own TC name or +its class name as an argument. (i.e. $foo_tc->is_subtype_of('Foo') == 1) This +behavior was a caused by C being checked before the class name. The old +behavior can be accessed with L + +=back + +=head1 1.00 + +=over 4 + +=item Moose::Meta::Attribute::Native::Trait::Code no longer creates reader methods by default + +Earlier versions of L created +read-only accessors for the attributes it's been applied to, even if you didn't +ask for it with C<< is => 'ro' >>. This incorrect behaviour has now been fixed. + +=back + +=head1 0.95 + +=over 4 + +=item Moose::Util add_method_modifier behavior + +add_method_modifier (and subsequently the sugar functions Moose::before, +Moose::after, and Moose::around) can now accept arrayrefs, with the same +behavior as lists. Types other than arrayref and regexp result in an error. + +=back + +=head1 0.93_01 and 0.94 + +=over 4 + +=item Moose::Util::MetaRole API has changed + +The C function is now called C. The +way arguments are supplied has been changed to force you to distinguish +between metaroles applied to L (and helpers) versus +L. + +The old API still works, but will warn in a future release, and eventually be +removed. + +=item Moose::Meta::Role has real attributes + +The attributes returned by L are now instances of the +L class, instead of bare hash references. + +=item "no Moose" now removes C and C + +Moose is now smart enough to know exactly what it exported, even when it +re-exports functions from other packages. When you unimport Moose, it will +remove these functions from your namespace unless you I imported them +directly from their respective packages. + +If you have a C in your code I you call C or +C, your code will break. You can either move the C call +later in your code, or explicitly import the relevant functions from the +packages that provide them. + +=item L is smarter about unimporting re-exports + +The change above comes from a general improvement to L. It +will now unimport any function it exports, even if that function is a +re-export from another package. + +=item Attributes in roles can no longer override class attributes with "+foo" + +Previously, this worked more or less accidentally, because role attributes +weren't objects. This was never documented, but a few MooseX modules took +advantage of this. + +=item The composition_class_roles attribute in L is now a method + +This was done to make it possible for roles to alter the the list of +composition class roles by applying a method modifiers. Previously, this was +an attribute and MooseX modules override it. Since that no longer works, this +was made a method. + +This I be an attribute, so this may switch back to being an attribute +in the future if we can figure out how to make this work. + +=back + +=head1 0.93 + +=over 4 + +=item Calling $object->new() is no longer deprecated + +We decided to undeprecate this. Now it just works. + +=item Both C and C is deprecated + +These metaclass methods were never meant to be public, and they are both now +deprecated. The work around if you still need the functionality they provided +is to iterate over the list of names manually. + + my %fields = map { $_ => $meta->get_attribute($_) } $meta->get_attribute_list; + +This was actually a change in L, but this version of Moose +requires a version of L that includes said change. + +=back + +=head1 0.90 + +=over 4 + +=item Added Native delegation for Code refs + +See L for details. + +=item Calling $object->new() is deprecated + +Moose has long supported this, but it's never really been documented, and we +don't think this is a good practice. If you want to construct an object from +an existing object, you should provide some sort of alternate constructor like +C<< $object->clone >>. + +Calling C<< $object->new >> now issues a warning, and will be an error in a +future release. + +=item Moose no longer warns if you call C for a class with mutable ancestors + +While in theory this is a good thing to warn about, we found so many +exceptions to this that doing this properly became quite problematic. + +=back + +=head1 Version 0.89_02 + +=over 4 + +=item New Native delegation methods from L and L + +In particular, we now have C, C, C, and C. + +=item The Moose::Exporter with_caller feature is now deprecated + +Use C instead. The C option will start warning in a +future release. + +=item Moose now warns if you call C for a class with mutable ancestors + +This is dangerous because modifying a class after a subclass has been +immutabilized will lead to incorrect results in the subclass, due to inlining, +caching, etc. This occasionally happens accidentally, when a class loads one +of its subclasses in the middle of its class definition, so pointing out that +this may cause issues should be helpful. Metaclasses (classes that inherit +from L) are currently exempt from this check, since at the +moment we aren't very consistent about which metaclasses we immutabilize. + +=item C and C now take arrayrefs for all forms + +Previously, calling these functions with a list would take the first element of +the list as the type constraint name, and use the remainder as the enum values +or method names. This makes the interface inconsistent with the anon-type forms +of these functions (which must take an arrayref), and a free-form list where +the first value is sometimes special is hard to validate (and harder to give +reasonable error messages for). These functions have been changed to take +arrayrefs in all their forms - so, C<< enum 'My::Type' => [qw(foo bar)] >> is +now the preferred way to create an enum type constraint. The old syntax still +works for now, but it will hopefully be deprecated and removed in a future +release. + +=back + +=head1 Version 0.89_01 + +L has been moved into the Moose core from +L. Major changes include: + +=over 4 + +=item C, not C + +Method providers are only available via traits. + +=item C, not C or C + +The C syntax was like core Moose C<< handles => HASHREF >> +syntax, but with the keys and values reversed. This was confusing, +and AttributeHelpers now uses C<< handles => HASHREF >> in a way that +should be intuitive to anyone already familiar with how it is used for +other attributes. + +The C functionality provided by AttributeHelpers has been +generalized to apply to all cases of C<< handles => HASHREF >>, though +not every piece of functionality has been ported (currying with a +CODEREF is not supported). + +=item C is now C, and means empty, not non-empty + +Previously, the C method provided by Arrays and Hashes returned true if +the attribute was B empty (no elements). Now it returns true if the +attribute B empty. It was also renamed to C, to reflect this. + +=item C was renamed to C, and C and C were removed + +L refers to the functionality that we used to provide under C +as L, so that will likely be more familiar (and will +fit in better if we decide to add more List::Util functions). C and +C were removed, since their functionality is easily duplicated with +curries of C. + +=item Helpers that take a coderef of one argument now use C<$_> + +Subroutines passed as the first argument to C, C, and C now +receive their argument in C<$_> rather than as a parameter to the subroutine. +Helpers that take a coderef of two or more arguments remain using the argument +list (there are technical limitations to using C<$a> and C<$b> like C +does). + +See L for the new documentation. + +=back + +The C and C role parameters have been renamed to C<-alias> +and C<-excludes>. The old names still work, but new code should use the new +names, and eventually the old ones will be deprecated and removed. + +=head1 Version 0.89 + +C<< use Moose -metaclass => 'Foo' >> now does alias resolution, just like +C<-traits> (and the C and C options to C). + +Added two functions C and C to +L, to simplify aliasing metaclasses and metatraits. This is +a wrapper around the old + + package Moose::Meta::Class::Custom::Trait::FooTrait; + sub register_implementation { 'My::Meta::Trait' } + +way of doing this. + +=head1 Version 0.84 + +When an attribute generates I accessors, we now warn. This is to help +users who forget the C option. If you really do not want any accessors, +you can use C<< is => 'bare' >>. You can maintain back compat with older +versions of Moose by using something like: + + ($Moose::VERSION >= 0.84 ? is => 'bare' : ()) + +When an accessor overwrites an existing method, we now warn. To work around +this warning (if you really must have this behavior), you can explicitly +remove the method before creating it as an accessor: + + sub foo {} + + __PACKAGE__->meta->remove_method('foo'); + + has foo => ( + is => 'ro', + ); + +When an unknown option is passed to C, we now warn. You can silence +the warning by fixing your code. :) + +The C type has been deprecated. On its own, it was useless, +since it just checked C<< $object->can('does') >>. If you were using +it as a parent type, just call C to create an +appropriate type instead. =head1 Version 0.78 @@ -186,7 +494,7 @@ just the first missing method. Moose will no longer inline a constructor for your class unless it inherits its constructor from Moose::Object, and will warn when it doesn't inline. If you want to force inlining anyway, pass -C<< "replace_constructor => 1 >> to C. +C<< replace_constructor => 1 >> to C. If you want to get rid of the warning, pass C<< inline_constructor => 0 >>.