Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplatform Support #1

Open
mysticfall opened this issue Nov 16, 2021 · 2 comments
Open

Multiplatform Support #1

mysticfall opened this issue Nov 16, 2021 · 2 comments

Comments

@mysticfall
Copy link

I've recently started a Kotlin/JS project which relies on Arrows and found that there's no serialisers available for the type classes it provides that works on JS platform.

It'd be nice if this library could be also published for other platforms than JVM. KotlinX serialization itself works great on JS, so I suspect it could be done without too much difficulty.

Thanks!

@thake
Copy link
Member

thake commented Nov 16, 2021

@mysticfall thanks for posting this feature request.

Sadly this is not as trivial as it seems. Avro4k relies on the Avro java library for serialization purposes. So you can see it as a compatibility layer between avro and kotlinx.serialization. To support javascript as another platform, one would need to write a separate javascript integration layer with an unofficial avro javascript library as a replacement for the java avro library. I think the main obstacle will be to replace the Avro classes used in the API of avro4k with platform unspecific types.

If you want to give it a try, go ahead :) The library https://github.com/mtth/avsc looks promising.

@mysticfall
Copy link
Author

Ah, I didn't realise that the library has a Java dependency. My data classes only uses Option<T> so I only checked OptionSerializer before I created the issue.

I think I'll take just the relevant serialiser class from your project for now (with proper credits, of course). Thanks for the explanation, and also for the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants