restore documentation for lazy_build and underscore (_) prefixed operators
[gitmo/Moose.git] / lib / Moose / Manual / Delta.pod
index fb1c5a9..4a147c8 100644 (file)
@@ -16,6 +16,124 @@ 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 NEXT
+
+=over 4
+
+=item Roles have their own default attribute metaclass
+
+Previously, when a role was applied to a class, it would use the attribute
+metaclass defined in the class when copying over the attributes in the role.
+This was wrong, because for instance, using L<MooseX::FollowPBP> in the class
+would end up renaming all of the accessors generated by the role, some of which
+may be being called in the role, causing it to break. Roles now keep track of
+their own attribute metaclass to use by default when being applied to a class
+(defaulting to Moose::Meta::Attribute). This is modifiable using
+L<Moose::Util::MetaRole> by passing the C<applied_attribute> key to the
+C<role_metaroles> option, as in:
+
+    Moose::Util::MetaRole::apply_metaroles(
+        for => __PACKAGE__,
+        class_metaroles => {
+            attribute => ['My::Meta::Role::Attribute'],
+        },
+        role_metaroles => {
+            applied_attribute => ['My::Meta::Role::Attribute'],
+        },
+    );
+
+=back
+
+=head1 1.16
+
+=over 4
+
+=item Configurable stacktraces
+
+Classes which use the L<Moose::Error::Default> error class can now have
+stacktraces disabled by setting the C<MOOSE_ERROR_STYLE> env var to C<croak>.
+This is experimental, fairly incomplete, and won't work in all cases (because
+Moose's error system in general is all of these things), but this should allow
+for reducing at least some of the verbosity in most cases.
+
+=back
+
+=head1 1.15
+
+=over 4
+
+=item Native Delegations
+
+In previous versions of Moose, the Native delegations were created as
+closures. The generated code was often quite slow compared to doing the same
+thing by hand. For example, the Array's push delegation ended up doing
+something like this:
+
+  push @{ $self->$reader() }, @_;
+
+If the attribute was created without a reader, the C<$reader> sub reference
+followed a very slow code path. Even with a reader, this is still slower than
+it needs to be.
+
+Native delegations are now generated as inline code, just like other
+accessors, so we can access the slot directly.
+
+In addition, native traits now do proper constraint checking in all cases. In
+particular, constraint checking has been improved for array and hash
+references. Previously, only the I<contained> type (the C<Str> in
+C<HashRef[Str]>) would be checked when a new value was added to the
+collection. However, if there was a constraint that applied to the whole
+value, this was never checked.
+
+In addition, coercions are now called on the whole value.
+
+The delegation methods now do more argument checking. All of the methods check
+that a valid number of arguments were passed to the method. In addition, the
+delegation methods check that the arguments are sane (array indexes, hash
+keys, numbers, etc.) when applicable. We have tried to emulate the behavior of
+Perl builtins as much as possible.
+
+Finally, triggers are called whenever the value of the attribute is changed by
+a Native delegation.
+
+These changes are only likely to break code in a few cases.
+
+The inlining code may or may not preserve the original reference when changes
+are made. In some cases, methods which change the value may replace it
+entirely. This will break tied values.
+
+If you have a typed arrayref or hashref attribute where the type enforces a
+constraint on the whole collection, this constraint will now be checked. It's
+possible that code which previously ran without errors will now cause the
+constraint to fail. However, presumably this is a good thing ;)
+
+If you are passing invalid arguments to a delegation which were previously
+being ignored, these calls will now fail.
+
+If your code relied on the trigger only being called for a regular writer,
+that may cause problems.
+
+As always, you are encouraged to test before deploying the latest version of
+Moose to production.
+
+=item Defaults is and default for String, Counter, and Bool
+
+A few native traits (String, Counter, Bool) provide default values of "is" and
+"default" when you created an attribute. Allowing them to provide these values
+is now deprecated. Supply the value yourself when creating the attribute.
+
+=item The C<meta> method
+
+Moose and Class::MOP have been cleaned up internally enough to make the
+C<meta> method that you get by default optional. C<use Moose> and
+C<use Moose::Role> now can take an additional C<-meta_name> option, which
+tells Moose what name to use when installing the C<meta> method. Passing
+C<undef> to this option suppresses generation of the C<meta> method
+entirely. This should be useful for users of modules which also use a C<meta>
+method or function, such as L<Curses> or L<Rose::DB::Object>.
+
+=back
+
 =head1 1.09
 
 =over 4
@@ -34,7 +152,7 @@ Previously, this was accepted, and it sort of worked, except that if you
 attempted to set the attribute after the object was created, you would get a
 runtime error.
 
-Now you will get an error when you attempt to define the attribute.
+Now you will get a warning when you attempt to define the attribute.
 
 =item C<no Moose>, C<no Moose::Role>, and C<no Moose::Exporter> no longer unimport strict and warnings