Replies: 18 comments 47 replies
-
I would be pleased to have a proper update of https://github.com/ratchetphp/ that is a "side project" of ReactPHP but that would need some love. There is some very interesting PR (including that one ratchetphp/Ratchet#851) that are ready to be reviewed and merged and that would greatly help projects built on it. Thanks for everything! <3 |
Beta Was this translation helpful? Give feedback.
-
If breaking changes are to be expected, let's take the opportunity to drop unsupported PHP versions. This would allow us to modernize the codebase (think typings) and more easily introduce tools such as PHPStan. |
Beta Was this translation helpful? Give feedback.
-
Production-ready Filesystem Component :) |
Beta Was this translation helpful? Give feedback.
-
I suggest the next version should consistently be called ReactPHP v3. This would mean that for most components, we would jump straight from ReactPHP v1 to v3 and would skip v2 for most components. While this may seem odd at first, I think this makes sense for the following reasons. First of all, ReactPHP consists of individual components, most of which are currently at v1.x.y, while some components already have a v3 or v4 scheduled or released. In particular, our Async component has been released as version v2+v3+v4 simultaneously to accommodate different PHP versions. For our Promise component we currently support a v1+v2 with plans for an upcoming v3. If we release a v3 for all components that are currently at v1, we can be more consistent and make it easier to understand for consumers. In particular, this means consumers do not have to figure out if v2 of X is compatible with v3 of Y. Instead, we can consistent refer to this as ReactPHP v3 and ensure that everything v3 is compatible with each other. A minor downside is that skipping v2 might seem confusing ("What happened to v2?"). I don't think this is a particularly compelling argument, the main aspect here is that v3 >> v1. From a SemVer perspective, skipping a major version is also completely fine. Also, do you remember PHP 6? On a related note, both Promise v3 and Async v3 have the same minimum PHP requirements (PHP 7.1+). Async v4 requires PHP 8.1+. We could apply the same logic to our other components to be more consistent, but see also thread above for more discussions about PHP version requirements (https://github.com/orgs/reactphp/discussions/472#discussioncomment-3645588). TL;DR: v3 >> v2 |
Beta Was this translation helpful? Give feedback.
-
I suggest the next version should receive long-term support (LTS) for at least 2 years. I think one of the unique selling points of ReactPHP has always been the fact that it is very stable and predictable. We've started releasing v1 of our core components on 2018-07-11 and have a track record of not introducing any unexpected BC breaks. The next version will include a number of BC breaks as discussed in other threads above and we will include clear upgrade guides for anybody coming from a prior version. Once this is released, I would like to stress that we do not plan any immediate BC breaks for a reasonable time frame. As such, consumers will be able to rely on our APIs for their projects also longer-term. As per the discussion above, I would suggest we should name the next version v3 (https://github.com/orgs/reactphp/discussions/472#discussioncomment-3680968) and should support v3 for at least 2 years. v3 should be supported at least until a future v4 is released, plus a time frame of ~6 months to ensure a smooth upgrade again. (A future v4 is not something that would be on the immediate roadmap for at least 12 months, but I wouldn't want to preclude any future work on this version. Should we release v4 sooner, we should continue supporting v3 at least for 2 years as suggested above.) |
Beta Was this translation helpful? Give feedback.
-
Once the next version is released, we should mark v1 end of life (EOL) after a reasonable transition period of ~6 months. The next version is going to be the way forward for ReactPHP. v1 may see some smaller adjustments / fixes in the future, but all development efforts and new features will focus on the next major instead. To ensure a smooth upgrade path, we should continue providing support for v1 for a reasonable transition period of ~6 months. We're open to learn more about how much demand there is to continue supporting v1. If your project or company requires longer-term support for EOL versions, please reach out and we may be able to work this out on a case-by-case basis. |
Beta Was this translation helpful? Give feedback.
-
As one of the main features for vNEXT, I would like to see blocking APIs that work just like traditional, idiomatic PHP code. In a gist, I would like to be able to do this (vNEXT) try {
$response = $http->get('http://www.google.com/');
var_dump($response->getHeaders(), (string)$response->getBody());
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
} instead of this (v1): $http->get('http://www.google.com/')->then(function (Psr\Http\Message\ResponseInterface $response) {
var_dump($response->getHeaders(), (string)$response->getBody());
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
}); ReactPHP v1 has always been about "making hard things possible", that's why we've focused on async APIs like the latter example. In the future, I would like to also focus on "making easy things easy" and provide simple(r) APIs like the former example. In my opinion, one does not exclude the other. Thanks to fibers available as of PHP 8.1+, we can create APIs that can be used in an async context and yet look like normal, blocking APIs. The Instead of deciding for either fiber-based APIs or promised-based APIs, I would argue that there's value in both styles, depending on how they're used. For this reason, I would suggest we simply add methods that do to cover both cases like this: class HttpClient
{
public function get(string $url): ResponseInterface;
public function getAsync(string $url): PromiseInterface<ResponseInterface>;
// …
} This allows us to provide type-safe APIs and has the benefit that no mapping using TL;DR: Make easy things easy and hard things possible. |
Beta Was this translation helpful? Give feedback.
-
How about we use the current default loop as the only eventloop in ReactPHP. There's currently the possibility to pass in an event loop instance for most functions across all ReactPHP components. A year ago the default loop was added which triggers if there's no explicit loop given. The following example comes from reactphp/http#410: // old (still supported)
$browser = new React\Http\Browser($loop);
$server = new React\Http\Server($loop, $handler);
// new (using default loop)
$browser = new React\Http\Browser();
$server = new React\Http\Server($handler); I'm curious, are there any cases where you want to use a different eventloop? Maybe it could be a new feature to always use the default loop and get rid of the optional The documentation for the default loop in all components also says the following about the use of an external eventloop:
So it seems for most cases you don't even want/need a specific loop, so why not remove this option completely? |
Beta Was this translation helpful? Give feedback.
-
Right now, This ties in with the PHP version requirements discussed above in https://github.com/orgs/reactphp/discussions/472#discussioncomment-3645588, the most important PHP versions for this would be:
|
Beta Was this translation helpful? Give feedback.
-
I would love to see built-in support for PSR-15 (HTTP Server Request Handlers). This is currently possible through https://github.com/friends-of-reactphp/http-middleware-psr15-adapter, but I would love to see if we can build this into the HTTP component to make reusing middleware and request handlers even easier. Full support will likely require fibers (PHP 8.1+), but PHP version requirements are discussed above in https://github.com/orgs/reactphp/discussions/472#discussioncomment-3645588. We might be able to come up with a way to provide limited support on prior PHP versions as per https://framework-x.org/docs/async/fibers/#requirements or we could also provide support only for matching PHP versions. Also refs wish list regarding v3 <-> v4 discussed above in https://github.com/orgs/reactphp/discussions/472#discussioncomment-3680968. |
Beta Was this translation helpful? Give feedback.
-
I would like to see built-in support for PSR-18 (HTTP Client) and potentially PSR-17 (HTTP Factories). We will likely see more blocking APIs in the next version as discussed above in https://github.com/orgs/reactphp/discussions/472#discussioncomment-3715488. Once these APIs are in place, it will be straight forward to add support for the |
Beta Was this translation helpful? Give feedback.
-
We may want to add support for PSR-16 (Common Interface for Caching Libraries). We will likely see more blocking APIs in the next version as discussed above in https://github.com/orgs/reactphp/discussions/472#discussioncomment-3715488. Once these APIs are in place, it will be relatively straight forward to add support for the API defined by PSR-16, especially considering the APIs of our async Cache component are heavily influenced by PSR-16. This is currently possible through https://github.com/WyriHaximus/reactphp-cache-psr-16-adapter, but I wonder if we can build this into the Cache and/or DNS component to simplify reuse. |
Beta Was this translation helpful? Give feedback.
-
I would love to see better error and exception handling for ReactPHP. In particular, all errors should be shown by default unless explicitly hidden. Most notably, this affects promises (as discussed in reactphp/promise#87): $promise->then(function () {
throw new \RuntimeException('I should be shown');
}); Likewise, we may want to reconsider what happens if streams and sockets report an $stream = new ThroughStream(function () {
throw new \RuntimeException('Where should I be shown?');
});
$stream->write('Hello!'); On top of this, we may want to reconsider what is supposed to happen if an event handler or timer throws an exception: Loop::addTimer(1.0, function () {
throw new \RuntimeException('Where should I be shown?');
});
$stream->on('data', function () {
throw new \RuntimeException('Where should I be shown?');
});
$socket->on('connection', function () {
throw new \RuntimeException('Where should I be shown?');
}); We may want to emit an $stream = new ThroughStream(function () {
throw new \RuntimeException('I should be shown');
});
$stream->on('error', function () {
throw new \RuntimeException('But where should I be shown?');
});
$stream->write('Hello!'); |
Beta Was this translation helpful? Give feedback.
-
Possibility to trace timers/signals/streams to where they have been added from. When we are in situations where these accumulate for whatever reasons we have no way to know where they come from (i.e. code that does not clean up properly). |
Beta Was this translation helpful? Give feedback.
-
Metric(s) for Loop time utilization. I.e. to create monitors how much idle / busy time a loop has. Thinking about what |
Beta Was this translation helpful? Give feedback.
-
PHPStan support for promises, i.e. check types through resolved/rejected values and callback arguments. |
Beta Was this translation helpful? Give feedback.
-
We've just announced our plans for ReactPHP v3 here: https://github.com/orgs/reactphp/discussions/481 🎉 We will keep this wish list open in case there are more ideas for v3, so make sure to let us know in time for v3. |
Beta Was this translation helpful? Give feedback.
-
ReactPHP
vNEXT
is going to happen! 🎉We're committed to work on the next major version of ReactPHP (dubbed
vNEXT
for now). We've actually started working on this early last year but believe it's time to finally make this public and give people a chance to see what we're up to and to contribute.Before sharing too many of our own ideas, we'd like to take the opportunity to reach out to the community (that's you!). This is why we're starting this discussion in the hopes to get more people involved and share their own ideas of what a future ReactPHP could look like.
Suggest your ideas!
Bring in your ideas! Simply create a new comment thread in this discussion for each idea you want to see implemented in vNEXT (any number of ideas, ideally one idea per comment thread).
We want to focus on the big picture here, especially changes that help us shape the future of ReactPHP and may involve BC breaks and other major changes. While we appreciate pure feature ideas, this is probably not the best place to suggest things that would also be possible in a future
vNEXT.1
.We plan to use this discussion also to bring in our own ideas as well in a few days, but want to give more people a chance to suggest their own ideas first. We're curious what our community wants and how our plans align!
Help us prioritize
Everybody is invited to share their ideas! Some ideas will be better, some ideas will be less obvious. Help us understand what you need most.
You can cast your voice by voting on each comment thread or leave feedback in a comment thread if suggestions need more context. If a suggestion requires more discussion space, we'll try to create a separate discussion and link from here to create a common overview.
We plan to bring in our own ideas here as well. We're equally interested in feedback for your ideas and our own ideas and plan to adjust our roadmap according to the needs of our users.
Next steps
Share ideas, leave feedback, vote. Depending on feedback, we plan to keep this open for a couple of weeks and will announce further plans early next month.
Looking forward to your ideas and feedback! ❤️
Beta Was this translation helpful? Give feedback.
All reactions