Hii I'm new to compose-web. Can someone tell me mo...
# compose-web
v
Hii I'm new to compose-web. Can someone tell me more about webMain ? From what I know it contains the code which is common in both JS and WASM. But I found there are some api which are available in both JS/Wasm but aren't available in webmain like I can't call await() on Promises and also there is no WebElemenView(). Am I missing something, Is it related to interoperability between Js and Wasm ?
r
It is like that. There is no magic in
webMain
. It doesn't automatically merge APIs available on both targets. It only gives you what is defined in common JS/WasmJS code in the libraries (including stdlib). kotlin-wrappers can help you with
await()
. Don't know about
WebElementView
.
m
WebElementView has been made available in webMain in 1.11.0-alpha01. See: https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.11.0-alpha01
w
await
is still not available pending https://github.com/kotlin/kotlinx.coroutines/issues/4544 as far as I know, but it's pretty simple to commonize a method for use in app code.