Sean Najera
07/08/2020, 6:29 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)
}
// Front-End react app dependencies
implementation(kotlin("stdlib-js"))
//React, React DOM + Wrappers (chapter 3)
implementation("org.jetbrains:kotlin-react:16.13.0-pre.94-kotlin-1.3.70")
implementation("org.jetbrains:kotlin-react-dom:16.13.0-pre.94-kotlin-1.3.70")
implementation(npm("react", "16.13.1"))
implementation(npm("react-dom", "16.13.1"))
//Kotlin Styled (chapter 3)
implementation("org.jetbrains:kotlin-styled:1.0.0-pre.94-kotlin-1.3.70")
implementation(npm("styled-components"))
implementation(npm("inline-style-prefixer"))
//Video Player (chapter 7)
implementation(npm("react-player"))
//Share Buttons (chapter 7)
implementation(npm("react-share"))
// Shared Library: Nautilus
implementation(project(":MarianaKit"))
//Coroutines (chapter 8)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.7")
When I import the javascript library into the Jetbrains starter React app, the dev distribution size 27MiB and the production distribution size is 1.5 MiB. Is anyone else having such large distribution sizes? Is this normal? Or am I doing something on my end to cause this?janvladimirmostert
07/08/2020, 7:16 PMSean Najera
07/08/2020, 10:15 PMjanvladimirmostert
07/09/2020, 12:59 PMSean Najera
07/09/2020, 1:34 PMjanvladimirmostert
07/09/2020, 1:44 PMwindow.fetch
which is a replica of ES6's window.fetch whcih goes in the commonJS part of the project. You can always add a platform specific implementation for your POST / GET, then use Ktor for everything except for the JS sideSean Najera
07/10/2020, 3:21 PM