Skip to content

Improving serialization layer for JS applications #730

Answered by konsoletyper
Ihromant asked this question in Q&A
Discussion options

You must be logged in to vote

As for pt.1, I don't fully understand the issue here. Consider you want to configure whether enums are written by index or by name. Then you declare abstraction like EnumSerializer interface, provide implementations for name- and index-based approaches and declare enumSerializer field in Converters. Then, rewrite your serializer generating code to take this field upon constructions of a serializer of class, containing enum. Sure, this would make generated JS grow. If you want avoid latter, then you can configure at compile-time. You can use any kind of configuration you want, for example, based on ServiceLoader, or read TeaVM properties from plugin.

BTW, in my proprietary JSON serializer/…

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@Ihromant
Comment options

@konsoletyper
Comment options

@Ihromant
Comment options

@konsoletyper
Comment options

Comment options

You must be logged in to vote
2 replies
@Ihromant
Comment options

@konsoletyper
Comment options

Answer selected by Ihromant
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Ihromant
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants