Nathan Bedell
10/30/2025, 2:08 PMturansky
10/30/2025, 4:29 PMturansky
10/30/2025, 4:31 PMbut we need different actual implementations for bothHow "tumbler" looks?
Edoardo Luppi
10/30/2025, 7:36 PMthat declares two js targetsThis is currently unsupported, and only works because Kotlin devs have been nice enough to keep it explicitly for K/JS, until a separation between Node.js and browser is figured out. Did you configure the two targets like this?
Nathan Bedell
10/31/2025, 4:52 PMNathan Bedell
10/31/2025, 4:54 PMturansky
10/31/2025, 5:18 PMturansky
10/31/2025, 5:19 PMA , B , C
2. A , B should be exported in lib aaa
3. B , C should be exported in lib bbbNathan Bedell
10/31/2025, 11:23 PMkotlin {
js("foo") {
browser()
}
js("bar") {
browser()
}
}Nathan Bedell
10/31/2025, 11:25 PM// commonMain/kotlin/SomeApi.kt
expect fun something()
// fooMain/kotlin/SomeApi.foo.kt
actual fun something() = ...
// barMain/kotlin/SomeApi.bar.kt
actual fun something () ...Nathan Bedell
10/31/2025, 11:26 PMcommonMain expect API to be able to be compiled to an implementation using foo or bar, without any dynamic dispatch.Nathan Bedell
10/31/2025, 11:27 PMturansky
11/01/2025, 2:06 AMturansky
11/01/2025, 2:08 AMactual fun something () {
if (import.meta.env.FOO) {
somethingFoo()
} else {
somethingBar()
}
}
Bundler will remove redundant/dead code automaticallyNathan Bedell
11/01/2025, 4:08 AMNathan Bedell
11/01/2025, 4:20 AMturansky
11/02/2025, 11:48 AM