Skip to content

Commit

Permalink
Updated Changelog for v6-7.
Browse files Browse the repository at this point in the history
Updated ImportConnector in UML class diagram.
Updated Readme (minor).
  • Loading branch information
Bilge committed Dec 7, 2022
1 parent 4a572ec commit 934e199
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Porter change log

## 7.0.0 – Unified API

Unifies the synchronous and asynchronous APIs, so they are one and the same.

### Breaking changes

* Removed all async-specific code paths, including `Porter::fetchAsync()` and `Porter::fetchOneAsync()`.
* Renamed `ImportSpecification` -> `Import`.
* Renamed `StaticDataSpecification` -> `StaticImport`.
* Changed `Porter`, `MemoryCache` and all outstanding exceptions' inheritance accessibility to `final`.

## 6.0.0 – Fibers

Replaces coroutines with fibers as the new async technology.

### Breaking changes

* Removed support for PHP less than 8.1.
* Removed support for Amp v2 in lieu of Amp v3 (beta).
* All methods returning `Amp\Promise` were changed to their underlying type.
* Added union types and `mixed` where appropriate, e.g. `Connector|AsyncConnector`.
* Changed `PorterRecords` semantics to always run generators to the first suspension point.

## 5.0.0 – Async

Porter v5 introduces asynchronous imports and complete strict type safety (excluding union types and generics).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Asynchronous

Porter has had asynchronous support since version 5 (2019) thanks to [Amp][] integration. In v5, async was implemented with coroutines, but from version 6 onwards, Porter uses the simpler [fibers][] model. Fiber support is included in PHP 8.1 and can be added to PHP 8.0 using [ext-fiber][]. PHP 7 does not support fibers, so if you are stuck with that version of PHP, coroutines are the only option. It is strongly recommended to upgrade to PHP 8.1 to use async, to avoid unnecessary bugs leading to segfaults and to avoid getting trapped in the coroutine architecture that is cumbersome to upgrade, difficult to debug and harder to reason about.

In version 5, Porter offered a dual API to support the asynchronous code path. That is, `Porter::import` had the async analogue: `Porter::importAsync` and `Porter::importOne` had the async analogue: `Porter::importOneAsync`. In version 6 we switched to fibers but kept the dual API to making migrating from coroutines to fibers slightly easier. Since version 7, we unified the dual API because async with fibers can be almost entirely transparent: the synchronous and asynchronous code paths are identical, so we don't even have to think about async unless and until we want to start leveraging its benefits in our application.
In version 5, Porter offered a dual API to support the asynchronous code path. That is, `Porter::import` had the async analogue: `Porter::importAsync` and `Porter::importOne` had `Porter::importOneAsync`. In version 6 we switched to fibers but kept the dual API to making migrating from coroutines to fibers slightly easier. Since version 7, we unified the dual API because async with fibers can be almost entirely transparent: the synchronous and asynchronous code paths are identical, so we don't even have to think about async unless and until we want to start leveraging its benefits in our application.

To use async in Porter v7 onwards, simply wrap an `import()` or `importOne()` call in an `async()` call using one of the following two methods.

Expand Down
Binary file modified docs/images/diagrams/Porter UML class diagram 7.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 934e199

Please sign in to comment.