Hi folks, anyone was able to use Ktx Serialization...
# compose-web
s
Hi folks, anyone was able to use Ktx Serialization with compose-web? any workaround for this issue: https://github.com/Kotlin/kotlinx.serialization/issues/1454
👀 1
b
You could use js JSON.parse() and model your classes as external for now. That way you can live without kotlinx.serializatiom
s
I’m kind of surprised the issue with compose and kotlinx serialization still hasn’t been fixed.
m
@Big Chungus
JSON.parse()
is utterly broken in Kotlin/JS. Yes, it works, but that doesn't mean it is a nice developer experience because you have a multitude of issues with it, off the top of my head: You can't serialize Longs, you can't use any Kotlin functions (if you are trying to deserialize a List), so on and so forth. Kotlinx Serialization is a god send for the JS target so it is a bummer that it doesn't work yet. What seems to work fine (from a tip by @SrSouza) is creating a separate module with the Serialization plugin, and making the Compose project depend on that module. But then again, I haven't tested it too much yet but it seems to work for deserialization.
message has been deleted
🎉 2