KMPParcelize

Enables parcelable support across multiple platforms, facilitating seamless data serialization and deserialization. Offers custom annotation processing and supports complex data structures for efficient data transfer.

Android JVMJVMKotlin/NativeWasm
GitHub stars0
AuthorsMFlisar
Open issues0
LicenseApache License 2.0
Creation date12 months ago

Last activity4 months ago
Latest release1.0.1 (8 months ago)

Maven Central API Kotlin Kotlin Multiplatform

KMPParcelize

Platforms Android iOS Windows macOS WebAssembly

This library provides parcelize annotations that can be used inside commonMain source sets.

Following is provided inside the com.michaelflisar.parcelize package:

package com.michaelflisar.parcelize

expect interface Parcelable

@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
expect annotation class Parcelize()

@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.SOURCE)
expect annotation class IgnoredOnParcel()

@Target(AnnotationTarget.TYPE)
@Retention(AnnotationRetention.BINARY)
expect annotation class RawValue

The actual implementations for android looks as following:

package com.michaelflisar.parcelize

actual typealias Parcelable = android.os.Parcelable
actual typealias Parcelize = kotlinx.parcelize.Parcelize
actual typealias IgnoredOnParcel = kotlinx.parcelize.IgnoredOnParcel
actual typealias RawValue = kotlinx.parcelize.RawValue

Table of Contents

💻 Supported Platforms

Module android iOS windows macOS wasm
library ✅ ✅ ✅ ✅ ✅

🔧 Setup

Using Version Catalogs

Define the dependencies inside your libs.versions.toml file.

[versions]

kmpparcelize = "<LATEST-VERSION>"

[libraries]

library = { module = "io.github.mflisar.kmpparcelize:library", version.ref = "kmpparcelize" }

And then use the definitions in your projects build.gradle.kts file like following:

implementation(libs.library)
Direct Dependency Notation

Simply add the dependencies inside your build.gradle.kts file.

val kmpparcelize = "<LATEST-VERSION>"

implementation("io.github.mflisar.kmpparcelize:library:${kmpparcelize}")

🚀 Usage

Simple use the provided annotations instead of the one from androidx and you are done.

📚 API

Check out the API documentation.

💡 Other Libraries

You can find more libraries (all multiplatform) of mine that all do work together nicely here.

Android JVMJVMKotlin/NativeWasm
GitHub stars0
AuthorsMFlisar
Open issues0
LicenseApache License 2.0
Creation date12 months ago

Last activity4 months ago
Latest release1.0.1 (8 months ago)

Maven Central API Kotlin Kotlin Multiplatform

KMPParcelize

Platforms Android iOS Windows macOS WebAssembly

This library provides parcelize annotations that can be used inside commonMain source sets.

Following is provided inside the com.michaelflisar.parcelize package:

package com.michaelflisar.parcelize

expect interface Parcelable

@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
expect annotation class Parcelize()

@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.SOURCE)
expect annotation class IgnoredOnParcel()

@Target(AnnotationTarget.TYPE)
@Retention(AnnotationRetention.BINARY)
expect annotation class RawValue

The actual implementations for android looks as following:

package com.michaelflisar.parcelize

actual typealias Parcelable = android.os.Parcelable
actual typealias Parcelize = kotlinx.parcelize.Parcelize
actual typealias IgnoredOnParcel = kotlinx.parcelize.IgnoredOnParcel
actual typealias RawValue = kotlinx.parcelize.RawValue

Table of Contents

💻 Supported Platforms

Module android iOS windows macOS wasm
library ✅ ✅ ✅ ✅ ✅

🔧 Setup

Using Version Catalogs

Define the dependencies inside your libs.versions.toml file.

[versions]

kmpparcelize = "<LATEST-VERSION>"

[libraries]

library = { module = "io.github.mflisar.kmpparcelize:library", version.ref = "kmpparcelize" }

And then use the definitions in your projects build.gradle.kts file like following:

implementation(libs.library)
Direct Dependency Notation

Simply add the dependencies inside your build.gradle.kts file.

val kmpparcelize = "<LATEST-VERSION>"

implementation("io.github.mflisar.kmpparcelize:library:${kmpparcelize}")

🚀 Usage

Simple use the provided annotations instead of the one from androidx and you are done.

📚 API

Check out the API documentation.

💡 Other Libraries

You can find more libraries (all multiplatform) of mine that all do work together nicely here.