Files
Meshtastic-Android/core/resources/src
James Rich 0a78a2755c feat(di,resources,model): enable wasmJs target
core:di has no expect declarations, just the target. core:resources' getString()
(blocking, runBlocking-based) can't exist on wasmJs -- split to expect/actual: a real
nonWebMain actual (android/jvm/iOS, same hierarchy-split pattern as core:ble) and a
wasmJsMain actual that fails loudly (there is no way to synchronously block on wasmJs;
callers on web must use the already-suspend getStringSuspend() instead). Renamed the
nonWebMain actual file to GetStringActuals.kt to avoid a JVM facade-class name collision
with commonMain's GetString.kt (both would otherwise generate an identical GetStringKt
class).

core:model's two expect declarations (getShortDateTime, platformRandomBytes) get wasmJs
actuals backed by Intl.DateTimeFormat and the Web Crypto API's getRandomValues() --
platformRandomBytes backs channel PSK/private-key generation, so it must be
cryptographically secure, never Math.random(). Third-party dependencies (takpacket-sdk
0.9.1, compose components-resources 1.12.0) confirmed to publish a wasmJs variant via
their real Gradle Module Metadata before enabling the target.

Verified via gradle-runner: compileKotlinWasmJs passes for all three, full regression
(android/jvm/iOS compiles, allTests, detekt, spotlessCheck) passes across every touched
module.
2026-08-30 19:43:57 -05:00
..