remove custom catalyst code and use Plack Middleware instead
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Delta.pod
CommitLineData
8c57b129 1=head1 NAME
6c18e892 2
8c57b129 3Catalyst::Delta - Overview of changes between versions of Catalyst
4
5=head1 DESCRIPTION
6
46fff667 7This is an overview of the user-visible changes to Catalyst between major
8Catalyst releases.
9
10=head2 VERSION 5.90060+
11
12We changed the way we return body content (from response) to whatever
13Plack handler you are using (Starman, FastCGI, etc.) We no longer
14always use the streaming interface for the cases when the body is a
15simple scalar, object or filehandle like. In those cases we now just
16pass the simple response on to the plack handler. This might lead to
17some minor differences in how streaming is handled. For example, you
18might notice that streaming starts using chunked encoding when running
19on a server that supports that, or that previously missing headers
20(possible content-length) might appear suddenly correct. Also, if you
21are using middleware like L<Plack::Middleware::XSendfile> and are using
22a filehandle that sets a readable path, your server might now correctly
23handle the file (rather than as before where Catalyst would stream it
24very likely very slowly).
25
26In other words, some things might be meaninglessly different and some
27things that were broken codewise but worked because of Catalyst being
28incorrect might suddenly be really broken. The behavior is now more
29correct in that Catalyst plays better with features that Plack offers
30but if you are making heavy use of the streaming interface there could
31be some differences so you should test carefully (this is probably not
32the vast majority of people). In particular if you are developing
33using one server but deploying using a different one, differences in
34what those server do with streaming should be noted.
35
36We also now more carefully distingush the different between a body set
37to '' and a body that is undef. This might lead to situations where
38again you'll get a content-length were you didn't get one before or
39where a supporting server will start chunking output. If this is an
40issue you can apply the middleware L<Plack::Middleware::BufferedStreaming>
41or report specific problems to the dev team.
b31499bc 42
aa20e9f5 43Also, we have started migrating code in Catalyst to equivilent Plack
44Middleware when such exists and is correct to do so.
45
9b3b1b9c 46=head2 VERSION 5.9XXXX 'cataplack'
c20710a1 47
48The Catalyst::Engine sub-classes have all been removed and deprecated,
49to be replaced with Plack handlers.
50
51Plack is an implementation of the L<PSGI> specification, which is
52a standard interface between web servers and application frameworks.
53
54This should be no different for developers, and you should not have to
55migrate your applications unless you are using a custom engine already.
56
57This change benefits Catalyst significantly by reducing the amount of
58code inside the framework, and means that the framework gets upstream
59bug fixes in L<Plack>, and automatically gains support for any web server
60which a L<PSGI> compliant handler is written for.
61
62It also allows you more flexibility with your application, and allows
63the use of cross web framework 'middleware'.
64
65Developers are recommended to read L<Catalyst::Upgrading> for notes about
66upgrading, especially if you are using an unusual deployment method.
67
68Documentation for how to take advantage of L<PSGI> can be found in
69L<Catalyst::PSGI>, and information about deploying your application
70has been moved to L<Catalyst::Manual::Deployment>.
71
72=head3 Updated modules:
73
74A number of modules have been updated to pass their tests or not
75produce deprecation warnings with the latest version of Catalyst.
76It is recommended that you upgrade any of these that you are using
77after installing this version of Catalyst.
78
79These extensions are:
80
81=over
82
83=item L<Catalyst::Engine::HTTP::Prefork>
84
85This is now deprecated, see L<Catalyst::Upgrading>.
86
87=item L<Test::WWW::Mechanize::Catalyst>
88
89Has been updated to not produce deprecation warnings, upgrade recommended.
90
91=item Catalyst::ActionRole::ACL
92
93Has been updated to fix failing tests (although older versions still
94function perfectly with this version of Catalyst).
95
96=item Catalyst::Plugin::Session::Store::DBIC
97
98Has been updated to fix failing tests (although older versions still
99function perfectly with this version of Catalyst).
100
14eb7697 101=item Catalyst::Plugin::Authentication
102
103Has been updated to fix failing tests (although older versions still
104function perfectly with this version of Catalyst).
105
c20710a1 106=back
1fae8c61 107
108=head1 PREVIOUS VERSIONS
109
9b3b1b9c 110=head2 VERSION 5.8XXXX 'catamoose'
1fae8c61 111
112=head3 Deprecations
b31499bc 113
e88235ff 114Please see L<Catalyst::Upgrading> for a full description of how changes in the
115framework may affect your application.
116
117Below is a brief list of features which have been deprecated in this release:
118
796a8358 119=over
b31499bc 120
796a8358 121=item ::[MVC]:: style naming scheme has been deprecated and will warn
b31499bc 122
e88235ff 123=item NEXT is deprecated for all applications and components, use MRO::Compat
b31499bc 124
e88235ff 125=item Dispatcher methods which are an implementation detail made private, public versions now warn.
b31499bc 126
e88235ff 127=item MyApp->plugin method is deprecated, use L<Catalyst::Model::Adaptor> instead.
796a8358 128
0a3b8de0 129=item __PACKAGE__->mk_accessors() is supported for backward compatibility only, use Moose attributes instead in new code.
130
7df44a71 131=item Use of Catalyst::Base now warns
132
796a8358 133=back
134
1fae8c61 135=head3 New features
0a3b8de0 136
137=head3 Dispatcher
b31499bc 138
7df44a71 139=over
140
141=item Fix forwarding to Catalyst::Action objects.
142
143=item Add the dispatch_type method
144
145=back
b31499bc 146
0a3b8de0 147=head3 Restarter
b31499bc 148
6171ddd5 149The development server restarter has been improved to be compatible with
150immutable Moose classes, and also to optionally use
151L<B::Hooks::OP::Check::StashChange> to handle more complex application layouts
152correctly.
b31499bc 153
7df44a71 154=head3 $c->uri_for_action method.
b31499bc 155
7df44a71 156Give a private path to the Catalyst action you want to create a URI for.
6c18e892 157
0a3b8de0 158=head3 Logging
b31499bc 159
7df44a71 160Log levels have been made additive.
b31499bc 161
0a3b8de0 162=head3 L<Catalyst::Test>
163
164=over
165
166=item Change to use L<Sub::Exporter>.
167
0a3b8de0 168=item Support mocking multiple virtual hosts
169
170=item New methods like action_ok and action_redirect to write more compact tests
171
172=back
173
7df44a71 174=head3 Catalyst::Response
0a3b8de0 175
7df44a71 176=over
177
178=item *
179
180New print method which prints @data to the output stream, separated by $,.
181This lets you pass the response object to functions that want to write to an
182L<IO::Handle>.
183
184=item *
185
186Added code method as an alias for C<< $res->status >>
0a3b8de0 187
d5a6de01 188=back
189
1fae8c61 190=head3 Consequences of the Moose back end
b31499bc 191
796a8358 192=over
193
194=item *
195
7df44a71 196Components are fully compatible with Moose, and all Moose features, such as
197method modifiers, attributes, roles, BUILD and BUILDARGS methods are fully
198supported and may be used in components and applications.
199
200=item *
201
202Many reusable extensions which would previously have been plugins or base
203classes are better implemented as Moose roles.
204
205=item *
206
a0c37f08 207L<MooseX::MethodAttributes::Role::AttrContainer::Inheritable> is used to contain action
7df44a71 208attributes. This means that attributes are represented in the MOP, and
209decouples action creation from attributes.
796a8358 210
211=item *
212
0a3b8de0 213There is a reasonable API in Catalyst::Controller for working with
796a8358 214and registering actions, allowing a controller sub-class to replace
25f61108 215subroutine attributes for action declarations with an alternate
0a3b8de0 216syntax.
796a8358 217
218=item *
219
0a3b8de0 220Refactored capturing of $app from L<Catalyst::Controller> into
221L<Catalyst::Component::ApplicationAttribute> for easier reuse in other
7df44a71 222components.
223
224=item *
225
226Your application class is forced to become immutable at the end of compilation.
227
228=back
229
1fae8c61 230=head3 Bug fixes
7df44a71 231
232=over
233
234=item *
235
25f61108 236Don't ignore SIGCHLD while handling requests with the development server, so that
7df44a71 237system() and other ways of creating child processes work as expected.
238
239=item *
240
241Fixes for FastCGI when used with IIS 6.0
242
243=item *
244
245Fix a bug in uri_for which could cause it to generate paths with multiple
246slashes in them.
796a8358 247
248=item *
249
7df44a71 250Fix a bug in Catalyst::Stats, stopping garbage being inserted into
251the stats if a user calls begin => but no end
796a8358 252
253=back
254