Happy Birthday ReactPHP – HTTP client and server LTS release!

Christian Lück Portrait Photo Dennis Graßnick Portrait Photo Christian Lück & Dennis Graßnick
on
tagged

Exactly eight years ago, 11th July 2012, the very first v0.1.0 release of ReactPHP was tagged. Today, the time has come again - It's ReactPHP's birthday. 🎉 This will be celebrated with a big birthday party and a new react/http v1.0.0 component release to ensure you will also get a big piece of the birthday cake to taste. 🍰

ReactPHP – 8 years

We're enthusiastic to announce the immediate availability of the very first stable v1.0.0 release of ReactPHP's HTTP library, our event-driven, streaming HTTP client and server implementation written in pure PHP.

New HTTP client

The most important addition is the new HTTP client, which is now included in one package alongside the HTTP server implementation. Let's take a look and send some simple HTTP GET requests:

$loop = React\EventLoop\Factory::create();
$client = new React\Http\Browser($loop);

$client->get('http://example.com/')->then(function (Psr\Http\Message\ResponseInterface $response) {
    echo $response->getBody();
});

$loop->run();

It's async from the ground up and allows concurrently sending any number of HTTP requests. Does this look familiar to you? The code has been imported from clue/reactphp-buzz, so it's already battle-tested in production. It uses the existing Promise-based APIs and PSR-7 message interfaces just like the server component, so upgrading should be very easy. Have a look at all the examples for more details.

Stable LTS

We're seeing a recent surge in all kinds of different web applications and frameworks that build on top of ReactPHP. We think this is super exciting and we would love to help these projects thrive!

That's why we're happy to announce we're extending our LTS promise (no pun intended) for at least another 24 months for the new HTTP component as well as all main components. This means that these LTS releases continue being a stable base for you to build on top of. The release series will be supported for at least 24 months, so you can safely update these components, getting all the upcoming features without having to worry about BC breaks. With this release, we emphasize that ReactPHP is production-ready and a rock-solid foundation.

Updated HTTP server and more!

Previous beta versions of this HTTP package have always contained an efficient HTTP server written in pure PHP. The new HTTP server is now faster and better than ever!

$server = new React\Http\Server($loop, function (Psr\Http\Message\ServerRequestInterface $request) {
     return new React\Http\Message\Response(
         200,
         [],
         "Hello world!\n"
     );
});

$socket = new React\Socket\Server('0.0.0.0:8080', $loop);
$server->listen($socket);

This version update involves some major new features and a number of BC breaks due to some necessary API cleanup. We've tried hard to avoid BC breaks where possible and minimize impact otherwise. We expect that most consumers of beta versions of this package will be affected by BC breaks, but updating should take no longer than a few minutes. Check out the project page and the upgrade guides for more details.

In this context we have also released a new react/react v1.1.0 meta package. This meta package will install all stable components at once, and it now also includes our HTTP client and server. Happy prototyping!

Looking forward

We've started planning this release last year and we've made some great progress! With this stable release now shipped, this allows us to focus on developing exciting new stuff, such as HTTP keep-alive support, HTTP/2 and much more. So don't worry: The future is already taken care of!

We invest a lot of time to develop, maintain and update our awesome open-source projects. If you are interested in sustainable open source (note: you should), you can help us sustain this high-quality of our work by becoming a sponsor on GitHub. Sponsors allow us to keep making progress and get numerous benefits in return, see our sponsoring page for details.

Let's take these projects to the next level together... but before we do - let's have a kickass party!

Hooray ReactPHP 🎉💥


We love to hear your feedback, use the comment section below or send a tweet to @another_clue.

Comments