-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31be9bc
commit 9f1ed05
Showing
4 changed files
with
118 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
### 0.5.0 | ||
|
||
_Not Released Yet_ | ||
_Released 2024 Jul 22_ | ||
|
||
#### Overview | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,59 @@ | ||
### 0.4.0 | ||
### 0.5.0 | ||
|
||
_Released 2022 Jul 27_ | ||
_Released 2024 Jul 22_ | ||
|
||
#### Overview | ||
|
||
This release is a long overdue major update to the project. The entire API | ||
surface has been touched up and improved to provide a better developer | ||
experience. | ||
|
||
The most significant change is the decoupling of request creation from request | ||
execution: | ||
|
||
```kotlin | ||
// Old | ||
suspend fun main() { | ||
val client = GW2APIClient(...) | ||
val requestBuilder = client.gw2v2Build() | ||
|
||
val request = coroutineScope { requestBuilder.execute(this) } | ||
val response = request.get() | ||
|
||
val gw2v2Build = response.data.getOrNull() ?: error("Could not decode request") | ||
|
||
println("Build ID: ${gw2v2Build.id}") | ||
} | ||
``` | ||
|
||
Whereas the old way to create request contained a lot of ceremony to support | ||
asynchronous and synchronous execution at the same time, the new way is much | ||
more straightforward: | ||
|
||
```kotlin | ||
// New | ||
suspend fun main() { | ||
val client = Gw2ApiClient() | ||
val gw2v2Build = client.executeAsync(gw2v2Build()).dataOrNull ?: error("Failed to fetch build ID.") | ||
|
||
println("Build ID: {$gw2v2Build.id}") | ||
} | ||
``` | ||
|
||
There is no full migration guide available. Please refer to the updated | ||
documentation for more information. | ||
|
||
#### Improvements | ||
|
||
- Updated to [api-generator](https://github.com/GW2ToolBelt/api-generator) to [0.6.0](https://github.com/GW2ToolBelt/api-generator/releases/tag/v0.6.0). | ||
- Cleaned up caching. | ||
- Renamed `CacheAccessor` to `CacheAccess`. | ||
- Cache time overwrites were removed for now. | ||
- Cleaned up the `RateLimiter` interface and related hooks. | ||
- A default `TokenBucketRateLimiter` implementation is now available. | ||
- API clients are now configured to use a rate limiter by default. | ||
- Introduced the `DecodingResult` abstraction to improve error-handling | ||
capabilities for malformed data from the API. | ||
- Introduced the `ResponseHeaders` abstraction that wraps headers of a | ||
`Response` and provides utilities. | ||
- Improved documentation throughout the entire library. | ||
- Added an explicit Java module descriptor for `api-types`. | ||
- Added a simple API to allow blocking execution of requests on the JVM. | ||
- This is especially useful in combination with virtual threads. | ||
- Replaced placeholder exception that is thrown when an unknown type is | ||
encountered with a `SerializationException`. | ||
- Migrated to schema version `2022-03-23T19:00:00.000Z`. | ||
|
||
#### Breaking Changes | ||
|
||
- All modules now require Kotlin 1.7 | ||
- JVM modules now require Java 11 | ||
- The library was significantly reworked and many things were either renamed or | ||
relocated. Detailed migration guidelines are not available for this release. | ||
- Migrated to schema version `2022-03-23T19:00:00.000Z`. | ||
- The entire API client has been rewritten to decouple request creation from | ||
execution. Please see the updated documentation for more information. |