also i'm a super noob and this is all very confusi...
# compose-web
m
also i'm a super noob and this is all very confusing -- can I use code from a JVM target inside my kotlin-wasm project? I'm still not really sure where I can import from. Seems like it has to be Kotlin/JS only?
d
JVM target implies Java standard library and built to a bytecode that runs on a Java virtual machine. So yeah, probably not. Try creating code in a commonMain folder somewhere in your multiplatform project. That will show you what you can accomplish with pure, vanilla, cross-platform compatible Kotlin.
m
ok yeah I was mistakenly trying to import a dependency from an external kotlin mpp project -- but they didnt build for js or wasm, only ios/jvm
d
Yeah. That's unfortunately going to be the standard state of things for a while I imagine. Kotlin/JS is probably not a common target, relatively. (Will be interesting to see if wasm changes that)
m
If you were going to port a back end service that uses sockets/ file system and is written in multi-platform for JVM, would you try to pour it to WASM or JS?
And secondly, is there an easy way to write Kotlin and get it to run in a browser service worker?
d
I'm not too sure about that, sorry. I have seen Kotlin/JS bindings for web workers but I never tried creating one.
There is a #webassembly channel that might have more information
m
thanks!
👍 1