Skip to content

Releases: xxfast/KStore

0.9.1

06 Nov 04:03
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.9.0...0.9.1

0.9.0

24 Oct 03:18
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.8.0...0.9.0

⚠️ Breaking Changes

  1. Bump kstore to 0.9.0 and remove okio from your dependencies from your libs.version.toml
[versions]
-  kstore = "0.8.0"
+  kstore = "0.9.0"
-  okio = "3.6.0"
  1. If you are using kstore-file, migrate to kotlinx-io's Path from okio's .toPath()
-  import okio.Path.Companion.toPath
+  import kotlinx.io.files.Path 

- val store: KStore<Pet> = storeOf(file = "saved.json".toPath())
+ val store: KStore<Pet> = storeOf(file = Path("saved.json"))
  1. On iOS - Remove the use of experimental DocumentDirectory API, and use NSFileManager directly
-  val filesDir: String = NSFileManager.defaultManager.DocumentDirectory?.relativePath
+  val filesUrl: NSURL? = fileManager.URLForDirectory(
+    directory = NSDocumentDirectory,
+    appropriateForURL = null,
+    create = false,
+    inDomain = NSUserDomainMask,
+    error = null
+  )
+
+  val path: String = requireNotNull(filesUrl?.path) { "Documents directory not found" }

-  val files = filesDirectory.toPath()
+  val files = Path(path)
  1. On Desktop - If you are using harawata/appdirs, make sure to create those directories if they don't already exist. The store won't create them for you
+  val filesDir: String = AppDirsFactory.getInstance()
+    .getUserDataDir("io.github.xxfast.nytimes", "1.0.0", "xxfast") // or whereever

+  val path = Path(filesDir)
+  with(SystemFileSystem) { if(!exists(path)) createDirectories(path) }

val store: KStore<Pet> = storeOf(file = path)

Example Migration

xxfast/NYTimes-KMP@6eaa4a1

Full Documentation

https://xxfast.github.io/KStore/overview.html

0.8.0

11 May 01:01
Compare
Choose a tag to compare

What's Changed

  • Add wasm target by @xxfast in #92
  • Ensure version files are created at same path as store by @JanTie in #101

New Contributors

Full Changelog: 0.7.2...0.8.0

0.7.2

08 Apr 04:18
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.7.1...0.7.2

0.7.1

02 Dec 02:13
Compare
Choose a tag to compare

What's Changed

  • Add convenience extensions for NSFileManager cache and document directories by @xxfast in #72

Full Changelog: 0.7.0...0.7.1

0.7.0

30 Nov 15:42
Compare
Choose a tag to compare

What's Changed

  • Bump kotlinx-coroutines from 1.7.0-RC to 1.7.0 by @dependabot in #45
  • Bump com.android.tools.build:gradle from 8.0.0 to 8.0.1 by @dependabot in #46
  • Refactor move collection extensions to kstore by @xxfast in #47
  • Bump app.cash.turbine:turbine from 0.12.3 to 0.13.0 by @dependabot in #49
  • Bump kotlinx-coroutines from 1.7.0 to 1.7.1 by @dependabot in #50
  • Bump kotlinx-serialization from 1.5.0 to 1.5.1 by @dependabot in #48
  • Bump com.android.tools.build:gradle from 8.0.1 to 8.0.2 by @dependabot in #52
  • Bump org.jetbrains.kotlinx.binary-compatibility-validator from 0.13.1 to 0.13.2 by @dependabot in #53
  • Bump app.cash.turbine:turbine from 0.13.0 to 1.0.0 by @dependabot in #57
  • Bump okio from 3.3.0 to 3.4.0 by @dependabot in #60
  • Bump kotlin, coroutines, serialization and okio by @xxfast in #68
  • Refactor kstore-file api to remove string filePaths by @xxfast in #69
  • Add documentation by @xxfast in #70

Full Changelog: 0.6.0...0.7.0

0.6.0

02 May 07:13
Compare
Choose a tag to compare

What's Changed

  • Bump app.cash.turbine:turbine from 0.12.1 to 0.12.3 by @dependabot in #33
  • Bump to kotlin 1.8.20 by @xxfast in #35
  • Add gradle version catalog by @xxfast in #36
  • Bump com.android.tools.build:gradle from 7.4.2 to 8.0.0 by @dependabot in #37
  • Bump org.jetbrains.kotlinx.binary-compatibility-validator from 0.13.0 to 0.13.1 by @dependabot in #39
  • Bump kotlin from 1.8.20 to 1.8.21 by @dependabot in #40
  • Switch to new native IO dispatcher by @xxfast in #42
  • Remove KFolder api and tests by @xxfast in #43
  • Bump junit-jupiter from 5.9.2 to 5.9.3 by @dependabot in #41

Full Changelog: 0.5.0...0.6.0

⚠️ Breaking Changes

  • KFolder removed!

0.5.0

26 Mar 23:58
Compare
Choose a tag to compare

What's Changed

  • Add browser support 🌐
  • Extract encoder and decoders into a codec by @xxfast in #30
  • Add kstore-file and kstore-storage modules by @xxfast in #31

Full Changelog: 0.4.0...0.5.0

⚠️ Breaking Changes

  • encoder and decoder that the KStore constructor took in now encapsulated as a Codec
  • storeOf factory method moved from kstore to kstore-file / kstore-storage
  • Removed DefaultCodec and replaced with
    • FileCodec in kstore-file for file-based encoding/decoding
    • StorageCodec in kstore-storage for key-value storage-based encoding/decoding

0.4.0

23 Mar 00:33
Compare
Choose a tag to compare

What's Changed

  • Enable explicit api mode by @xxfast in #19
  • Bump org.jetbrains.kotlinx.binary-compatibility-validator from 0.12.1 to 0.13.0 by @dependabot in #20
  • Bump org.jetbrains.kotlinx:kotlinx-serialization-json-okio from 1.4.1 to 1.5.0 by @dependabot in #22
  • Bump org.jetbrains.kotlinx:kotlinx-serialization-json from 1.4.1 to 1.5.0 by @dependabot in #23
  • Fix store encoder to create a folder if it doesn't exist by @xxfast in #24
  • Bump org.jetbrains.dokka from 1.7.20 to 1.8.10 by @dependabot in #26
  • Bump com.android.tools.build:gradle from 7.4.1 to 7.4.2 by @dependabot in #25
  • Add sample git submodule by @xxfast in #27
  • Refactor move exception handling to the decoder by @xxfast in #28

⚠️ Breaking Changes

The store will now throw SerializationException when decoding a malformed file.

  • If you want to handle migrations, see migrations
  • If you want the previous behavior, write your own decoder with safe handling behavior (example)

Full Changelog: 0.3.0...0.4.0

0.3.0

16 Feb 03:56
Compare
Choose a tag to compare

What's Changed

  • Add documentation by @xxfast in #11
  • Bump org.junit.jupiter:junit-jupiter-engine from 5.8.1 to 5.9.2 by @dependabot in #14
  • Bump org.junit.jupiter:junit-jupiter-api from 5.8.1 to 5.9.2 by @dependabot in #15
  • Bump app.cash.turbine:turbine from 0.12.0 to 0.12.1 by @dependabot in #17
  • Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.8.0 to 1.8.10 by @dependabot in #18
  • Bump org.jetbrains.kotlin:kotlin-serialization from 1.8.0 to 1.8.10 by @dependabot in #16
  • Add cached delegate to get cached value synchronously by @xxfast in #13

New Contributors

Full Changelog: 0.2.0...0.3.0