Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Bump react/promise from 2.9.0 to 3.0.0 #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 1, 2023

Bumps react/promise from 2.9.0 to 3.0.0.

Release notes

Sourced from react/promise's releases.

v3.0.0

A major new feature release, see release announcement.

  • We'd like to emphasize that this component is production ready and battle-tested. We plan to support all long-term support (LTS) releases for at least 24 months, so you have a rock-solid foundation to build on top of.

  • The v3 release will be the way forward for this package. However, we will still actively support v2 and v1 to provide a smooth upgrade path for those not yet on the latest versions.

This update involves some major new features and a minor BC break over the v2.0.0 release. We've tried hard to avoid BC breaks where possible and minimize impact otherwise. We expect that most consumers of this package will be affected by BC breaks, but updating should take no longer than a few minutes. See below for more details:

  • BC break: PHP 8.1+ recommended, PHP 7.1+ required. (#138 and #149 by @​WyriHaximus)

  • Feature / BC break: The PromiseInterface now includes the functionality of the old ExtendedPromiseInterface and CancellablePromiseInterface. Each promise now always includes the then(), catch(), finally() and cancel() methods. The new catch() and finally() methods replace the deprecated otherwise() and always() methods which continue to exist for BC reasons. The old ExtendedPromiseInterface and CancellablePromiseInterface are no longer needed and have been removed as a consequence. (#75 by @​jsor and #208 by @​clue and @​WyriHaximus)

    // old (multiple interfaces may or may not be implemented)
    assert($promise instanceof PromiseInterface);
    assert(method_exists($promise, 'then'));
    if ($promise instanceof ExtendedPromiseInterface) { assert(method_exists($promise, 'otherwise')); }
    if ($promise instanceof ExtendedPromiseInterface) { assert(method_exists($promise, 'always')); }
    if ($promise instanceof CancellablePromiseInterface) { assert(method_exists($promise, 'cancel')); }
    // new (single PromiseInterface with all methods)
    assert($promise instanceof PromiseInterface);
    assert(method_exists($promise, 'then'));
    assert(method_exists($promise, 'catch'));
    assert(method_exists($promise, 'finally'));
    assert(method_exists($promise, 'cancel'));

  • Feature / BC break: Improve type safety of promises. Require mixed fulfillment value argument and Throwable (or Exception) as rejection reason. Add PHPStan template types to ensure strict types for resolve(T $value): PromiseInterface<T> and reject(Throwable $reason): PromiseInterface<never>. It is no longer possible to resolve a promise without a value (use null instead) or reject a promise without a reason (use Throwable instead). (#93, #141 and #142 by @​jsor, #138, #149 and #247 by @​WyriHaximus and #213 and #246 by @​clue)

    // old (arguments used to be optional)
    $promise = resolve();

... (truncated)

Changelog

Sourced from react/promise's changelog.

3.0.0 (2023-07-11)

A major new feature release, see release announcement.

  • We'd like to emphasize that this component is production ready and battle-tested. We plan to support all long-term support (LTS) releases for at least 24 months, so you have a rock-solid foundation to build on top of.

  • The v3 release will be the way forward for this package. However, we will still actively support v2 and v1 to provide a smooth upgrade path for those not yet on the latest versions.

This update involves some major new features and a minor BC break over the v2.0.0 release. We've tried hard to avoid BC breaks where possible and minimize impact otherwise. We expect that most consumers of this package will be affected by BC breaks, but updating should take no longer than a few minutes. See below for more details:

  • BC break: PHP 8.1+ recommended, PHP 7.1+ required. (#138 and #149 by @​WyriHaximus)

  • Feature / BC break: The PromiseInterface now includes the functionality of the old ExtendedPromiseInterface and CancellablePromiseInterface. Each promise now always includes the then(), catch(), finally() and cancel() methods. The new catch() and finally() methods replace the deprecated otherwise() and always() methods which continue to exist for BC reasons. The old ExtendedPromiseInterface and CancellablePromiseInterface are no longer needed and have been removed as a consequence. (#75 by @​jsor and #208 by @​clue and @​WyriHaximus)

    // old (multiple interfaces may or may not be implemented)
    assert($promise instanceof PromiseInterface);
    assert(method_exists($promise, 'then'));
    if ($promise instanceof ExtendedPromiseInterface) { assert(method_exists($promise, 'otherwise')); }
    if ($promise instanceof ExtendedPromiseInterface) { assert(method_exists($promise, 'always')); }
    if ($promise instanceof CancellablePromiseInterface) { assert(method_exists($promise, 'cancel')); }
    // new (single PromiseInterface with all methods)
    assert($promise instanceof PromiseInterface);
    assert(method_exists($promise, 'then'));
    assert(method_exists($promise, 'catch'));
    assert(method_exists($promise, 'finally'));
    assert(method_exists($promise, 'cancel'));

  • Feature / BC break: Improve type safety of promises. Require mixed fulfillment value argument and Throwable (or Exception) as rejection reason. Add PHPStan template types to ensure strict types for resolve(T $value): PromiseInterface<T> and reject(Throwable $reason): PromiseInterface<never>. It is no longer possible to resolve a promise without a value (use null instead) or reject a promise without a reason (use Throwable instead). (#93, #141 and #142 by @​jsor, #138, #149 and #247 by @​WyriHaximus and #213 and #246 by @​clue)

    // old (arguments used to be optional)

... (truncated)

Commits
  • c86753c Prepare v3.0.0 release
  • d317026 Merge pull request #247 from WyriHaximus-secret-labs/3.0-templates
  • b14580d [3.x] Add template annotations
  • af5814c Merge pull request #249 from clue-labs/set-rejection-handler
  • b1e8940 Add new set_rejection_handler() function
  • d87b562 Merge pull request #248 from clue-labs/report-unhandled
  • b0d0f3d Report any unhandled promise rejections
  • d66fa66 Merge pull request #246 from clue-labs/phpstan-v3
  • c4e6145 Improve type definitions and update to PHPStan level max
  • fd5e886 Add PHPStan to test environment
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [react/promise](https://github.com/reactphp/promise) from 2.9.0 to 3.0.0.
- [Release notes](https://github.com/reactphp/promise/releases)
- [Changelog](https://github.com/reactphp/promise/blob/3.x/CHANGELOG.md)
- [Commits](reactphp/promise@v2.9.0...v3.0.0)

---
updated-dependencies:
- dependency-name: react/promise
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants