Skip to content

Commit

Permalink
Release 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mizosoft committed Dec 27, 2024
1 parent 8c20ee9 commit b8b0a21
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Release

on:
release:
types: [ created ]
types: [ published ]
workflow_dispatch:

env:
BASE_JAVA: 11
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Change Log

## Version 1.8.0

Ok, here we go. That took a while.

There's been a number of unreleased features brewing in the last two and a half years (!). Guess I could say I've been cooking some Meth—anol, and now it's ready to serve. What's—my—name? Please don't say [Heisenbug](https://en.wikipedia.org/wiki/Heisenbug#:~:text=In%20computer%20programming%20jargon%2C%20a,one%20attempts%20to%20study%20it.).

Anyhow, here's what's new:

* Added a [Redis storage backend](https://mizosoft.github.io/methanol/redis/) for the HTTP cache, which supports Standalone & Cluster setups.
* Added the ability to chain caches with different storage backends, expectedly in the order of decreasing locality.
This will work well with the Redis cache. Consider the case where you have multiple instances of your service all sharing
a Redis setup, you can have a chain of (JVM memory -> Redis) or even (JVM memory -> disk -> Redis) caches, so each node can have a local cache to consult first, and the shared Redis cache after.
* The object mapping mechanism has been reworked to stay away from `ServiceLoader` & static state.
We now have an `AdapterCodec` that is registered per-client.
```java
var mapper = new JsonMapper();
var adapterCodec =
AdapterCodec.newBuilder()
.encoder(JacksonAdapterFactory.createJsonEncoder(mapper))
.decoder(JacksonAdapterFactory.createJsonDecoder(mapper))
.build();
var client =
Methanol.newBuilder()
.adapterCodec(adapterCodec)
.build();

record Person(String name) {}

HttpResponse<Person> response = client.send(
MutableRequest.GET(".../echo", new Person("Jack Reacher"), MediaType.APPLICATION_JSON),
Person.class);
```
* Added hip Kotlin extensions. These were enjoyable to work on. [Check them out!](https://mizosoft.github.io/methanol/kotlin/).
* Added adapters for [Moshi](https://github.com/square/moshi). This is mainly intended for Kotlin.
* Added hints API for adapters. This allows carrying arbitrary parameters to customize encoders & decoders. Currently, supported
adapters expose no customization. If you think there's a useful, generalizable customization that can be passed to any of the supported adapters, feel free to create an issue.
* Added `MoreBodyPublishers::ofOutputStream` & `MoreBodyPublishers::ofByteChannel` to be used in favor of `WritableBodyPublisher`.
* Added adapters for [basic](https://mizosoft.github.io/methanol/api/latest/methanol/com/github/mizosoft/methanol/AdapterCodec.Builder.html#basic()) types in the core module.
* Added the ability to conditionally handle responses with [`ResponsePayload`](https://mizosoft.github.io/methanol/api/latest/methanol/com/github/mizosoft/methanol/ResponsePayload.html) using the basic adapter.
* Disk cache writes became considerably faster by avoiding `fsync` on entry writes/updates, which was used to provide durability in a manner that later turned out
to be unnecessary for caches. Now CRC checks are used. Reads however became slightly slower.
* Added adapters for JAXB Jakarta. They're practically the same as JAXB JavaEE, but use the newer namespaces.
* New `HttpClient` APIs for closure & for setting a local socket address have been implemented.
* As of Java 16, `sendAsync(...).cancel(true)`, or an interruption for the thread calling `send` can cancel the underlying
exchange. This is made sure to continue being the case even after the Methanol seasoning.
* Made `ResponseBuilder` part of public API.

There are other incremental improvements here and there that I may have missed. I promise though your code won't break after the update. If that happens, please file an issue.

Later!

## Version 1.7.0

*9-5-2022*
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2024 mizosoft
Copyright (c) 2024 Moataz Hussein

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
*note: documentation may contain updates for 1.8.0, which is not yet released*

# Methanol

[![CI status](https://img.shields.io/github/actions/workflow/status/mizosoft/methanol/build.yml?branch=master&logo=github&style=flat-square)](https://github.com/mizosoft/methanol/actions)
Expand All @@ -14,14 +12,14 @@ You can say it's an `HttpClient` wrapper, but you'll see it almost seamlessly in
Methanol isn't invasive. The core library has zero runtime dependencies. However, special attention
is given to object mapping, so integration with libraries like Jackson or Gson becomes a breeze.

[//]: # (There's also a nice DSL for Kotlin lovers!)
There's also a Kotlin DSL!

## Installation

### Gradle

```gradle
implementation 'com.github.mizosoft.methanol:methanol:1.7.0'
```kotlin
implementation("com.github.mizosoft.methanol:methanol:1.8.0")
```

### Maven
Expand All @@ -31,7 +29,7 @@ implementation 'com.github.mizosoft.methanol:methanol:1.7.0'
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions methanol-brotli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Provides [brotli][brotli] decompression.
### Gradle

```gradle
implementation 'com.github.mizosoft.methanol:methanol-brotli:1.7.0'
implementation("com.github.mizosoft.methanol:methanol-brotli:1.8.0")
```

### Maven
Expand All @@ -16,7 +16,7 @@ implementation 'com.github.mizosoft.methanol:methanol-brotli:1.7.0'
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-brotli</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions methanol-gson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Adapters for JSON using [Gson][gson].
### Gradle

```kotlin
implementation("com.github.mizosoft.methanol:methanol-gson:1.7.0")
implementation("com.github.mizosoft.methanol:methanol-gson:1.8.0")
```

### Maven
Expand All @@ -16,7 +16,7 @@ implementation("com.github.mizosoft.methanol:methanol-gson:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-gson</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
6 changes: 3 additions & 3 deletions methanol-jackson-flux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ With the exception of `Mono`, any subtype of `org.reactivestreams.Publisher` or

### Gradle

```gradle
implementation("com.github.mizosoft.methanol:methanol-jackson-flux:1.7.0")
```kotlin
implementation("com.github.mizosoft.methanol:methanol-jackson-flux:1.8.0")
```

### Maven
Expand All @@ -32,7 +32,7 @@ implementation("com.github.mizosoft.methanol:methanol-jackson-flux:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-jackson-flux</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
6 changes: 3 additions & 3 deletions methanol-jackson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Adapters for [Jackson][jackson].

### Gradle

```gradle
implementation("com.github.mizosoft.methanol:methanol-jackson:1.7.0")
```kotlin
implementation("com.github.mizosoft.methanol:methanol-jackson:1.8.0")
```

### Maven
Expand All @@ -16,7 +16,7 @@ implementation("com.github.mizosoft.methanol:methanol-jackson:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-jackson</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
6 changes: 3 additions & 3 deletions methanol-jaxb-jakarta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Adapters for XML using Jakarta EE's [JAXB][jaxb].

### Gradle

```gradle
implementation("com.github.mizosoft.methanol:methanol-jaxb-jakarta:1.7.0")
```kotlin
implementation("com.github.mizosoft.methanol:methanol-jaxb-jakarta:1.8.0")
```

### Maven
Expand All @@ -16,7 +16,7 @@ implementation("com.github.mizosoft.methanol:methanol-jaxb-jakarta:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-jaxb-jakarta</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
6 changes: 3 additions & 3 deletions methanol-jaxb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Adapters for XML using Java EE's [JAXB][jaxb].

### Gradle

```gradle
implementation("com.github.mizosoft.methanol:methanol-jaxb:1.7.0")
```kotlin
implementation("com.github.mizosoft.methanol:methanol-jaxb:1.8.0")
```

### Maven
Expand All @@ -16,7 +16,7 @@ implementation("com.github.mizosoft.methanol:methanol-jaxb:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-jaxb</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
2 changes: 0 additions & 2 deletions methanol-kotlin/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# methanol-kotlin

*note: coming soon!*

Kotlin extensions for Methanol, which include:

- A DSL for HTTP requests.
Expand Down
4 changes: 2 additions & 2 deletions methanol-moshi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Adapters for JSON using [moshi](https://github.com/square/moshi).
### Gradle

```gradle
implementation("com.github.mizosoft.methanol:methanol-moshi:1.7.0")
implementation("com.github.mizosoft.methanol:methanol-moshi:1.8.0")
```

### Maven
Expand All @@ -16,7 +16,7 @@ implementation("com.github.mizosoft.methanol:methanol-moshi:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-moshi</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down
6 changes: 3 additions & 3 deletions methanol-protobuf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Any subtype of `MessageLite` is supported by encoders & decoders. Decoders can o

### Gradle

```gradle
implementation("com.github.mizosoft.methanol:methanol-protobuf:1.7.0")
```kotlin
implementation("com.github.mizosoft.methanol:methanol-protobuf:1.8.0")
```

### Maven
Expand All @@ -21,7 +21,7 @@ implementation("com.github.mizosoft.methanol:methanol-protobuf:1.7.0")
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol-protobuf</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

Expand Down

0 comments on commit b8b0a21

Please sign in to comment.