Skip to content

Share the GL JS platform on webMain for Kotlin/JS and Kotlin/Wasm - #1081

Draft
sargunv wants to merge 8 commits into
codex/integrate-compose-webgl-render-targetfrom
cursor/webmain-gljs-wasm-db57
Draft

Share the GL JS platform on webMain for Kotlin/JS and Kotlin/Wasm#1081
sargunv wants to merge 8 commits into
codex/integrate-compose-webgl-render-targetfrom
cursor/webmain-gljs-wasm-db57

Conversation

@sargunv

@sargunv sargunv commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Moves the MapLibre GL JS platform to webMain, publishes the browser libraries for Kotlin/Wasm, and provides a Wasm demo. Stacked on #1114 for Compose's WebGLRenderTarget integration.

The shared bindings preserve main's resource loading, interaction, logging, and style APIs. JavaScript boundary types support both backends. Protocol failures retain the HTTP status MapLibre expects when a Kotlin/Wasm request rejects.

mise run test:js now runs the JS browser suite, compiles the Wasm targets, and runs the library's Wasm browser suite. Focused Wasm tests verify binary protocol payloads and rejected-promise status fields.

Validation

mise run test:js and mise run check pass locally. The Wasm library suite runs 330 tests. Both the JS and Wasm demos render maps through shrinking and growing Chromium viewports without page errors.

The browser compile used a local 6 GB Kotlin daemon heap and reduced build concurrency. CI results must be evaluated on the updated heads; the base PR's checks do not validate this PR's own changes.

Release dependency

Remains a draft stacked on #1114, pinned to Compose 1.12.10-alpha01+dev4710. The release gate remains a non-prerelease Compose version containing the required WebGL APIs and resize fix.

AI assistance

OpenAI Codex (GPT-6) rebased, integrated, reviewed, and validated the change under human direction.

@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@sargunv sargunv added the blocked-upstream This issue can't be resolved until an upstream issue is resolved label Aug 25, 2026
@cursor
cursor Bot had a problem deploying to cloudflare-pages August 25, 2026 00:48 Error
@cursor
cursor Bot temporarily deployed to cloudflare-pages August 25, 2026 01:10 Inactive
@sargunv sargunv closed this Aug 25, 2026
@sargunv sargunv reopened this Aug 25, 2026
@sargunv
sargunv temporarily deployed to cloudflare-pages August 25, 2026 02:50 — with GitHub Actions Inactive
@sargunv
sargunv force-pushed the cursor/webmain-gljs-wasm-db57 branch from 71a7fd7 to 03a5e19 Compare August 27, 2026 00:04
@sargunv
sargunv changed the base branch from main to codex/integrate-compose-webgl-render-target August 27, 2026 00:04
@sargunv sargunv added the web Affects Web in particular, or relates to Web specific code label Aug 27, 2026
@sargunv
sargunv force-pushed the cursor/webmain-gljs-wasm-db57 branch 2 times, most recently from e67588c to 88942b8 Compare August 27, 2026 21:04
@sargunv
sargunv force-pushed the cursor/webmain-gljs-wasm-db57 branch 4 times, most recently from 9443f1a to 63598dd Compare August 28, 2026 00:47
@cursor
cursor Bot force-pushed the cursor/webmain-gljs-wasm-db57 branch from 63598dd to 67acd97 Compare August 29, 2026 04:03
@cursor
cursor Bot had a problem deploying to cloudflare-pages August 29, 2026 04:03 Failure
@cursor
cursor Bot temporarily deployed to cloudflare-pages August 29, 2026 04:12 Inactive
@cursor
cursor Bot had a problem deploying to cloudflare-pages August 29, 2026 04:42 Error
@cursor
cursor Bot force-pushed the cursor/webmain-gljs-wasm-db57 branch from 42a20cb to 03bf754 Compare August 29, 2026 04:45
@cursor
cursor Bot temporarily deployed to cloudflare-pages August 29, 2026 04:45 Inactive
cursoragent and others added 2 commits September 7, 2026 01:29
Move the browser sources out of jsMain and rewrite the MapLibre GL JS
externals and runtime shims to the Wasm interop types (JsAny, JsArray,
package-level js()), so both web targets compile against the same
bindings.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
Wasm has no NumberFormatOptions constructor, and a js() helper that called
.format was rewritten by Kotlin/JS into a constructor. unsafeJso is not
writable here, so the options object is built with a js literal instead.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
cursoragent and others added 5 commits September 7, 2026 01:29
The browser libraries compile and publish for Kotlin/Wasm. CI compiles the Wasm targets after the Kotlin/JS browser tests.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
Promise.await() keeps JsNumber on Wasm, and JsArray has no Kotlin map
extension, so convert the zoom result and copy query features through
toList().

Co-authored-by: github.boned427 <github.boned427@passmail.net>
The docs site and Cloudflare Pages package now copy wasmJsBrowserDistribution
instead of the Kotlin/JS executable.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
wasmJsBrowserDistribution failed against the stale lock after the GL JS bump.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-upstream This issue can't be resolved until an upstream issue is resolved web Affects Web in particular, or relates to Web specific code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants