actually document the new request body_data method
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index b9e9b4a..8fc94d6 100644 (file)
@@ -41,7 +41,7 @@ use Plack::Middleware::IIS6ScriptNameFix;
 use Plack::Middleware::IIS7KeepAliveFix;
 use Plack::Middleware::LighttpdScriptNameFix;
 use Plack::Util;
-use JSON::MaybeXS qw(decode_json);
+use Class::Load;
 
 BEGIN { require 5.008003; }
 
@@ -117,7 +117,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.90049_001';
+our $VERSION = '5.90049_002';
 
 sub import {
     my ( $class, @arguments ) = @_;
@@ -3160,6 +3160,9 @@ installed it.  If you don't mind the XS dependency, you should add the faster
 L<Cpanel::JSON::XS> to you dependency list (in your Makefile.PL or dist.ini, or
 cpanfile, etc.)
 
+L<JSON::MaybeXS> is loaded the first time you ask for it (so if you never ask
+for it, its never used).
+
 =cut
 
 sub registered_data_handlers {
@@ -3184,7 +3187,10 @@ sub setup_data_handlers {
 sub default_data_handlers {
     my ($class) = @_;
     return +{
-      'application/json' => sub { local $/; decode_json $_->getline },
+      'application/json' => sub {
+          local $/;
+          Class::Load::load_class("JSON::MaybeXS");
+          JSON::MaybeXS::decode_json $_->getline },
     };
 }