https://kotlinlang.org logo
#javascript
Title
# javascript
c

Császár Ákos

11/28/2023, 10:16 AM
Hi! I have a lot of model classes in my project with @JsExport and @Serializable annotations and some have custom serializers. Is there a general rule/method/trick to keep them as small as possible? Currently a class can take up 5-20KB and I want to avoid the huge bundle size.
👀 1
a

Artem Kobzar

11/28/2023, 1:44 PM
If there are some class members that you don't want to use in JS, you can annotate them with @JsExport.Ignore (for example, some of the constructors). It helps compiler to eliminate such declarations if they are not in use.
2 Views