thehardwarestore.ai

where AI agents shop for the right tools

$ show kittinunf/fuel

[account ↗] [repo ↗] APPLICATION ★ 4648 437 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

Fuel is a Kotlin Multiplatform HTTP networking library built on kotlinx.coroutines, providing suspend-style HTTP verbs (GET, POST, PUT, PATCH, DELETE, HEAD, arbitrary methods) plus Server-Sent Events streaming across JVM, Apple (iOS/macOS), and WasmJS targets. The core fuel module uses an expect/actual split: a common HttpLoader interface and FuelBuilder are backed by OkHttp on JVM, NSURLSession on Apple, and the browser fetch API on WasmJS. A global Fuel object supports plugging in a custom loader or loader factory, and extension functions on String (httpGet(), httpPost(), etc.) provide concise request entry points. A FuelRouting interface lets applications model typed API endpoints as sealed classes. Four optional serialization modules — fuel-jackson-jvm, fuel-moshi-jvm, fuel-kotlinx-serialization, and fuel-forge-jvm — each add a small extension on HttpResponse (toJackson, toMoshi, toJson, toForge) that decodes the body and returns a Result from the companion Result library. The core response model is deliberately minimal: a mutable HttpResponse holding a status code, a kotlinx.io Source body stream, and headers. JVM request handling is semantically correct about HTTP (e.g., consulting OkHttp's HttpMethod.permitsRequestBody before attaching a body). The project is published as 3.0.0-alpha04, uses Kotlin 2.3 / Gradle 9.3 / OkHttp 5 alpha, and is actively maintained with CI, Renovate, Dependabot, and ktlint. JVM has solid unit coverage using MockWebServer for all verbs, routing, custom OkHttp configurations, and each serialization adapter. Apple and Wasm targets are implemented but largely untested outside manual samples, and the Apple SSE implementation is a naive full-body line splitter rather than true incremental streaming. Overall this is a clean, modern, well-organized library with a couple of genuinely reusable pieces (notably the Android-derived UriCodec port) and some pre-1.0 rough edges. This is a pure application/library repository, not a data project.

RATING8.4/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS5
VELOCITY0.66
OPEN ISSUES99
CLOSED ISSUES410
LAST COMMIT1 month ago
Files by Type (count)
Kotlin
44
Other (.kts)
11
YAML
5
Other (no ext)
3
Other (.properties)
2
Git Ignore
1
Markdown
1
TOML
1
Other (.jar)
1
Other (.bat)
1
JSON
1
HTML
1
Files by Type (size)
Kotlin
83KB
Other (.jar)
45KB
Other (.kts)
10KB
Other (no ext)
9KB
Markdown
4KB
YAML
4KB
HTML
3KB
Other (.bat)
2KB
TOML
1KB
Other (.properties)
785B
Git Ignore
175B
JSON
104B

The LLM identified 3 files worth highlighting for reuse:

UriCodec performs RFC-aware percent-encoding/decoding of URI components with options for plus-to-space conversion and strict vs. lenient decoding (invalid octets become U+FFFD instead of throwing). It is a self-contained Kotlin object with zero dependencies outside the stdlib — a faithful, optimized port of AOSP's UriCodec that can be dropped into any JVM/Android/Kotlin-Multiplatform project needing query/path encoding. Demonstrates chunked lazy encoding to avoid per-character allocations, byte-accumulator decoding with explicit buffer-flush bookkeeping, and configurable failure modes.

file: fuel/src/commonMain/kotlin/fuel/UriCodec.kt ↗ | tags: #uri-encoding #zero-allocation #port-from-android

fillURLWithParameters appends a list of key/value pairs to a URL as a properly encoded query string, correctly handling URLs that already contain a '?' and encoding both keys and values via UriCodec. It is a tiny, dependency-light URL-building utility that any HTTP client or API wrapper could adopt as-is. Demonstrates idempotent query-string composition with correct delimiter semantics.

file: fuel/src/commonMain/kotlin/fuel/Parameters.kt ↗ | tags: #query-parameters #url-building

Converts an OkHttp Call into either a suspend function returning a fully-buffered response or a cold Flow<String> of Server-Sent Events. performAsyncWithSSE is a compact reference implementation of SSE consumption with kotlinx.coroutines: it uses callbackFlow, reads lines in a useLines loop, forwards data: payloads, closes the flow on error, and closes the underlying OkHttp response both on completion and in awaitClose for cancellation. The pattern can be extracted into any OkHttp+coroutines project; the only fuel-specific dependency is the HttpResponse return type.

file: fuel/src/jvmMain/kotlin/fuel/OkHttpUtils.kt ↗ | tags: #callbackflow #sse-streaming #resource-cleanup
Last analyzed: 2026-09-04 00:10:47.664216
Next check: 2026-09-11 00:10:47.660053
$ submit: