Hi, I'm going to build a webpage, but I do not wan...
# webassembly
a
Hi, I'm going to build a webpage, but I do not want to play with JS/TS. I've found WebAssembly and its usage with KMP and I've read a lot about it. But I want to ask You, now. Is it really wise to build a website in WebAssembly? What about SEO? What about support from e.g. Google Analytics? In general: what are the disadvantages of building a regular website on KMP Web?
c
My 2 cents: 1. you should only do the business logic in wasm but not the whole website. 2. If your questions aims to ask about frameworks like Compose Multiplatform - I’d not build a regular website with it. It meant to be used for “Web Application” where SEO is done on a higher level of the website itself. 3. KMP wasmJs needs GC which is not supported yet in all major browers. https://kotlinlang.org/docs/wasm-troubleshooting.html#browser-versions
thank you color 2
2
m
But we seem to be very close to GC support on all major browsers. See: https://kotlinlang.slack.com/archives/CDFP59223/p1723066534096449 Otherwise I agree with you that Compose is more for Web Apps.
j
Later this year is a good moment to start experimenting with wasm websites. Probably towards end of next year there will be when this goes a bit more mainstream. Safari support for GC needs to land first. After that there's going to be a bit of lag with long term support browsers and a few other things. But most of that should catch up eventually. Then there are some remaining issues with optimizing calls to browser APIs and things like the DOM that currently go via javascript. Not the end of the world but it's not free currently to do things like DOM manipulation. Other blockers are things like ktor-client which still lacks wasm support and a few other multiplatform libraries that need to be upgraded to support wasm. Once all that happens, the only reason to be using Javascript would be because you like it; which I'm assuming most of us here don't. I'm using kotlin-js currently. I'm mainly looking forward to faster compilation and no more need uglification (which is actually slower than the kotlin-js compiler and somehow seems hard to turn off with webpack).
i
like ktor-client which still lacks wasm support
Well, ktor 3.0.0-beta-2 has wasmJs support already.
few other multiplatform libraries that need to be upgraded to support wasm.
Could you please mention which ones exactly?
1. you should only do the business logic in wasm but not the whole website.
Why not?
c
because of SEO. If you build the website by manipulating the DOM and only have a “basic”
index.html
, its not easy to do SEO. so better to build “WebApps” with wasm but not old school websites.
thank you color 1
j
@igor, good to hear but a lot of stuff still use v2 of ktor-client.
a
considering the browser global market share and share by version it seems that the biggest problem is the Safari with the quite high usage and just fresh support delivered
m
Could you please mention which ones exactly?
@Igor Yakovlev I am a little unsure about the status of SQLDelight at the moment. I also don’t know, e.g., how to do PDF rendering, PDF creation/manipulation in a KMP/WASM compatible way.
thank you color 1
r
You can have both SEO and Wasm at the same time. Check https://github.com/rjaros/kilua or https://kilua.dev (disclaimer: I'm the author of the framework).
👍 1
n
#doodle also supports WASM, while rendering entirely to the DOM, so more SEO and a11y friendly. https://nacular.github.io/doodle/docs/introduction https://github.com/nacular/doodle