Tatsuhiko Miyagawa's Blog

Make LWP optional. by miyagawa · Pull Request #408 · plack/Plack

June 12, 2013

Link: Make LWP optional. by miyagawa · Pull Request #408 · plack/Plack

This eliminates the XS dependency in Plack.Plack-1.0026-TRIAL is on CPAN, which is a big release that eliminated a dependency for the big LWP module.

LWP not only has a big chain of dependencies since the distribution split earlier, it also has XS dependency (HTML::Parser) in the chain, which makes Plack code non-trivial to install on environments without a C compiler, and makes fatpacking difficult (although realistically, these C bits are only necessary for testing and not required mostly on the runtime).

This is a big shift — I made LWP optional in #408 but also replaced the use of LWP with HTTP::Tiny in #410 — so that Plack::Test::Suite (reference Test suite for PSGI handlers) and ::Server (Plack::Test implementation to run tests through live server) now uses HTTP::Tiny instead of LWP. The test interface is still the same, and you can use HTTP::Request/Response interface for that, which is a much smaller subset of LWP.

I tested various distributions where it implicitly expects LWP when depending on Plack, and fixed a lot of them, and sent pull requests where needed. Please test Plack-1.0026-TRIAL against your application/frameworks/server implementations.

cpanm –dev Plack