SOFe
02/24/2019, 8:12 AMjw
02/25/2019, 8:28 PMGarouDan
02/26/2019, 1:24 AMcompileKotlin2Js
and compileTestKotlin2Js
. But since I’m not using the id("kotlin2js")
plugin but kotlin("multiplatform")
I’m receiving an error saying that the tasks don’t exist. Does someone knows how to properly configure these tasks when applying the kotlin("multiplatform")
plugin?josephivie
02/26/2019, 3:53 AMA problem was found with the configuration of task ':koolui-test-js:webpack-bundle'.
> File '/.../koolui-test-js/build/classes/kotlin/main/koolui-test-js.js' specified for property 'sourceFile' does not exist.
The file most certainly exists, I've checked it and read it. It's complete.
Any ideas?jw
02/27/2019, 1:39 PMgetUrl
), functions which take async callbacks (getBackgroundPage
), and functions which perform actions (reload()
). But then it has this getManifest()
function which takes no arguments, isn't async with a callback, and isn't performing some kind of action. Were I encapsulating this in a class, I would do val manifest: Json get() = delegate.getManifest()
to expose it as a property. This is an external interface though so I'm forced into fun getManifest()
GarouDan
02/27/2019, 2:00 PMUncaught Error: Error loading module 'common'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'common'.
I could see that in my main.bundle.js
generated file, indeed the "./common.js"
is being required earlier than the "./kotlin.js"
module. I tried to change the dependencies order in my build.gradle.kts
file but it didn’t solve the problem.
Does someone knows how can we fix this?jw
02/27/2019, 2:02 PMJoakimForslund
02/27/2019, 2:28 PMtask assembleWeb(type: Sync) {
println(configurations)
configurations.commonMainCompileOnly.each { File file ->
from(zipTree(file.absolutePath), {
includeEmptyDirs = false
include { fileTreeElement ->
def path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") ||
!path.startsWith("META-INF/"))
}
})
}
from compileKotlin2Js.destinationDir
into "${projectDir}/web"
dependsOn classes
}
assemble.dependsOn assembleWeb
on a multiplatform project. Since im not using kotlin2js
but the multiplatform plugin i'm receiving:
Could not get unknown property 'compileKotlin2Js' for task ':assembleWeb' of type org.gradle.api.tasks.Sync.
Anyone has any idea how to solve it?Robert Jaros
03/01/2019, 12:08 PMJoakimForslund
03/01/2019, 12:40 PMstate
in this code would show as state_v23xwe$_0
in javascript?
@Serializable
data class StateAware(@JsName("id") val id: String = hashCode().toString(), @JsName("test")val test: String = "Tested") {
@JsName("state")
var state: Int = Initilized
set(value) {
println("Item with id:$id -> Old State: '${this.state}' | New State: '$value' has been set")
field = value
stateAwareContainer.sync(this)
}
}
galex
03/01/2019, 6:47 PMthana
03/04/2019, 7:31 AMimplementation project(":otherModule")
into the destination folder. and i have noo clue how to get the dependencies transitivley...Svyatoslav Kuzmich [JB]
03/04/2019, 2:21 PMfun js(code: String): dynamic
function.
[https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/js.html#js]
It allows you to embed JavaScript code to Kotlin. Its one of those features which is super simple to use in most cases but becomes quite complex when specifying what it does in general. It has some problems.
It implicitly links Kotlin declarations with names used inside JavaScript snippet, and can become an effective tool to shoot yourself in a foot. For most interop needs safer constructs like external declarations and dynamic expressions can be used instead.
It is also a tough feature to maintain: it requires a whole JavaScript parser to be included and parser result integrated with compiler data structures. Switching parsers can be hard. Supporting multiple ES versions only adds to complexity.
We are considering various options to redesign it in future releases to make it “less powerful”. We would like to hear your input to make sure we got you covered with a smooth transition:
Do you use js
function a lot? What for?
Are they big? What constructs do you put inside?d.bellingroth
03/05/2019, 7:40 AMJoakimForslund
03/06/2019, 1:20 PMaltavir
03/06/2019, 2:52 PMAlexander Weickmann
03/07/2019, 5:02 PMaltavir
03/08/2019, 7:19 AMJoakimForslund
03/08/2019, 10:04 AMAlexander Weickmann
03/08/2019, 3:18 PMpardom
03/08/2019, 7:44 PMGarouDan
03/09/2019, 12:45 AMid("org.jetbrains.kotlin.frontend")
plugin to configure my kotlin-react
application with webpack.
But I’ve seen if my module has also the name react
the system incurs in problems.
Does someone knows an workaround for this? Without changing the module name?Robert Jaros
03/09/2019, 1:41 AMkotlin-frontend-plugin
0.0.45 and kotlin
1.3.21 when stopping background karma task?
> Task :karma-stop FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':karma-stop'.
> kotlin.io.ByteStreamsKt.readBytes(Ljava/io/InputStream;)[B
It works correct when ./gradlew stop
command is run for the second time but fails almost always for the first time.altavir
03/09/2019, 8:26 AMmin.js
module. For JS people recommend to do it like that: https://stackoverflow.com/questions/46362627/use-convexgeometry-in-npm-version-of-three. Is it possible to do it in kotlin-js?Jared
03/11/2019, 6:35 PMRobert Jaros
03/11/2019, 7:06 PMylemoigne
03/12/2019, 2:57 PMwindow.customElements.define('app-drawer', class extends HTMLElement {})
in kolin. I've tried window.customElements.define("app-drawer", { js("class extends HTMLElement {}")})
, but it seems that the compiler try to analyse the js("...")
content and don't understand the declaration.gumil
03/13/2019, 9:36 AMthana
03/13/2019, 9:47 AMRobert Jaros
03/13/2019, 11:36 AM