CX::Imports, TODO updates, note mst rant, add some docs
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Upgrading.pod
index 781b821..d7a3266 100644 (file)
@@ -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<Sub::Name> 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<Class::MOP> 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<NEVER> 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