X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FUpgrading.pod;h=d7a3266518c81c42af80638f04d54f7d504715ad;hb=c571d2c84b0acd26c540bba4b604e7ce8e01e426;hp=781b821a48a18791c2902375fc21eb135d1ec95c;hpb=8be895a7aa1d89a8004cc0cd37962025bc5c3b3d;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Upgrading.pod b/lib/Catalyst/Upgrading.pod index 781b821..d7a3266 100644 --- a/lib/Catalyst/Upgrading.pod +++ b/lib/Catalyst/Upgrading.pod @@ -19,6 +19,28 @@ your Class' @ISA will not linearise with C3. rafl to fix this bit :) +=head2 Anonymous closures installed directly into the symbol table + +If you have any code which installs anonymous subroutine references directly +into the symbol table, you may encounter breakages. The simplest solution is +to use L to name the subroutine. Example: + + #Originalcode, likely to break: + my $full_method_name = join('::',$package_name, $method_name); + *$full_method_name = sub { ... }; + + #Fixed Code + use Sub::Name 'subname'; + my $full_method_name = join('::',$package_name, $method_name); + *$full_method_name = subname $full_method_name, sub { ... }; + +Additionally, you can take advantage of Catalyst's use of L and +install the closure using the appropriate metaclass. Example: + + use Class::MOP; + my $metaclass = Moose::Meta::Class->initialize($package_name); + $metaclass->add_method($method_name => sub { ... }); + =head2 Components without new methods FIXME @@ -57,12 +79,40 @@ in components, instead, you should inherit the new method from Catalyst::Compone to perform any construction work necessary for your sub-class. -=head Methods in Catalyst::Dispatcher +=head1 WARNINGS + +=head2 Methods in Catalyst::Dispatcher + +The following methods in Catalyst::Dispatcher are likely to change +significantly in the 5.8X release series, and therefore their use is highly +deprecated. + +=over + +=item tree + +=item dispatch_types + +=item registered_dispatch_types + +=item method_action_class + +=item action_hash + +=item container_hash + +=back + +The first time one of these methods is called, a warning will be emitted: Class $class is calling the deprecated method Catalyst::Dispatcher::$public_method_name,\n" . "this will be removed in Catalyst 5.9X" -FIXME +You should B be calling any of these methods from application code. + +Plugins authors and maintainers whos plugins need to call these methods +should email the development list to discuss your use-case, and what a +better API should look like. =head2 Confused multiple inheritence with Catalyst::Component::COMPONENT