Sean Najera
07/08/2020, 10:25 PM// MPP - JS & common dependencies
sourceSets["commonMain"].dependencies {
implementation(kotlin("stdlib-common", Versions.KOTLIN))
implementation(Deps.Ktor.COMMON_CORE)
implementation(Deps.Ktor.COMMON_JSON)
implementation(Deps.Coroutines.COMMON)
implementation(Deps.MP_SETTINGS)
implementation(Deps.Ktor.COMMON_SERIALIZER)
implementation(Deps.Serialization.COMMON)
implementation(Deps.Stately.COMMON)
implementation(Deps.Stately.CONCURRENCY)
}
sourceSets["jsMain"].dependencies {
implementation((kotlin("stdlib-js", Versions.KOTLIN)))
implementation(Deps.Ktor.JS_CORE)
implementation(Deps.Ktor.JS_JSON)
implementation(Deps.Coroutines.JS)
implementation(Deps.Ktor.JS_SERIALIZER)
implementation(Deps.Serialization.JS)
}
My goal is to write the repository layer as a library for the three platforms which can use it to request proprietary data, similar to Firebase Realtime database.
But when I import the JS library into the Jetbrains starter React app my javascript binary is 27MiB for dev and 1MiB for prod distributions.
Should I expect ktor & coroutines JS libraries to be that heavy for a JS library? Or am I doing something wrong?Robert Jaros
07/08/2020, 10:33 PMbuild/js/packages/[project]/kotlin-dce
directory - there you will find all kotlin js files used by your project (already processed by DCE). You can compare sizes of different libs.Sean Najera
07/08/2020, 10:33 PMRobert Jaros
07/08/2020, 10:34 PMSean Najera
07/08/2020, 10:38 PMRobert Jaros
07/08/2020, 10:42 PMJurriaan Mous
07/09/2020, 6:24 AMSean Najera
07/09/2020, 3:14 PMJurriaan Mous
07/09/2020, 3:52 PMRobert Jaros
07/09/2020, 4:20 PM