Skip to content

Releases: PhpGt/Promise

Simplify exception handling

01 Jul 11:01
Compare
Choose a tag to compare

In this minor patch release, exceptions that are handled in the chain already are stored. This is to prevent an rejection being handled more than once per call.

Uncaught exceptions are thrown on main thread

29 Jun 12:55
c1fbcdc
Compare
Choose a tag to compare

In this minor patch release, to match the expectations of working with code that throws exceptions, when there is no catch() method in the promise chain, any exceptions that are raised will be thrown to the main thread, causing a fatal error.

What's Changed

  • Remove scrutinizer by @g105b in #55
  • Exceptions are thrown when there is no catch() function by @g105b in #60

Full Changelog: v2.2.1...v2.2.2

Simplification of chain handling

29 Apr 15:17
0a81e45
Compare
Choose a tag to compare

This release introduces much more QA tooling and matrix builds in Github Actions.

There has been significant effort put into the refactoring of handleChain() function, so that it is easier to understand and debug. This was done because of an outstanding bug with the Fetch library.

Every effort has been put in place to retain the same footprint, as the unit tests show.

What's Changed

  • build: hard dependencies by @g105b in #18
  • maintenance: dependabot by @g105b in #20
  • Rejection of promises through promise chains by @g105b in #31
  • Harden tests by @g105b in #33
  • Simplify chain handling by @g105b in #53
  • ci: improve ci with qa tools and matrix builds by @g105b in #54

Full Changelog: v2.2.0...v2.2.1

Deferred processes & chaining nested promises

21 May 18:28
1e15108
Compare
Choose a tag to compare

This release comes with some real-world tests, added to mimic the functionality of real-world usage of this library.

In the unit tests you'll see some lazy-searching over data structures that involve multiple nested promises. There are no backwards breaking changes in this release, but to achieve this functionality, the Deferred class can now be assigned processes to execute as part of its task.

As always, have fun and stay productive!

Chained Promises will always resolve

21 Jan 13:56
7a4f103
Compare
Choose a tag to compare

Along with PHP 7.4 - 8.0 interoperability, this update brings bugfix #12.

If any Chainable returns an instance of PromiseInterface, the next Chainable will not be called until the PromiseInterface resolves, at which point the next Chainable will be resolved with the resolved value of the promise, instead of the Promise itself.

This is more consistent with how the Web APIs work. Specifically, using the Fetch API - a Promise is returned for the actual fetch, but also for retrieving the response body. The final callback in the chain doesn't want to be provided with an unresolved promise, instead it only cares about the final resolved value of the promise.

Refactored Promise for simplicity

21 Jan 12:09
148ab09
Compare
Choose a tag to compare

The original v1 release of this library was feature complete, but it was based on the complex design of CommonJS Promises. There were a number of issues that arose from the design limitations imposed by this decision, but the unit tests were already in place, so it was worth it to refactor the Promise class completely.

The new implementation has the same external functionality, but with two main improvements: 1) much better compatibility with Web API Promises; 2) much, much simpler.

The main point of this refactor is to move to a simpler queue-based system, rather than a recursive one. You can see the queue in action as the Promise's chain property, which will contain a reference to each of the new Chainable objects: ThenChain, CatchChain and FinallyChain.

Have fun!

Public release

15 Jan 18:47
2a7e838
Compare
Choose a tag to compare

Promise is now v1 and will start making its way into the asynchronous functionality throughout PHP.Gt! Full test coverage has been shipped with this release.

Please leave any questions or comments in the issues list.

Have fun, and stay productive!

HTTPlug compatibility

15 Jan 16:19
0075e66
Compare
Choose a tag to compare
HTTPlug compatibility Pre-release
Pre-release

This is the final pre-release before v1, and with it comes full compatibility with HTTPlug. Although relatively simple, this is a major piece of functionality that will make PHP.Gt repositories much more compatible with other standards.

Github Actions

15 Jan 16:18
7e994c8
Compare
Choose a tag to compare
Github Actions Pre-release
Pre-release

CI has been improved in this pre-release. Now all functionality is tested using Github Actions.

More tests passing

15 Jan 16:17
Compare
Choose a tag to compare
More tests passing Pre-release
Pre-release

Basic functionality is made possible in this pre-release. Soon we will have a fully functioning promise library.