https://kotlinlang.org logo
Title
s

Shumaf Lovpache

07/19/2022, 5:04 PM
Hi everyone! I'm planning to work on improving experience with web workers in Kotlin JS. So, it is very important for me to know the opinion of the community. Please, share your problems, wishes and thoughts regarding the following topics: • web workers generally • coroutines in Kotlin JS • concurrency in JavaScript (your experience with libraries, use cases etc.) For more information about this feature you can read design notes: https://github.com/Kotlin/KEEP/blob/master/notes/web-workers.md
👀 4
:thank-you: 4
t

turansky

07/20/2022, 1:47 PM
My use case - workers without coroutines: • Data -
ByteArray
, JSO (default browser serialization) • Worker - separate subproject, because still no entry points support • Build fixes -
runtimeOnly
dependency on worker • Plugin for development/production build (legacy/IR) For fine start classic Web Worker support (without coroutines, without compiler plugin) is preferred. Otherwise this feature will block future Kotlin/JS evolution.
s

Shumaf Lovpache

07/20/2022, 3:18 PM
Can you provide some example project that uses your plugin?
t

turansky

07/20/2022, 4:02 PM
Examples are here
s

Shumaf Lovpache

07/21/2022, 1:10 PM
@turansky have you seen this blogpost https://avwie.github.io/multithreaded-web-applications-in-kotlin-with-web-workers ? It proposes some tricks for building workers. So, as I can understand, the main problem with workers is poor tooling support?
t

turansky

07/22/2022, 11:21 AM
1. Tooling update not required if you have fine output (file to file compilation) 2. Serialization isn’t required if we will have safe JSO builders, which also support
ByteArray
(JSON serialization - not) 3. Custom coroutines sugar looks like more preferable option, in my cases it’s not required at all