Codables – Swift-inspired, declarative JSON serialization
1–8 of 8 posts
Re: Codables – Swift-inspired, declarative JSON serialization
#2Yes. And SuperJSON is great; I use it a lot. However, things got tricky for me when I had really complex data types, covered with many model classes, often deeply nested and referencing each other, where I needed to serialize it all from/to JSON and save it on the disk. I had to essentially maintain two formats of my data - "serializable data" and TypeScript classes matching this data. It was quite a pain.
I've tried to solve it with modern decorators, making the entire process more declarative and having way less boilerplate.
Happy to hear your feedback!
Interactive playground - https://codableslib.com/playground Github: https://github.com/pie6k/codables
Re: Codables – Swift-inspired, declarative JSON serialization
#3Re: Codables – Swift-inspired, declarative JSON serialization
#4Re: Codables – Swift-inspired, declarative JSON serialization
#5"for typescript" in the title would have been a good idea
Re: Codables – Swift-inspired, declarative JSON serialization
#6"for typescript" in the title would have been a good idea
Also - what's so "Swift-inspired"? There's not a single mention of Swift in README.
Re: Codables – Swift-inspired, declarative JSON serialization
#7Re: Codables – Swift-inspired, declarative JSON serialization
#8Earlier quoted context omitted.
Also - what's so "Swift-inspired"? There's not a single mention of Swift in README.
It’s based on Swift’s codable protocol: https://developer.apple.com/documentation/swift/codable