Sam Garfinkel
09/12/2019, 1:53 PM@JsName
and @JsModule
annotations or is that currently not a supported feature?ribesg
09/13/2019, 8:31 AMhikamaeng
09/13/2019, 10:19 AMSam Garfinkel
09/13/2019, 1:58 PMTrevor
09/14/2019, 5:31 AMcreate-kotlin-react-app
which updates kotlin-react
to it's most recent version I believe. This makes it so you can use hooks out of the box!
https://github.com/JetBrains/create-react-kotlin-app/pull/294trevortrevor
09/16/2019, 1:45 PMgaetan
09/16/2019, 5:32 PMval image = js("""document.querySelector("iframe").contentDocument.querySelector("canvas").toDataURL()""")
console.log(image)
but this one fails with a ClassCastException:
val image = ((document.querySelector("iframe") as HTMLIFrameElement)
.contentDocument?.querySelector("canvas") as HTMLCanvasElement).toDataURL()
console.log(image)
?Philipp Smorygo [JB]
09/17/2019, 11:33 AMplugins {
id("org.jetbrains.kotlin.multiplatform")
id("org.jetbrains.kotlin.plugin.serialization")
}
repositories {
mavenCentral()
maven("<https://kotlin.bintray.com/kotlinx>")
}
kotlin {
jvm()
js()
@Suppress("UNUSED_VARIABLE")
sourceSets {
commonMain {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:${Versions.kotlin_serialization_version}")
}
}
val jvmMain by getting {
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:${Versions.kotlin_serialization_version}")
}
}
val jsMain by getting {
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:${Versions.kotlin_serialization_version}")
}
}
}
}
import org.jetbrains.kotlin.gradle.dsl.Coroutines
plugins {
kotlin("js")
id("org.jetbrains.kotlin.plugin.serialization")
}
repositories {
mavenCentral()
}
kotlin {
experimental {
coroutines = Coroutines.ENABLE
}
target {
browser {
runTask {}
}
}
sourceSets {
main {
dependencies {
implementation(kotlin("stdlib-js"))
implementation(project(":common"))
}
}
}
}
However gradle reports that "...Caused by: java.lang.IllegalStateException: project ':common' is not configured for JS usage"
What am I missing?Soren Valle
09/18/2019, 11:46 AM@JsName("prop")
?
abstract class SomeClass {
@JsName("someProp")
abstract var someProp: String
}
class SomeClassImpl : SomeClass() {
override var someProp: String = "prop"
}
fun main() {
console.log(SomeClassImpl()) // still mangled - Object { "someProp_366n21$_0": "prop" }
}
Evan R.
09/18/2019, 12:27 PMhallvard
09/19/2019, 8:43 AMconsole.log
, console.dir
, console.warn
, and <http://console.info|console.info>
. Is there a reason there is no console.debug
?gildor
09/22/2019, 4:47 AMRicky
09/22/2019, 5:20 PM* What went wrong:
Could not determine the dependencies of task ':packageJson'.
> Could not resolve all dependencies for configuration ':npm'.
> Could not find org.jetbrains.kotlin:kotlin-test-js-runner:1.3.60-dev-2370.
where exactly do I set the version for kotlin-test-js-runner
?Vytautas Jakutis
09/23/2019, 8:37 AMhallvard
09/23/2019, 12:03 PMreturnValue: "kotlin.Unit"
(where my Firefox/Ubuntu has returnValue: ""
). Is this something known? Is there a workaround?Big Chungus
09/23/2019, 2:43 PMcaffeine
09/24/2019, 12:45 AMBahaa Kallas
09/24/2019, 3:11 PMribesg
09/25/2019, 10:38 AMtapchicoma
09/27/2019, 11:13 AMJustin
09/27/2019, 3:28 PMaltavir
09/28/2019, 2:56 PMJustin
09/30/2019, 6:44 PMVytautas Jakutis
10/01/2019, 8:37 AMnpm i dukat && npx dukat -d kt node_modules/dukat/d.ts.libs/lib.es5.d.ts
Which succeeded, but when trying to compile the kotlin file to javascript, I got:
$ kotlinc-js -output out.js kt/lib.es5.module_dukat.kt
kt/lib.es5.module_dukat.kt:126:15: error: parameter name expected
fun apply(this: Function<*>, thisArg: Any, argArray: Any? = definedExternally /* null */): Any
^
hallvard
10/01/2019, 8:49 AMwrapper.js:6: ERROR - [JSC_UNDEFINED_VARIABLE] variable module is undeclared
. Is there an easy fix for this that I missed?ribesg
10/03/2019, 9:25 AMJuanoterocas
10/03/2019, 7:50 PMBig Chungus
10/03/2019, 8:00 PMribesg
10/06/2019, 12:09 PMBig Chungus
10/08/2019, 12:27 PM