refactor: replace kotlinx-io with okio for file I/O#123
Merged
Conversation
Okio provides a unified cross-platform FileHandle API with built-in random access support (positional read/write, flush, resize), eliminating the need for the RandomAccessHandle abstraction and its per-platform implementations (JvmRandomAccessHandle, IosRandomAccessHandle). - Replace kotlinx-io 0.9.0 with okio 3.16.4 across all modules - Delete RandomAccessHandle interface and JVM/Android/iOS implementations - Rewrite PathFileAccessor to use okio FileHandle (openReadWrite) - Add platformFileSystem expect/actual to abstract FileSystem.SYSTEM (unavailable on WasmJs; throws UnsupportedOperationException there) - Simplify createFileAccessor on JVM/iOS (no more handleFactory param) - Update resolveChildPath to use okio Path division operator - Update DownloadExecution.deduplicatePath to use okio Path/FileSystem - Update FileConfigStore to use okio source/sink/buffer APIs - Remove unused kotlinx-io dependency from library:sqlite - Update GraalVM --initialize-at-build-time from kotlinx.io to okio
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Test Results1 045 tests - 76 1 045 ✅ - 76 14s ⏱️ -1s Results for commit 59e3681. ± Comparison against base commit 2c1ae06. This pull request removes 350 and adds 274 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Replace wasmJs with js target in library:api and library:core to enable okio-nodefilesystem (NodeJsFileSystem) for Kotlin/JS. Add wasmWasi target with okio-wasifilesystem (WasiFileSystem) for WASI runtimes. Remove wasmJs from these modules since app/web (the only wasmJs consumer) only uses RemoteKetch and doesn't need core/api.
The wasmJs target was replaced with js in library modules, so the wasmJsBrowserTest/wasmJsNodeTest Gradle tasks no longer exist.
InstanceFactory no longer references library:core types (Ketch, DownloadSource, TaskStore, KtorHttpEngine). Instead, each platform (Android, Desktop, iOS) creates the embedded Ketch instance inline and passes it as an embeddedFactory lambda. This removes the library:core dependency from app:shared's commonMain, allowing wasmJs builds to work without the core engine. Also restores wasmJs target on library:api since downstream modules still need it.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Okio provides a unified cross-platform FileHandle API with built-in random access support (positional read/write, flush, resize), eliminating the need for the RandomAccessHandle abstraction and its per-platform implementations (JvmRandomAccessHandle, IosRandomAccessHandle).