Typo fixes
[gitmo/Moose.git] / lib / Moose / Manual / Delta.pod
CommitLineData
600f7f85 1=pod
2
3=head1 NAME
4
5Moose::Manual::Delta - Important Changes in Moose
6
7=head1 DESCRIPTION
8
9This attempts to document any important or noteworthy changes
10in Moose both good or bad. While this does duplicate data from
11the F<Changes> file it aims to provide more details and when
12possible fixes or workarounds as well.
13
14This document is a good way to keep up with important changes,
15but it can also be useful in doing things like finding the lowest
16version of Moose that supported a given feature, or as a helper
17for people upgrading Moose versions and encountering issues.
18So if you encounter a problem and have a solution but don't see
19it documented here, or think I missed an important feature, then
20please send us a patch.
21
22=head1 Version 0.73
23
24Calling subtype with a name as the only argument is now an
25exception. If you want an anonymous subtype do:
26
27 my $subtype = subtype as 'Foo';
28
29This is related to the changes in L<Version 0.71_01>.
30
31=head1 Version 0.72
32
33A mutable class accepted Foo->new(undef) without complaint,
34while an immutable class would blow up with an unhelpful
35error. Now, in both cases we throw a helpful error
36instead.
37
38This "feature" was originally added to allow for cases such
39as this:
40
41 my $args;
42 if (something()) {
43 $args = { ... };
44 }
45 return My::Class->new($args);
46
47But it has been decided that this is bad form and you should
48do what you mean more and not have Moose clean up for you.
49
50=head1 Version 0.71_01
51
52Calling type or subtype without the sugar helpers (as, where,
53message) is now deprecated. This means that code like this
54will no longer work:
55
56 use Moose::Util::TypeConstraints;
57 use Declare::Constraints::Simple -All;
58
59 subtype 'ArrayOfInts'
60 => as 'ArrayRef'
61 => IsArrayRef(IsInt);
62
63Instead it must be changed to this:
64
65 subtype('ArrayOfInts' => {
66 as => 'ArrayRef',
67 where => IsArrayRef(IsInt)
68 }
69 );
70
71If you want to maintain backwards compat in your module then
72you can just wrap it within a version test like so:
73
74 if ($Moose::VERSION < 0.72) {
75 subtype 'ArrayOfInts'
76 => as 'ArrayRef'
77 => IsArrayRef(IsInt);
78 }
79 else {
80 subtype('ArrayOfInts' => {
81 as => 'ArrayRef',
82 where => IsArrayRef(IsInt)
83 }
84 );
85 }
86
87=head1 Version 0.70
88
89We no longer pass the meta-attribute object as a final
90argument to triggers. This actually changed for inlined code a
91while back, but the non-inlined version and the docs were
92still out of date.
93
94Not sure how many people actually used this feature, but if
95you did, the workaround is pretty simple. You just fetch the
96attribute object from out of the C<$self> that is passed as
97the first argument to trigger, like so:
98
99has 'foo' => (
100 is => 'ro',
101 isa => 'Any',
102 trigger => sub {
103 my ($self, $value) = @_;
104 my $attr = $self->meta->find_attribute_by_name('foo');
105 # ...
106 }
107);
108
109=head1 Version 0.66
110
111If you created a subtype and passed a parent that Moose didn't
112know about, it simply ignored the parent. Now it automatically
113creates the parent as a class type. This may not be what you
114want, but is less broken than before.
115
116You could declare a name with subtype such as "Foo!Bar" that
117would be allowed, but if you used it in a parameterized type
118such as "ArrayRef[Foo!Bar]" it wouldn't work. We now do some
119vetting on names created via the sugar functions, so that they
120can only contain alphanumerics, ":", and ".".
121
122=head1 Version 0.65
123
124Methods created via an attribute can now fulfill a C<requires>
125declaration for a role. Honestly I don't know why I didn't make
126this work originally, I was just insane or something.
127
128Stack traces from inlined code will now report its line and
129file as being in your class, as opposed to in Moose guts.
130
131=head1 Version 0.62_02
132
133When a class does not provide all of a role's required
134methods, the error thrown now mentions all of the missing
135methods, as opposed to just the first one found.
136
137Moose will no longer inline a constructor for your class
138unless it inherits its constructor from Moose::Object, and
139will warn when it doesn't inline. If you want to force
140inlining anyway, pass "replace_constructor => 1" to
141make_immutable.
142
143=head1 Version 0.62
144
145Removed the (deprecated) make_immutable keyword.
146
147Removing an attribute from a class now also removes delegation
148(handles) methods installed for that attribute. This is correct
149behavior, but if you were wrongly relying on it you might get bit.
150
151=head1 Version 0.58
152
153Roles now add methods by calling add_method, not
154alias_method. They make sure to always provide a method
155object, which will be cloned internally. This means that it is
156now possible to track the source of a method provided by a
157role, and even follow its history through intermediate roles.
158This means that methods added by a role now show up when
159looking at a class's method list/map.
160
161Parameter and Union args are now sorted, this makes Int|Str
162the same constraint as Str|Int. Incoming type constraint strings
163also are normalized to remove all whitespace differences. This is
164all mostly just for internals and should not affect outside code.
165
166Moose::Exporter will no longer remove a subroutine that the
167exporting package re-exports. Moose re-exports the
168Carp::confess function, among others. The reasoning is that we
169cannot know whether you have also explicitly imported those
170functions for your own use, so we err on the safe side and
171always keep them.
172
173=head1 Version 0.56
174
175Moose::init_meta should now be called as a method.
176
177New modules for extension writers, Moose::Exporter and
178Moose::Util::MetaRole.
179
180=head1 Version 0.55_01
181
182Implemented metaclass traits (and wrote a recipe for it):
183
184 use Moose -traits => 'Foo'
185
186This should make writing small Moose extensions a little
187easier.
188
189=head1 Version 0.55
190
191Fixed C<coerce> to accept anon types just like C<subtype> can.
192So that you can do:
193
194 coerce $some_anon_type => from 'Str' => via { ... };
195
196=head1 Version 0.51
197
198Added BUILDARGS, a new step in Moose::Object::new().
199
200=head1 Version 0.49
201
202Fixed how the C<is =E<gt> (ro|rw)> works with custom defined
203reader, writer and accessor options. See the below table for
204details:
205
206 is => ro, writer => _foo # turns into (reader => foo, writer => _foo)
207 is => rw, writer => _foo # turns into (reader => foo, writer => _foo)
208 is => rw, accessor => _foo # turns into (accessor => _foo)
209 is => ro, accessor => _foo # error, accesor is rw
210
211=head1 Version 0.45
212
213The C<before/around/after> method modifiers now support regexp matching
214of method names. NOTE: this only works for classes, it is currently not
215supported in roles, but, ... patches welcome.
216
217The C<has> keyword for roles now accepts the same array ref form that
218Moose.pm does for classes.
219
220A trigger on a ro-attribute is no longer an error, as it's useful to
221trigger off of the constructor.
222
223Subtypes of parameterizable types now are themselves parameterizable
224types.
225
226=head1 Version 0.44
227
228Fixed issue where DEMOLISHALL was eating the C<$@> values, and so not
229working correctly, it still kind of eats them, but so does vanilla perl.
230
231=head1 Version 0.41
232
233Inherited attributes may now be extended without restriction on the
234type ('isa', 'does').
235
236The entire set of Moose::Meta::TypeConstraint::* classes got refactored in
237this release, chances are if you were relying on their internals you might
238want to check on them.
239
240=head1 Version 0.40
241
242Documenting the use of '+name' with attributes that come from recently
243composed roles. It makes sense, people are using it, and so why not just
244officially support it.
245
246The C<Moose::Meta::Class::create> method which now supports roles too.
247
248It is now possible to make anon-enums by passing 'enum' an ARRAY ref instead
249of the $name => @values.
250
251=head1 Version 0.37
252
253Added the 'make_immutable' keyword as a shortcut to calling make_immutable on
254the meta object. However, this eventually gets removed again, but this is where
255the trouble began.
256
257Making (init_arg => undef) work in Moose. This basically means "do not accept
258a constructor parameter for this attribute".
259
260Making type errors use the assigned message, prior to this they didn't.
261
262=head1 Version 0.34
263
264Moose is now a postmodern object system :)
265
266The Role system was completely refactored. It is 100% backwards compat, but the
a2bc3729 267internals are totally changed. So if you relied on the internals then you might
600f7f85 268want to check this one out.
269
270Added method exclusion and aliasing for Roles in this release.
271
272Added the L<Moose::Util::TypeConstraints::OptimizedConstraints> module.
273
274Passing a list of values to an accessor (which is only expecting one value) used
275to be silently ignored, now it throws an error.
276
277=head1 Version 0.26
278
279Added parameterized types and so did a pretty heavy refactoring of the type
280constraint system.
281
282Better framework extendability and better support for "making your own Moose".
283
284=head1 Version 0.25 or before
285
286Honestly, you shouldn't be using versions of Moose that are this old, so many
287bug fixes and speed improvements have been made you would be crazy to not
288upgrade.
289
a2bc3729 290Also, I am tired of going through the Changelog so I am stopping here, if
600f7f85 291anyone would like to continue this please feel free.
292
293=head1 AUTHOR
294
295Stevan Little E<lt>stevan@iinteractive.comE<gt>
296
297=head1 COPYRIGHT AND LICENSE
298
299Copyright 2009 by Infinity Interactive, Inc.
300
301L<http://www.iinteractive.com>
302
303This library is free software; you can redistribute it and/or modify
304it under the same terms as Perl itself.
305
306=cut