Bruno Medeiros
08/06/2021, 4:34 PM$serializer
synthetic property that is created for each class/companion. If I remove all my @Serializable
, my module reduce its size by 80%. JVM an iOS are fine, but I can't pay that price in JS.
Question is:
Is there a way to disable kotlinx-serialization $serializer
generation just in the JS backend? If I could disable it just in JS, I could still use the kotlinx-serialization
serializer for all backends and I'd roll my own for JS, but I would still be able to use my data classes in JS.turansky
08/06/2021, 6:18 PMactual @Serializable
for exampleturansky
08/06/2021, 6:20 PMturansky
08/06/2021, 6:22 PMBruno Medeiros
08/07/2021, 12:47 AMcommonMain
, it'd very painful to transform all of them in actual/expect, and that also goes against code reuse, which is the main selling point of this whole thing.Bruno Medeiros
08/07/2021, 12:48 AMIn IR possibly you can use custom compiler plugin to disable serialization for JS 🙂this seems interesting! any hints on good material about a custom compiler plugin. @turansky?
turansky
08/07/2021, 12:55 AM@Serializable
annotation only (1 annotation class)Bruno Medeiros
08/07/2021, 12:57 AMturansky
08/07/2021, 1:02 AMturansky
08/07/2021, 1:03 AM.serializer()
in JS without additional IDEA pluginBruno Medeiros
08/14/2021, 5:36 AM@SerialName
also have to be aliased in case you need them. Other than that, almost perfect solution!turansky
08/14/2021, 6:41 AMBruno Medeiros
08/14/2021, 7:10 AMturansky
08/15/2021, 1:36 AMBruno Medeiros
08/15/2021, 1:37 AMturansky
08/15/2021, 1:37 AMlazy property
compiler flag?Bruno Medeiros
08/15/2021, 1:37 AMBruno Medeiros
08/15/2021, 1:39 AMturansky
08/15/2021, 1:41 AMBruno Medeiros
08/15/2021, 1:42 AMturansky
08/15/2021, 6:19 PMBruno Medeiros
08/16/2021, 2:21 PMturansky
08/27/2021, 2:37 AM