|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file, in reverse chronological order by release. |
| 4 | + |
| 5 | +## 4.0.0 - 2018-06-12 |
| 6 | + |
| 7 | +Initial release highlights include: |
| 8 | + |
| 9 | +- \Psr\Cache is now used for caching |
| 10 | +- Min version of PHP is now >= 7.1 |
| 11 | +- strict_types throughout with scalar type hints and return types |
| 12 | +- Much improved test coverage ~ 95% |
| 13 | +- Introduced document hydration so you can implement concrete content models in code |
| 14 | +- Re-Introduced typed content fragments such as `RichText`, `Date`, `Embed`, `GeoPoint` etc. |
| 15 | +- Transparent support for both V1 and V2 Apis |
| 16 | +- Default document implementation can retrieve it's own relationships such as alternative translations |
| 17 | +- Guaranteed to throw predictable exceptions all implementing the same interface in the same namespace |
| 18 | + |
| 19 | +## Future changes |
| 20 | + |
| 21 | +The `LinkResolver` as a concept is now pretty much a hard dependency for `\Prismic\Api` but relies on setter injection. The good thing is that this enables other elements, such as `RichText` to be serialised to HTML without needing to keep a link resolver handy all the time, i.e. `$textFragment->asHtml()` instead of `$textFragment->asHtml($linkResolver)` which can be annoying in views, but the bad thing is that it's a hidden dependency. At some point this needs to be made more friendly… |
| 22 | + |
| 23 | +The same could be said of the `Hydrator` - The defaults are perfectly acceptable and they are straight-forward to override but it's still a hidden dependency. |
| 24 | + |
| 25 | +In future, I'm considering providing ready to use factories and configuration suitable for `Psr\Container` - it's good to practice dependency injection and everyone's doing it right? |
| 26 | + |
| 27 | +### `\Prismic\Api` Notable Gotchas |
| 28 | + |
| 29 | +- Methods `getByID`, `getByIDs`, `getByUID` have been camel-cased to `getById`, `getByIds` and `getByUid` |
| 30 | +- Method `previewSession` signature has changed. A Link resolver is no longer required: `previewSession( string $token, string $defaultUrl) : string` |
| 31 | +- Named constructor `get()` has changed to `Api::get( string $action, string $accessToken, Client $httpClient, \Psr\Cache\CacheItemPoolInterface $cache) |
0 commit comments