-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crude implementation to allow Promise V3 #27
Conversation
This is interesting approach, but i think since this depends on Composer, would be good to give user choice as a different version/different package for use in production, Do you know any example of non dev-tools library that is using any of the Composer utilities package? |
This is in fact all it would take for the whole DiscordPHP library to support v3 Promises... |
Ratchet/pawl has a dependency on Promise V2, not specified in its composer files however |
Two things.
|
I attempted to replicate these changes and check for any areas of improvement on my own branch, but it seems to have been entirely unnecessarily. I am fine with merging this as-is as the cleanest possible solution. |
@2colours, If you have any changes you'd like to propose, feel free to create a PR to address your concerns. Our team is small, and most of the other maintainers are currently inactive. I work full-time and contribute to several other projects, so progress on this one happens as my availability allows. |
I've poked about for a bit and I see no reason to further delay this PR. We can look into other options in the future if needed, but this should preserve functionality between both v2 and v3. |
Crude implementation to allow Promise V3
This is more of a proof of concept than a full PR.
#26 introduces Promise V3 compatibility with the use of a helper. With an implementation like this, no helper is needed.
DiscordPHP will still be able to use Promise V2 by adding a hard Promise V2 dependency to
composer.json
, and if we include an IDE helper to overwrite the return types in DiscordPHP, nothing will have changed for users of DiscordPHP.I'd like to hear what you guys think of a solution like this. I want to start using Promise V3, whether that be with #26, this PR, or a v3-compatible fork published on packagist alongside main discordphp-http.