Hey! is there an alternative deserialization libra...
# javascript
w
Hey! is there an alternative deserialization library with less size than kotlinx for js? I would go for a super simple JSON.parse in an expect/actual function, but I need to remap some field names because in the json they have a $ inside.. Some ideas before going string.replace("$", "__") before deserializing? :)
a
even the replace method is really not future proof. At the moment its best to stick with kotlinx serialization Json.parse will work well if you are using external declarations, but if you are writting MPP code, exepect actual won't really help much
w
why wouldn’t it be future proof? If the json field names change, the code must be changed anyway, replace or not, am I missing something?
I’m working on a very old tv box and reducing 500kb of the bundle size could help a lot.. I’m just not sure about the “additional” cpu work for the replace
I found this method: https://github.com/ScottPierce/kx-serialization-js-benchmark and my app start time dropped from 18 seconds to 3