https://kotlinlang.org logo
#compose-web
Title
# compose-web
j

John O'Reilly

05/04/2021, 3:26 PM
All the Compose Web samples seem to use
multiplatform
plugin......is that necessary or can you just have module containing compose web code with dependency then on a separate multiplatform module?
j

Javier

05/04/2021, 3:37 PM
Maybe it is using that instead of
kotlin("js")
for the same reason that desktop samples are using multiplatform instead of
kotlin("jvm")
, because it doesnt work correctly and need to be fixed?
(well, I think it should be fixed already 🤔 )
j

John O'Reilly

05/04/2021, 3:38 PM
fwiw the compose desktop project I have seems to be ok with
kotlin("jvm")
....had tried
kotlin("js")
but running in to some issues
it is closed so it should work
j

John O'Reilly

05/04/2021, 3:40 PM
seems to be working ok (with compose desktop using jvm plugin that is)
k, getting a bit further using
kotlin("js")
...at least one change needed was that
js
in the multiplatform module needed to be updated to
js(IR)
hmm, but doing that causes other issues when trying to resolve dependencies in the common module
o

Oleksandr Karpovich [JB]

05/04/2021, 4:58 PM
Hi John! Currently, the compose gradle plugin with web support enables the compiler plugin for js(ir) targets only when the multiplatform plugin applied (https://github.com/JetBrains/compose-jb/blob/master/gradle-plugins/compose/src/mai[…]lin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt). As I remember, it was an intentional decision. But I can't recall an exact reason for now. I'll double check with my colleagues.
j

John O'Reilly

05/04/2021, 4:59 PM
Thanks @Oleksandr Karpovich [JB]. I'd actually gone back to using multiplatform plugin but running in to issues I think because not all dependencies I have support IR compiler
(am depending on another multiplatform module I have)
o

Oleksandr Karpovich [JB]

05/04/2021, 5:04 PM
I see. you're right, the JS dependencies need to have IR variant in order to use them with compose-web. does that multiplatform module reside in your project? (I mean is it possible to try out the js(IR) with that module?)
j

John O'Reilly

05/04/2021, 5:05 PM
yes, it's multiplatform module in same project....I'm trying
js(IR)
there but running in to issues with a few of the libraries that I don't think support IR yet
resolved one of those by updating to later version that's supporting IR but still have 2 more that don't yet
👍 2
I created local builds of those 2 libraries with IR enabled and it's running now
🔥 2
4 Views