Skip to content
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

Update dependency react/promise to v3 #131

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 19, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react/promise ^2.8 -> ^3.2.0 age adoption passing confidence

Release Notes

reactphp/promise (react/promise)

v3.2.0

Compare Source

  • Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations.
    (#​260 by @​Ayesh)

  • Feature: Include previous exceptions when reporting unhandled promise rejections.
    (#​262 by @​clue)

  • Update test suite to improve PHP 8.4+ support.
    (#​261 by @​SimonFrings)

v3.1.0

Compare Source

v3.0.0

Compare Source

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();
    $promise = reject();
    
    // new (already supported before)
    $promise = resolve(null);
    $promise = reject(new RuntimeException());
  • Feature / BC break: Report all unhandled rejections by default and remove done() method.
    Add new set_rejection_handler() function to set the global rejection handler for unhandled promise rejections.
    (#​248, #​249 and #​224 by @​clue)

    // Unhandled promise rejection with RuntimeException: Unhandled in example.php:2
    reject(new RuntimeException('Unhandled'));
  • BC break: Remove all deprecated APIs and reduce API surface.
    Remove some(), map(), reduce() functions, use any() and all() functions instead.
    Remove internal FulfilledPromise and RejectedPromise classes, use resolve() and reject() functions instead.
    Remove legacy promise progress API (deprecated third argument to then() method) and deprecated LazyPromise class.
    (#​32 and #​98 by @​jsor and #​164, #​219 and #​220 by @​clue)

  • BC break: Make all classes final to encourage composition over inheritance.
    (#​80 by @​jsor)

  • Feature / BC break: Require array (or iterable) type for all() + race() + any() functions and bring in line with ES6 specification.
    These functions now require a single argument with a variable number of promises or values as input.
    (#​225 by @​clue and #​35 by @​jsor)

  • Fix / BC break: Fix race() to return a forever pending promise when called with an empty array (or iterable) and bring in line with ES6 specification.
    (#​83 by @​jsor and #​225 by @​clue)

  • Minor performance improvements by initializing Deferred in the constructor and avoiding call_user_func() calls.
    (#​151 by @​WyriHaximus and #​171 by @​Kubo2)

  • Minor documentation improvements.
    (#​110 by @​seregazhuk, #​132 by @​CharlotteDunois, #​145 by @​danielecr, #​178 by @​WyriHaximus, #​189 by @​srdante, #​212 by @​clue, #​214, #​239 and #​243 by @​SimonFrings and #​231 by @​nhedger)

The following changes had to be ported to this release due to our branching
strategy, but also appeared in the 2.x branch:

The following changes were originally planned for this release but later reverted
and are not part of the final release:

v2.11.0

Compare Source

This is a compatibility release to ensure a smooth upgrade path for those not yet
on Promise v3. We encourage upgrading to the latest version when possible, as
Promise v3 will be the way forward for this project.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from WyriHaximus as a code owner July 19, 2023 20:36
@renovate
Copy link
Contributor Author

renovate bot commented Jul 19, 2023

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: composer.lock
Command failed: docker run --rm --name=renovate_a_sidecar --label=renovate_a_child --memory=3584m -v "/tmp/worker/b44e04/582ea6/repos/github/WyriHaximus/reactphp-child-process-messenger":"/tmp/worker/b44e04/582ea6/repos/github/WyriHaximus/reactphp-child-process-messenger" -v "/tmp/worker/b44e04/582ea6/cache":"/tmp/worker/b44e04/582ea6/cache" -e COMPOSER_CACHE_DIR -e COMPOSER_AUTH -e CONTAINERBASE_CACHE_DIR -w "/tmp/worker/b44e04/582ea6/repos/github/WyriHaximus/reactphp-child-process-messenger" ghcr.io/containerbase/sidecar:9.24.0 bash -l -c "install-tool php 7.4.7 && install-tool composer 2.6.5 && composer update react/promise:3.1.0 --with-dependencies --ignore-platform-req='ext-*' --ignore-platform-req='lib-*' --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins"
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires react/promise ^3.1.0, found react/promise[v3.1.0] but these were not loaded, likely because it conflicts with another require.
  Problem 2
    - react/promise-stream is locked to version v1.6.0 and an update of this package was not requested.
    - react/promise-stream v1.6.0 requires react/promise ^3 || ^2.1 || ^1.2 -> found react/promise[v1.2.0, v1.2.1, v1.3.0, v2.1.0, ..., v2.11.0, v3.0.0, v3.1.0] but these were not loaded, likely because it conflicts with another require.
  Problem 3
    - react/promise-timer is locked to version v1.9.0 and an update of this package was not requested.
    - react/promise-timer v1.9.0 requires react/promise ^3.0 || ^2.7.0 || ^1.2.1 -> found react/promise[v1.2.1, v1.3.0, v2.7.0, ..., v2.11.0, v3.0.0, v3.1.0] but these were not loaded, likely because it conflicts with another require.
  Problem 4
    - react/socket is locked to version v1.13.0 and an update of this package was not requested.
    - react/socket v1.13.0 requires react/promise ^3 || ^2.6 || ^1.2.1 -> found react/promise[v1.2.1, v1.3.0, v2.6.0, ..., v2.11.0, v3.0.0, v3.1.0] but these were not loaded, likely because it conflicts with another require.
  Problem 5
    - wyrihaximus/ticking-promise is locked to version 3.0.0 and an update of this package was not requested.
    - wyrihaximus/ticking-promise 3.0.0 requires react/promise ^2.8 -> found react/promise[v2.8.0, v2.9.0, v2.10.0, v2.11.0] but it conflicts with your root composer.json require (^3.1.0).
  Problem 6
    - wyrihaximus/async-test-utilities is locked to version 4.2.2 and an update of this package was not requested.
    - wyrihaximus/async-test-utilities 4.2.2 requires react/promise ^2.9 -> found react/promise[v2.9.0, v2.10.0, v2.11.0] but it conflicts with your root composer.json require (^3.1.0).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

@boring-cyborg boring-cyborg bot added Dependencies 📦 Pull requests that update a dependency file JSON 👨‍💼 PHP 🐘 Hypertext Pre Processor labels Jul 19, 2023
@renovate renovate bot force-pushed the renovate/react-promise-3.x branch from 61a373b to d644fdb Compare July 20, 2023 08:54
@renovate renovate bot force-pushed the renovate/react-promise-3.x branch from d644fdb to 9d44a1f Compare September 6, 2023 20:31
@renovate renovate bot force-pushed the renovate/react-promise-3.x branch from 9d44a1f to 085f2ec Compare November 16, 2023 19:02
Copy link
Contributor Author

renovate bot commented May 9, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: composer.lock
Command failed: composer update react/promise:3.2.0 --with-dependencies --ignore-platform-req='ext-*' --ignore-platform-req='lib-*' --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires react/promise ^3.2.0, found react/promise[v3.2.0] but these were not loaded, likely because it conflicts with another require.
  Problem 2
    - react/promise-stream is locked to version v1.6.0 and an update of this package was not requested.
    - react/promise-stream v1.6.0 requires react/promise ^3 || ^2.1 || ^1.2 -> found react/promise[v1.2.0, v1.2.1, v1.3.0, v2.1.0, ..., v2.11.0, v3.0.0, v3.1.0, v3.2.0] but these were not loaded, likely because it conflicts with another require.
  Problem 3
    - react/promise-timer is locked to version v1.9.0 and an update of this package was not requested.
    - react/promise-timer v1.9.0 requires react/promise ^3.0 || ^2.7.0 || ^1.2.1 -> found react/promise[v1.2.1, v1.3.0, v2.7.0, ..., v2.11.0, v3.0.0, v3.1.0, v3.2.0] but these were not loaded, likely because it conflicts with another require.
  Problem 4
    - react/socket is locked to version v1.13.0 and an update of this package was not requested.
    - react/socket v1.13.0 requires react/promise ^3 || ^2.6 || ^1.2.1 -> found react/promise[v1.2.1, v1.3.0, v2.6.0, ..., v2.11.0, v3.0.0, v3.1.0, v3.2.0] but these were not loaded, likely because it conflicts with another require.
  Problem 5
    - wyrihaximus/ticking-promise is locked to version 3.0.0 and an update of this package was not requested.
    - wyrihaximus/ticking-promise 3.0.0 requires react/promise ^2.8 -> found react/promise[v2.8.0, v2.9.0, v2.10.0, v2.11.0] but it conflicts with your root composer.json require (^3.2.0).
  Problem 6
    - wyrihaximus/async-test-utilities is locked to version 4.2.2 and an update of this package was not requested.
    - wyrihaximus/async-test-utilities 4.2.2 requires react/promise ^2.9 -> found react/promise[v2.9.0, v2.10.0, v2.11.0] but it conflicts with your root composer.json require (^3.2.0).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

@renovate renovate bot force-pushed the renovate/react-promise-3.x branch from 085f2ec to 6ec976b Compare May 9, 2024 17:35
@renovate renovate bot force-pushed the renovate/react-promise-3.x branch from 6ec976b to e320204 Compare May 24, 2024 12:30
@renovate renovate bot force-pushed the renovate/react-promise-3.x branch from e320204 to 641d5b3 Compare November 27, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies 📦 Pull requests that update a dependency file JSON 👨‍💼 PHP 🐘 Hypertext Pre Processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants