spierce7
07/29/2020, 4:12 AMturansky
07/29/2020, 6:40 AMpolbaladas
07/29/2020, 4:35 PMdarkmoon_uk
08/04/2020, 11:55 AMkotlinx.html
DSL e.g.
val document = document.create.html {
lang = "en"
head {
meta {
charset = "UTF-8"
...
...what is the right way to commit this to display in entirety - is it via document.rootElement
?darkmoon_uk
08/04/2020, 11:56 AMdocumentElement
?darkmoon_uk
08/04/2020, 12:23 PMdocument.replaceChild(newDocument,document.documentElement!!)
stephanmg
08/04/2020, 3:36 PMandylamax
08/05/2020, 9:19 PMtheme-core
which at the moment, targets js
jvm
and android
.
I also have a pure js library theme-react
which depends on theme core
.
theme-react
being a purely js
lib. It has it's sources located at src/main/kotlin
while theme-core
sources for targeting js are at src/jsMain/kotlin
I am trying to use theme-react
and ultimately theme-core
as a dependency to a pure js react ui library called enteprise-react
. as always sources are located at src/main/kotlin
Idea is able to resolve theme-react
sources but can't resolve theme-core
sources. After being bugged by this for a while, I tried changing my build.gradle.kts
like so
sourceSets {
val jsMain by creating {
dependencies {
api(project(":theme-core"))
api(project(":theme-react"))
}
}
val main by getting {
dependsOn(jsMain)
dependencies {
api(kotlin("stdlib-js"))
api("org.jetbrains.kotlinx:kotlinx-react:${versions.kotlinjs.react}")
api("org.jetbrains:kotlin-styled:${versions.kotlinjs.styled}")
api("org.jetbrains:kotlin-css-js:${versions.kotlinjs.css}")
}
}
}
so now enterprise-react
has two sourceSets. jsMain
and main
.
If I put my sources in jsMain
all pure js libraries (including kotlin-react
and kotlin-styled
) aren't resolved by IDEA. If I put my sources in main
IDEA failes to resolve all dependencies build from the sources of the subprojects at jsMain
(i.e. theme-core
) and all other mpp supprojects.
I tried seperating my sources, no luck. as there is a moment I need resources from both theme-core
and kotlin-react
.
Has anyone experienced this issue at all? any workaround suggestions please . . . Thank you in advancedarkmoon_uk
08/09/2020, 9:03 AMGunslingor
08/11/2020, 4:21 PMEileen
08/17/2020, 10:54 AMJustin
08/17/2020, 7:12 PM@JsExport
annotation, but it fails if I have defined a companion object
inside of a class with error:
e: java.lang.IllegalStateException: Class SomeClass.Companion with kind: OBJECT
Is there any workaround for this? Or is there a way to mark companion objects as @JsIgnore
(or something like that)?audriusk
08/19/2020, 7:07 AM@JsExport
I need equivalent to this JS code snippet (addMessage
variable exported with precise type returned by onRequest
builder:
exports.addMessage = functions.https.onRequest((req, res) => { <...> })
Previously I was using this KotlinJs code:
external val exports: dynamic
external val https <...>
fun main() {
exports.addMessage = https.onRequest { req, res -> <...> }
}
-----
But with new JS Ir (and mandatory @JsExport
) I am failing to to achieve same behavior. Some intermediate code gets generated
KotlinJS:
@JsExport
val addMessage = https.onRequest { req, resp -> <...> }
JavaScript output:
var addMessage;
function addMessage$init$() {
var tmp = https;
return tmp.onRequest(_no_name_provided_$factory_30());
}
addMessage = addMessage$init$();
Robert Jaros
08/19/2020, 1:04 PMJoost Klitsie
08/19/2020, 3:26 PMGunslingor
08/19/2020, 5:44 PMGunslingor
08/19/2020, 8:16 PMbackgroundImage = Image("web/img/bg-gr-v.png")
Jorrit
08/22/2020, 8:42 AMsamgarasx
08/23/2020, 8:39 PMNico
08/24/2020, 12:31 PM@JsExport
on a data class (say, A
), and I am using that lib from a Kotlin/JS project where I would like to use that from JS.
But when using that type A
in my K/JS project, I get an error: Exported declaration uses non-exportable property type: A
But I know A
to be exportable since I can export it fine in the lib. Is this intended? Shouldn't something exportable in a project also be exportable in all of this project's dependants?
Any tips appreciated, thanks!Vinicius Carvalho
08/26/2020, 10:03 PMVinicius Carvalho
08/26/2020, 10:03 PM<script src="<https://unpkg.com/kotlin-playground@1>" data-selector=".kotlin-code"></script>
Vinicius Carvalho
08/26/2020, 10:04 PMSource map error: Error: request failed with status 404
Resource URL: <https://unpkg.com/kotlin-playground@1>
Source Map URL: playground.min.js.map
[JB] Shagen
08/28/2020, 12:28 PMGunslingor
08/29/2020, 9:25 PMgvnavin
08/30/2020, 4:00 AMJorrit
09/01/2020, 10:20 AMbill1550
09/02/2020, 5:27 PMCould not determine the dependencies of task ':jsApp:packageJson'.
> NPM Dependencies already resolved and installed
bill1550
09/02/2020, 5:29 PM