Hristijan
03/21/2025, 7:42 AMzt
03/21/2025, 4:33 PMDavid Breneisen
03/22/2025, 12:50 PMpackage org.eski.ui.util
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Density
import kotlinx.coroutines.flow.MutableStateFlow
val screenDensity = MutableStateFlow<Density>(Density(1f))
@Composable fun DensityObserver() {
with(LocalDensity.current) {
screenDensity.value = this
}
}
Just add the DensityObserver to the root composableGhasem Shirdel
03/22/2025, 11:34 PMWinson Chiu
03/24/2025, 4:51 AMbindToNavigation
, what's the right way to navigate back in common code? Neither popBackStack
nor navigateUp
replicate browser back for me. Normal navigation does something like:
A -> B -> C -> browser back -> B -> browser back -> A
Whereas the nav methods go:
A -> B -> C -> popBackState/navigateUp -> B -> browser back -> C -> browser back -> Bandylamax
03/24/2025, 12:56 PMGhasem Shirdel
03/24/2025, 7:31 PMMoe
03/26/2025, 1:35 AMCompositionLocal
and Compose idioms.
🔧 What it does:
• Lets you use t("key")
anywhere in your composables
• Switch languages at runtime with LocalizationProvider
• Designed specifically for Compose Web (WASM)
• Minimal setup, no magic, no boilerplate
Available on Maven Central
Github: https://github.com/MohammadNasrallahBlank/kmp-localize
It’s already powering my own WASM apps — feel free to try it out, break it, and share any feedback!
Would love to hear if it helps or if you spot ways it can improve ✌️William
03/26/2025, 3:45 PMCould not resolve org.jetbrains.compose.ui:ui-tooling-preview:1.8.0-alpha03. ... No matching variant
when trying to run the wasm app..
No idea how to bypass this without commenting out compose.preview
and compose.uiTooling
..
which will then cause compose preview to stop working..Alex Styl
03/29/2025, 6:10 AMError code: 5
on Chrome when i run wasmBrowserProductionRun
works ok on Firefox and even Safari but Chrome is crashing without any stacktrace.
Normal wasmBrowserRun
works fine.
Any idea how to debug this?Fudge
03/31/2025, 9:41 AMAlex Styl
04/03/2025, 2:07 AM// Serve sources to debug inside browser
in the kmp wizard.
Is the devServer only available in deb builds? Is it safe to assume that webBrowserDistribution
doesnt include it?
@OptIn(ExperimentalWasmDsl::class)
wasmJs("web") {
moduleName = "composeApp"
browser {
val rootDirPath = project.rootDir.path
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(rootDirPath)
add(projectDirPath)
}
}
}
}
binaries.executable()
}
Dimkinware
04/05/2025, 4:15 PMwasmJsBrowserDevelopmentRun
task, everything works fine — the canvas takes up the full size of the browser window.
However, when I serve the same compiled WASM code (using the wasmJsBrowserDistribution
task) with my own Ktor server, the canvas height is only 308px.
I can't understand where the difference is coming from.
Any ideas? Thanks in advance
ComposeViewport(document.body!!) {
App()
}
Armond Avanes
04/12/2025, 12:41 AMbulebird Mega
04/13/2025, 12:39 PMwindow.devicePixelRatio
and applying it to the text to trigger recomposition, the text updates correctly but remains equally blurry.
I find this behavior unacceptable for practical use.Jak Fayz
04/16/2025, 1:35 PMSouvik
04/17/2025, 7:03 AMDavid
04/20/2025, 5:06 AMPeter
04/21/2025, 4:16 PMwasmJsBrowserDevelopmentRun -t
? I see the page blink, so I guess it reloads, but changes are not applied for some reason.Slackbot
04/22/2025, 11:37 PMPHondogo
04/25/2025, 12:54 PMNicolas Frenay
04/30/2025, 1:38 PM@JSModule
and @JSNonModule
on the css file to load it from Kotlin code, but JSNonModule is not available on WASM target.
Right now my workaround is loading the CSS manually on HTML from a CDN, but I'd rather have everything packed. I already enabled CSS on build.gradle.
Thanks!Paul N
05/02/2025, 12:30 PMphteven
05/06/2025, 12:49 PM@Preview
feature with compose-html?Paul N
05/07/2025, 12:18 PMPaul N
05/08/2025, 9:34 AMMario Andhika
05/09/2025, 2:52 AMbod
05/09/2025, 6:24 AMRok Oblak
05/10/2025, 9:26 AMIsaac Udy
05/11/2025, 12:53 AMrememberTransition
in Compose Web/WASM? I'm seeing the remember(transitionState)
inside remember transition being called multiple times for the same transitionState (same hash code), which is causing my animations to fail.