Skip to content

Add Kotlin/Wasm JS support to Compose HTML EAP - #5722

Open
Clemens Koprolin (clemenskoprolin) wants to merge 2 commits into
masterfrom
clemenskoprolin/compose-html-wasm-js
Open

Clemens Koprolin (clemenskoprolin) wants to merge 2 commits into
masterfrom
clemenskoprolin/compose-html-wasm-js

Conversation

@clemenskoprolin

Copy link
Copy Markdown
Collaborator

This PR adds Kotlin/Wasm JS as a target for the Compose HTML EAP core, SVG, runtime, and shared test utilities.

Browser implementations and tests move into shared webMain and webTest source sets. Platform-specific DOM operations use implementations for JS and Wasm, including weak maps, microtask scheduling, input events, nonce access, event listeners and test utilities. Typed implementations shared by JVM and Wasm live in nonJsMain.

Typed Wasm interop exposed two existing problems. TextAreaAttrsScope used an HTMLInputElement value setter that only worked on JS because the cast erased. Controlled input restoration could happen before all event listeners ran (on WASM/JS). Text areas now use the correct setter and restoration waits until all listeners finish.

Existing browser tests run on both JS and Wasm. Cases requiring JS-only interop remain in jsTest.

Testing

Run from the html directory:

./gradlew -Pcompose.html.eap.enabled=true \
  :html-core-eap:check \
  :html-svg-eap:check \
  :internal-html-core-runtime-eap:check \
  :html-test-utils:check

Fixes CMP-10816

Release Notes

N/A

webMain used kotlinx.browser.dom.Node, but kotlinx.dom.clear() expects the JS-specific DOM Node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant