Added docs explaining missing route for /go_here
[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
8e098614 44Middleware when such exists and is correct to do so.
45
46We also deprecated setting the response body to an object that does 'read'
47but not 'getline'. If you are using a custom IO-Handle like object for
48response you should verify that 'getline' is supported in your interface.
49You will get a first use warning for this error in your logs. Unless we
50here this case is a major issue for people, we will be removing support
51in a near future release of Catalyst.
52
53L<Catalyst::Engine::PSGI> is also officially no longer supported. We will
54no long run test cases against this and can remove backcompat code for it
55as deemed necessary for the evolution of the platform. You should simple
56discontinue use of this engine, as L<Catalyst> has been PSGI at the core
57for several years.
aa20e9f5 58
5bb2a5b3 59=head2 VERSION 5.90053
60
61We are now clarifying the behavior of log, plugins and configuration during
62the setup phase. Since Plugins might require a log during setup, setup_log
63must run BEFORE setup_plugins. This has the unfortunate side effect that
64anyone using the popular ConfigLoader plugin will not be able to supply
65configuration to custom logs since the configuration is not yet finalized
66when setup_log is run (when using ConfigLoader, which is a plugin and is
67not loaded until later.)
68
69As a workaround, you can supply custom log configuration directly into
70the configuration:
71
72 package MyApp;
73 use Catalyst;
74
75 __PACKAGE__->config(
76 my_custom_log_info => { %custom_args },
77 );
78
79 __PACKAGE__->setup;
80
81If you wish to configure the custom logger differently based on ENV, you can
82try:
83
84 package MyApp;
85
86 use Catalyst;
87 use Catalyst::Utils;
88
89 __PACKAGE__->config(
90 Catalyst::Utils::merge_hashes(
91 +{ my_custom_log_info => { %base_custom_args } },
92 +{ do __PACKAGE__->path_to( $ENV{WHICH_CONF}."_conf.pl") },
93 ),
94 );
95
96 __PACKAGE__->setup;
97
98Or create a standalone Configuration class that does the right thing.
99
100Basically if you want to configure a logger via Catalyst global configuration
101you can't use ConfigLoader because it will always be loaded too late to be of
102any use. Patches and workaround options welcomed!
103
9b3b1b9c 104=head2 VERSION 5.9XXXX 'cataplack'
c20710a1 105
106The Catalyst::Engine sub-classes have all been removed and deprecated,
107to be replaced with Plack handlers.
108
109Plack is an implementation of the L<PSGI> specification, which is
110a standard interface between web servers and application frameworks.
111
112This should be no different for developers, and you should not have to
113migrate your applications unless you are using a custom engine already.
114
115This change benefits Catalyst significantly by reducing the amount of
116code inside the framework, and means that the framework gets upstream
117bug fixes in L<Plack>, and automatically gains support for any web server
118which a L<PSGI> compliant handler is written for.
119
120It also allows you more flexibility with your application, and allows
121the use of cross web framework 'middleware'.
122
123Developers are recommended to read L<Catalyst::Upgrading> for notes about
124upgrading, especially if you are using an unusual deployment method.
125
126Documentation for how to take advantage of L<PSGI> can be found in
127L<Catalyst::PSGI>, and information about deploying your application
128has been moved to L<Catalyst::Manual::Deployment>.
129
130=head3 Updated modules:
131
132A number of modules have been updated to pass their tests or not
133produce deprecation warnings with the latest version of Catalyst.
134It is recommended that you upgrade any of these that you are using
135after installing this version of Catalyst.
136
137These extensions are:
138
139=over
140
141=item L<Catalyst::Engine::HTTP::Prefork>
142
143This is now deprecated, see L<Catalyst::Upgrading>.
144
145=item L<Test::WWW::Mechanize::Catalyst>
146
147Has been updated to not produce deprecation warnings, upgrade recommended.
148
149=item Catalyst::ActionRole::ACL
150
151Has been updated to fix failing tests (although older versions still
152function perfectly with this version of Catalyst).
153
154=item Catalyst::Plugin::Session::Store::DBIC
155
156Has been updated to fix failing tests (although older versions still
157function perfectly with this version of Catalyst).
158
14eb7697 159=item Catalyst::Plugin::Authentication
160
161Has been updated to fix failing tests (although older versions still
162function perfectly with this version of Catalyst).
163
c20710a1 164=back
1fae8c61 165
166=head1 PREVIOUS VERSIONS
167
9b3b1b9c 168=head2 VERSION 5.8XXXX 'catamoose'
1fae8c61 169
170=head3 Deprecations
b31499bc 171
e88235ff 172Please see L<Catalyst::Upgrading> for a full description of how changes in the
173framework may affect your application.
174
175Below is a brief list of features which have been deprecated in this release:
176
796a8358 177=over
b31499bc 178
796a8358 179=item ::[MVC]:: style naming scheme has been deprecated and will warn
b31499bc 180
e88235ff 181=item NEXT is deprecated for all applications and components, use MRO::Compat
b31499bc 182
e88235ff 183=item Dispatcher methods which are an implementation detail made private, public versions now warn.
b31499bc 184
e88235ff 185=item MyApp->plugin method is deprecated, use L<Catalyst::Model::Adaptor> instead.
796a8358 186
0a3b8de0 187=item __PACKAGE__->mk_accessors() is supported for backward compatibility only, use Moose attributes instead in new code.
188
7df44a71 189=item Use of Catalyst::Base now warns
190
796a8358 191=back
192
1fae8c61 193=head3 New features
0a3b8de0 194
195=head3 Dispatcher
b31499bc 196
7df44a71 197=over
198
199=item Fix forwarding to Catalyst::Action objects.
200
201=item Add the dispatch_type method
202
203=back
b31499bc 204
0a3b8de0 205=head3 Restarter
b31499bc 206
6171ddd5 207The development server restarter has been improved to be compatible with
208immutable Moose classes, and also to optionally use
209L<B::Hooks::OP::Check::StashChange> to handle more complex application layouts
210correctly.
b31499bc 211
7df44a71 212=head3 $c->uri_for_action method.
b31499bc 213
7df44a71 214Give a private path to the Catalyst action you want to create a URI for.
6c18e892 215
0a3b8de0 216=head3 Logging
b31499bc 217
7df44a71 218Log levels have been made additive.
b31499bc 219
0a3b8de0 220=head3 L<Catalyst::Test>
221
222=over
223
224=item Change to use L<Sub::Exporter>.
225
0a3b8de0 226=item Support mocking multiple virtual hosts
227
228=item New methods like action_ok and action_redirect to write more compact tests
229
230=back
231
7df44a71 232=head3 Catalyst::Response
0a3b8de0 233
7df44a71 234=over
235
236=item *
237
238New print method which prints @data to the output stream, separated by $,.
239This lets you pass the response object to functions that want to write to an
240L<IO::Handle>.
241
242=item *
243
244Added code method as an alias for C<< $res->status >>
0a3b8de0 245
d5a6de01 246=back
247
1fae8c61 248=head3 Consequences of the Moose back end
b31499bc 249
796a8358 250=over
251
252=item *
253
7df44a71 254Components are fully compatible with Moose, and all Moose features, such as
255method modifiers, attributes, roles, BUILD and BUILDARGS methods are fully
256supported and may be used in components and applications.
257
258=item *
259
260Many reusable extensions which would previously have been plugins or base
261classes are better implemented as Moose roles.
262
263=item *
264
a0c37f08 265L<MooseX::MethodAttributes::Role::AttrContainer::Inheritable> is used to contain action
7df44a71 266attributes. This means that attributes are represented in the MOP, and
267decouples action creation from attributes.
796a8358 268
269=item *
270
0a3b8de0 271There is a reasonable API in Catalyst::Controller for working with
796a8358 272and registering actions, allowing a controller sub-class to replace
25f61108 273subroutine attributes for action declarations with an alternate
0a3b8de0 274syntax.
796a8358 275
276=item *
277
0a3b8de0 278Refactored capturing of $app from L<Catalyst::Controller> into
279L<Catalyst::Component::ApplicationAttribute> for easier reuse in other
7df44a71 280components.
281
282=item *
283
284Your application class is forced to become immutable at the end of compilation.
285
286=back
287
1fae8c61 288=head3 Bug fixes
7df44a71 289
290=over
291
292=item *
293
25f61108 294Don't ignore SIGCHLD while handling requests with the development server, so that
7df44a71 295system() and other ways of creating child processes work as expected.
296
297=item *
298
299Fixes for FastCGI when used with IIS 6.0
300
301=item *
302
303Fix a bug in uri_for which could cause it to generate paths with multiple
304slashes in them.
796a8358 305
306=item *
307
7df44a71 308Fix a bug in Catalyst::Stats, stopping garbage being inserted into
309the stats if a user calls begin => but no end
796a8358 310
311=back
312