Explain attributes and subclassing
[gitmo/Moose.git] / Changes
CommitLineData
e522431d 1Revision history for Perl extension Moose
2
c899258b 30.19
4 * Moose::Util::TypeConstraints
5 - type now supports messages as well
6 (thanks to phaylon for finding this)
7 - added tests for this
943596a6 8 - added list_all_type_constraints and
9 list_all_builtin_type_constraints
10 functions to facilitate introspection.
c899258b 11
af5199c6 120.18 Sat. March 10, 2007
13 ~~ Many, many documentation updates ~~
1eaed09d 14
15 - We now use Class::MOP::load_class to
16 load all classes.
b77fdbed 17
587ae0d2 180.18_001
d01f1dab 19 !! You must have Class::MOP 0.37_001 !!
20 !! for this developer release to work !!
21
734d1752 22 This release was primarily adding the immutable
23 feature to Moose. An immutable class is one which
24 you promise not to alter. When you set the class
25 as immutable it will perform various bits of
26 memoization and inline certain part of the code
27 (constructors, destructors and accessors). This
28 minimizes (and in some cases totally eliminates)
29 one of Moose's biggest performance hits. This
30 feature is not on by default, and is 100% optional.
31 It has several configurable bits as well, so you
32 can pick and choose to your specific needs.
33
34 The changes involved in this were fairly wide and
35 highly specific, but 100% backwards compatible, so
36 I am not going to enumerate them here. If you are
37 truely interested in what was changed, please do
38 a diff :)
587ae0d2 39
400.17 Tues. Nov. 14, 2006
41 * Moose::Meta::Method::Accessor
42 - bugfix for read-only accessors which
43 are have a type constraint and lazy.
44 Thanks to chansen for finding it.
45
460.16 Tues. Nov. 14, 2006
47 ++ NOTE ++
48 There are some speed improvements in this release,
49 but they are only the begining, so stay tuned.
50
51 * Moose::Object
52 - BUILDALL and DEMOLISHALL no longer get
53 called unless they actually need to be.
54 This gave us a signifigant speed boost
55 for the cases when there is no BUILD or
56 DEMOLISH method present.
57
58 * Moose::Util::TypeConstraints
59 * Moose::Meta::TypeConstraint
60 - added an 'optimize_as' option to the
61 type constraint, which allows for a
62 hand optimized version of the type
63 constraint to be used when possible.
64 - Any internally created type constraints
65 now provide an optimized version as well.
66
ecb59493 670.15 Sun. Nov. 5, 2006
946289d1 68 ++ NOTE ++
69 This version of Moose *must* have Class::MOP 0.36 in order
70 to work correctly. A number of small internal tweaks have
71 been made in order to be compatible with that release.
571dd39f 72
73 * Moose::Util::TypeConstraints
74 - added &unimport so that you can clean out
75 your class namespace of these exported
76 keywords
77
37ee30c9 78 * Moose::Meta::Class
79 - fixed minor issue which occasionally
80 comes up during global destruction
81 (thanks omega)
946289d1 82 - moved Moose::Meta::Method::Overriden into
83 its own file.
84
85 * Moose::Meta::Role
86 - moved Moose::Meta::Role::Method into
87 its own file.
88
43123819 89 * Moose::Meta::Attribute
90 - changed how we do type checks so that
7623f774 91 we reduce the overall cost, but still
92 retain correctness.
946289d1 93 *** API CHANGE ***
94 - moved accessor generation methods to
95 Moose::Meta::Method::Accessor to
96 conform to the API changes from
97 Class::MOP 0.36
43123819 98
99 * Moose::Meta::TypeConstraint
100 - changed how constraints are compiled
101 so that we do less recursion and more
102 iteration. This makes the type check
103 faster :)
946289d1 104 - moved Moose::Meta::TypeConstraint::Union
105 into its own file
106
107 * Moose::Meta::Method::Accessor
108 - created this from methods formerly found in
109 Moose::Meta::Attribute
110
111 * Moose::Meta::Role::Method
112 - moved this from Moose::Meta::Role
113
114 * Moose::Meta::Method::Overriden
115 - moved this from Moose::Meta::Class
116
117 * Moose::Meta::TypeConstraint::Union
118 - moved this from Moose::Meta::TypeConstraint
37ee30c9 119
3ec7b7a3 1200.14 Mon. Oct. 9, 2006
4fd69d6c 121
122 * Moose::Meta::Attribute
123 - fixed lazy attributes which were not getting
124 checked with the type constraint (thanks ashley)
125 - added tests for this
3ec7b7a3 126 - removed the over-enthusiastic DWIMery of the
127 automatic ArrayRef and HashRef defaults, it
128 broke predicates in an ugly way.
129 - removed tests for this
4fd69d6c 130
c0c41f76 1310.13 Sat. Sept. 30, 2006
093b12c2 132 ++ NOTE ++
133 This version of Moose *must* have Class::MOP 0.35 in order
134 to work correctly. A number of small internal tweaks have
135 been made in order to be compatible with that release.
136
3c2bc5e2 137 * Moose
138 - Removed the use of UNIVERSAL::require to be a better
093b12c2 139 symbol table citizen and remove a dependency
140 (thanks Adam Kennedy)
3c2bc5e2 141
2a0f3bd3 142 **~~ removed experimental & undocumented feature ~~**
143 - commented out the 'method' and 'self' keywords, see the
144 comments for more info.
145
e95c7c42 146 * Moose::Cookbook
147 - added a FAQ and WTF files to document frequently
148 asked questions and common problems
b805c70c 149
3f7376b0 150 * Moose::Util::TypeConstraints
0a5bd159 151 - added GlobRef and FileHandle type constraint
3f7376b0 152 - added tests for this
153
154 * Moose::Meta::Attribute
155 - if your attribute 'isa' ArrayRef of HashRef, and you have
156 not explicitly set a default, then make the default DWIM.
94b8bbb8 157 This will also work for subtypes of ArrayRef and HashRef
158 as well.
159 - you can now auto-deref subtypes of ArrayRef or HashRef too.
160 - new test added for this (thanks to ashley)
3f7376b0 161
b805c70c 162 * Moose::Meta::Role
163 - added basic support for runtime role composition
0a5bd159 164 but this is still *highly experimental*, so feedback
165 is much appreciated :)
b805c70c 166 - added tests for this
e95c7c42 167
0a5bd159 168 * Moose::Meta::TypeConstraint
169 - the type constraint now handles the coercion process
170 through delegation, this is to support the coercion
171 of unions
172
173 * Moose::Meta::TypeConstraint::Union
174 - it is now possible for coercions to be performed
175 on a type union
176 - added tests for this (thanks to konobi)
177
e95c7c42 178 * Moose::Meta::TypeCoercion
179 - properly capturing error when type constraint
180 is not found
181
3c2bc5e2 182 * Build.PL
183 - Scalar::Util 1.18 is bad on Win32, so temporarily
184 only require version 1.17 for Win32 and cygwin.
093b12c2 185 (thanks Adam Kennedy)
3c2bc5e2 186
40e89659 1870.12 Sat. Sept. 1, 2006
2bdd01cd 188 * Moose::Cookbook
189 - Recipe5 (subtypes & coercion) has been written
190
191 * Moose
3279ab4a 192 - fixed "bad meta" error message to be more descriptive
193 - fixed &unimport to not remove the &inner and &super
194 keywords because we need to localize them.
68efb014 195 - fixed number of spelling/grammer issues, thanks Theory :)
0558683c 196
197 **~~ experimental & undocumented feature ~~**
68efb014 198 - added the method and self keywords, they are basically
199 just sugar, and they may not stay around.
f742dfef 200
201 * Moose::Object
68efb014 202 - added &dump method to easily Data::Dumper
203 an object
b26e162e 204
205 * Moose::Meta::TypeConstraint
206 - added the &is_a_type_of method to check both the current
207 and the subtype of a method (similar to &isa with classes)
f008ac1f 208
68efb014 209 * Moose::Meta::Role
210 - this is now a subclass of Class::MOP::Module, and no longer
211 creates the _role_meta ugliness of before.
212 - fixed tests to reflect this change
213
8c835eba 2140.11 Wed. July 12, 2006
31f8ec72 215 * Moose
216 - added an &unimport method to remove all the keywords
8c835eba 217 that Moose will import, simply add 'no Moose' to the
218 bottom of your class file.
31f8ec72 219
220 * t/
221 - fixed some test failures caused by a forgotten test
222 dependency.
223
864cd714 2240.10 Thurs. July 6, 2006
01a8e221 225 * Moose
226 - improved error message when loading modules so
227 it is less confusing when you load a role.
2b14ac61 228 - added &calculate_all_roles method to
229 Moose::Meta::Class and Moose::Meta::Role
230
231 NOTE:
232 This module has been tested against Class::MOP 0.30
233 but it does not yet utilize the optimizations
234 it makes available. Stay tuned for that ;)
235
2b14ac61 2360.09_03 Fri. June 23, 2006
715ea0b7 237 ++ DEVELOPER RELEASE ++
4276ccb4 238 * Moose
239 - 'use strict' and 'use warnings' are no longer
240 needed in Moose classes, Moose itself will
241 turn them on for you.
242 - added tests for this
1341f10c 243 - moved code from exported subs to private methods
244 in Moose::Meta::Class
4276ccb4 245
246 * Moose::Role
247 - as with Moose, strict and warnings are
248 automatically turned on for you.
249 - added tests for this
e39d707f 250
251 * Moose::Meta::Role
252 - now handles an edge case for override errors
253 - added tests for this
b7f2d25b 254 - added some more edge case tests
1341f10c 255
43d599e5 2560.09_02 Tues. May 16, 2006
715ea0b7 257 ++ DEVELOPER RELEASE ++
2c0cbef7 258 * Moose
259 - added prototypes to the exported subs
43d599e5 260 - updated docs
2c0cbef7 261
262 * Moose::Role
263 - added prototypes to the exported subs
43d599e5 264 - updated docs
2c0cbef7 265
266 * Moose::Util::TypeConstraints
267 - cleaned up prototypes for the subs
43d599e5 268 - updated docs
2c0cbef7 269
72c4f6d1 2700.09_01 Fri. May 12, 2006
271 ++ DEVELOPER RELEASE ++
272 - This release works in combination with
273 Class::MOP 0.29_01, it is a developer
274 release because it uses the a new
275 instance sub-protocol and a fairly
276 complete Role implementation. It has
277 not yet been optimized, so it slower
278 the the previous CPAN version. This
279 release also lacks good updated docs,
280 the official release will have updated docs.
281
98aae381 282 * Moose
283 - refactored the keyword exports
db1ab48d 284 - 'with' now checks Role validaity and
285 accepts more than one Role at a time
98aae381 286 - 'extends' makes metaclass adjustments as
287 needed to ensure metaclass compatability
288
72c4f6d1 289 * Moose::Role
290 - refactored the keyword exports
291 - 'with' now checks Role validaity and
292 accepts more than one Role at a time
293
98aae381 294 * Moose::Util::TypeConstraints
295 - added the 'enum' keyword for simple
296 string enumerations which can be used as
297 type constraints
db1ab48d 298 - see example of usage in t/202_example.t
98aae381 299
300 * Moose::Object
301 - more careful checking of params to new()
302
72c4f6d1 303 * Moose::Meta::Role
304 - much work done on the role composition
305 - many new tests for conflict detection
306 and composition edge cases
307 - not enough documentation, I suggest
308 looking at the tests
309
98aae381 310 * Moose::Meta::Instance
311 - added new Instance metaclass to support
312 the new Class::MOP instance protocol
313
314 * Moose::Meta::Class
315 - some small changes to support the new
316 instance protocol
72c4f6d1 317 - some small additions to support Roles
98aae381 318
319 * Moose::Meta::Attribute
320 - some improvements to the accessor generation code
321 by nothingmuch
322 - some small changes to support the new
323 instance protocol
324 - (still somewhat) experimental delegation support
325 with the 'handles' option
326 - added several tests for this
db1ab48d 327 - no docs for this yet
98aae381 328
35c8b8f2 3290.05 Thurs. April 27, 2006
2d562421 330 * Moose
331 - keywords are now exported with Sub::Exporter
332 thanks to chansen for this commit
590868a3 333 - has keyword now takes a 'metaclass' option
334 to support custom attribute meta-classes
335 on a per-attribute basis
daea75c9 336 - added tests for this
337 - the 'has' keyword not accepts inherited slot
338 specifications (has '+foo'). This is still an
339 experimental feature and probably not finished
340 see t/038_attribute_inherited_slot_specs.t for
341 more details, or ask about it on #moose
fcb7afc2 342 - added tests for this
2d562421 343
344 * Moose::Role
345 - keywords are now exported with Sub::Exporter
346
5204cd52 347 * Moose::Utils::TypeConstraints
cce8198b 348 - reorganized the type constraint hierarchy, thanks
349 to nothingmuch and chansen for his help and advice
350 on this
351 - added some tests for this
7eaef7ad 352 - keywords are now exported with Sub::Exporter
35c8b8f2 353 thanks to chansen for this commit
5204cd52 354
d500266f 355 * Moose::Meta::Class
356 - due to changes in Class::MOP, we had to change
357 construct_instance (for the better)
358
359 * Moose::Meta::Attribute
360 - due to changes in Class::MOP, we had to add the
361 initialize_instance_slot method (it's a good thing)
c07af9d2 362
cce8198b 363 * Moose::Meta::TypeConstraint
c07af9d2 364 - added type constraint unions
365 - added tests for this
cce8198b 366 - added the is_subtype_of predicate method
367 - added tests for this
d500266f 368
02a0fb52 3690.04 Sun. April 16th, 2006
1331430a 370 * Moose::Role
371 - Roles can now consume other roles
372 - added tests for this
373 - Roles can specify required methods now with
374 the requires() keyword
375 - added tests for this
376
bdabd620 377 * Moose::Meta::Role
378 - ripped out much of it's guts ,.. much cleaner now
1331430a 379 - added required methods and correct handling of
fa1be058 380 them in apply() for both classes and roles
381 - added tests for this
1331430a 382 - no longer adds a does() method to consuming classes
383 it relys on the one in Moose::Object
384 - added roles attribute and some methods to support
385 roles consuming roles
8c9d74e7 386
387 * Moose::Meta::Attribute
388 - added support for triggers on attributes
389 - added tests for this
02a0fb52 390 - added support for does option on an attribute
391 - added tests for this
8c9d74e7 392
393 * Moose::Meta::Class
394 - added support for attribute triggers in the
395 object construction
396 - added tests for this
256903b6 397
398 * Moose
399 - Moose no longer creates a subtype for your class
400 if a subtype of the same name already exists, this
401 should DWIM in 99.9999% of all cases
402
403 * Moose::Util::TypeConstraints
404 - fixed bug where incorrect subtype conflicts were
405 being reported
8c9d74e7 406 - added test for this
407
408 * Moose::Object
409 - this class can now be extended with 'use base' if
410 you need it, it properly loads the metaclass class now
411 - added test for this
bdabd620 412
0677220d 4130.03_02 Wed. April 12, 2006
05d9eaf6 414 * Moose
415 - you must now explictly use Moose::Util::TypeConstraints
416 it no longer gets exported for you automatically
417
418 * Moose::Object
419 - new() now accepts hash-refs as well as key/value lists
0677220d 420 - added does() method to check for Roles
421 - added tests for this
05d9eaf6 422
0677220d 423 * Moose::Meta::Class
424 - added roles attribute along with the add_role() and
425 does_role() methods
426 - added tests for this
427
428 * Moose::Meta::Role
429 - now adds a does() method to consuming classes
430 which tests the class's hierarchy for roles
431 - added tests for this
432
4330.03_01 Mon. April 10, 2006
e9ec68d6 434 * Moose::Cookbook
76d37e5a 435 - added new Role recipe (no content yet, only code)
e9ec68d6 436
437 * Moose
438 - added 'with' keyword for Role support
439 - added test and docs for this
440 - fixed subtype quoting bug
441 - added test for this
442
443 * Moose::Role
444 - Roles for Moose
445 - added test and docs
76d37e5a 446
447 * Moose::Util::TypeConstraints
448 - added the message keyword to add custom
449 error messages to type constraints
e9ec68d6 450
451 * Moose::Meta::Role
452 - the meta role to support Moose::Role
453 - added tests and docs
454
455 * Moose::Meta::Class
456 - moved a number of things from Moose.pm
457 to here, they should have been here
458 in the first place
459
460 * Moose::Meta::Attribute
461 - moved the attribute option macros here
462 instead of putting them in Moose.pm
e185c027 463
76d37e5a 464 * Moose::Meta::TypeConstraint
465 - added the message attributes and the
466 validate method
467 - added tests and docs for this
468
0ac928d2 4690.03 Thurs. March 30, 2006
e9bb8a31 470 * Moose::Cookbook
471 - added the Moose::Cookbook with 5 recipes,
472 describing all the stuff Moose can do.
473
d7f17ebb 474 * Moose
475 - fixed an issue with &extends super class loading
476 it now captures errors and deals with inline
477 packages correctly (bug found by mst, solution
478 stolen from alias)
159da176 479 - added super/override & inner/augment features
480 - added tests and docs for these
d7f17ebb 481
482 * Moose::Object
483 - BUILDALL now takes a reference of the %params
484 that are passed to &new, and passes that to
485 each BUILD as well.
471c4f09 486
487 * Moose::Util::TypeConstraints
488 - Type constraints now survive runtime reloading
489 - added test for this
d7f17ebb 490
8339fae2 491 * Moose::Meta::Class
492 - fixed the way attribute defaults are handled
493 during instance construction (bug found by chansen)
494
d7f17ebb 495 * Moose::Meta::Attribute
496 - read-only attributes now actually enforce their
9deed647 497 read-only-ness (this corrected in Class::MOP as
498 well)
d7f17ebb 499
076c81ed 5000.02 Tues. March 21, 2006
fc5609d2 501 * Moose
b841b2a3 502 - many more tests, fixing some bugs and
503 edge cases
b841b2a3 504 - &extends now loads the base module with
505 UNIVERSAL::require
506 - added UNIVERSAL::require to the
507 dependencies list
6ba6d68c 508 ** API CHANGES **
b841b2a3 509 - each new Moose class will also create
510 and register a subtype of Object which
511 correspond to the new Moose class.
b841b2a3 512 - the 'isa' option in &has now only
513 accepts strings, and will DWIM in
514 almost all cases
515
516 * Moose::Util::TypeConstraints
517 - added type coercion features
518 - added tests for this
519 - added support for this in attributes
520 and instance construction
6ba6d68c 521 ** API CHANGES **
b841b2a3 522 - type construction no longer creates a
523 function, it registers the type instead.
524 - added several functions to get the
525 registered types
6ba6d68c 526
527 * Moose::Object
528 - BUILDALL and DEMOLISHALL were broken
529 because of a mis-named hash key, Whoops :)
b841b2a3 530
531 * Moose::Meta::Attribute
532 - adding support for coercion in the
533 autogenerated accessors
534
535 * Moose::Meta::Class
536 - adding support for coercion in the
6ba6d68c 537 instance construction
538
539 * Moose::Meta::TypeConstraint
540 * Moose::Meta::TypeCoercion
541 - type constraints and coercions are now
542 full fledges meta-objects
fc5609d2 543
e522431d 5440.01 Wed. March 15, 2006
545 - Moooooooooooooooooose!!!