Repository navigation
build(wasm): retire wasm workarounds on a locally built scala-wasm - #46
Draft
sideeffffect wants to merge 9 commits into
Draft
sideeffffect wants to merge 9 commits into
sideeffffect wants to merge 9 commits into
Conversation
…m snapshot scala-wasm/scala-wasm#268 (merged, unreleased) passes WIT params through linear memory on both sides, so dapr4s-wasm-linker, its build script and patch go away. The wasm build now pins 1.22.1-wasm.7-dapr4s-local, built from source by scripts/wasm/build-scala-wasm.sh (scala-wasm branch + the heads of #269 and #271); the CI wasm leg builds it, cached by the script hash. Central publishing of the wasm artifacts is off while the pin is unreleased. Also: the fork's JUnit runtime for munit (#271 excludes the upstream one), and compose.sh pulls the providers under dapr-wasm-components' new OCI names (v0.7.4 removed the flat ones). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…271) The scala-wasm plugin now excludes the upstream core libraries itself. Verified on the counter / wallWasm classpaths (source and release mode): no org.scala-js scalajs-library/javalib left. The fork's 2.13 scalalib exclusion stays (#271 leaves that duplicate); the fork's scala-library / scala3-library rules were no-ops and go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… as is scala-wasm/scala-wasm#269 keeps a @Witalias reached through a plain type alias. wit-bindgen-scala 0.1.0 writes a used alias structurally, so wasm/build.sbt rewrites those lines of the generated bindings to point at the defining interface (useWitAliases; without it compose fails with 'missing expected list export metadata', checked). dapr4sComponent now copies the linker's component (already UTF-16): no component embed/new, and an app needs no WIT files and no wkg. Docs: AGENTS.md, WASM-COMPONENTS-PROPOSAL.md, the wiki page + log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scala-wasm plugin generates the bindings for Test into the same directory as for Compile; on a cold CI build the two parallel runs (and useWitAliases) corrupted bindings.scala. witGlue has no tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asm-upstream-snapshot
sideeffffect
added a commit
that referenced
this pull request
Oct 16, 2026
Under pipefail + set -e, dapr writing after head exited killed the script with exit 141 (seen on the CI wasm leg of PR #46). Keep the first line in the shell instead; the helper still returns dapr's status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asm-upstream-snapshot
# Conflicts: # AGENTS.md # src/wasm/glue/WitGlue.scala # test/wasm/imports-probe/Probe.scala # wiki/log.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #44. Draft: it pins a scala-wasm that is not released yet.
What changes
The wasm build now uses
1.22.1-wasm.7-dapr4s-local.scripts/wasm/build-scala-wasm.shbuilds it from source: scala-wasm'sscala-wasmbranch at32cda138plus a local merge of two open PRs, all pinned by SHA. It runspublishLocal. The CIwasmleg runs the script and caches the result by the script's hash. Nothing is pushed to scala-wasm.dapr4s-wasm-linker(artifact, script, patch)component embed --encoding utf16+component new)org.scala-jslibrary/javalib exclusionsdapr4s-wasmTwo small new workarounds:
useWitAliasesinwasm/build.sbt. wit-bindgen-scala 0.1.0 writes aused alias as its structure (type Metadata = Array[...]), so #269 alone does not keepmetadata. The rewrite makes ittype Metadata = types.Metadata. Without it, compose still fails ("missing expected list exportmetadata").scalajs-junit-test-runtimeonwallWasm/Test. #271 also removes the upstream JUnit runtime that munit needs and adds no fork one.Apps now need no WIT files and no wkg: the linker's component is used as is.
Also:
PUBLISH_WASM_TO_CENTRALis'false'. The plugin's POM would name ansbt-scalajsthat is not on Central.How it was verified (locally)
cd wasm && sbt scalafmtCheckAll scalafmtSbtCheck compile wallWasm/test(15 passed), source mode and release mode.scripts/wasm/e2e.shin source mode: counter-raw, counter (error mapping too), imports-probe (the four imports with more than 16 flat params, against daprd).sbt publishLocal+scripts/wasm/consumer-check.sh: a fresh consumer build with no WIT files, e2e OK.counterandwallWasm/Test: noorg.scala-jscore library left.sbt scalafmtCheckAll scalafmtSbtCheck: OK.What remains
build-scala-wasm.shand its CI steps, and turnPUBLISH_WASM_TO_CENTRALback on.useWitAliasesstays until wit-bindgen-scala writesused aliases as references.🤖 Generated with Claude Code