Skip to content

Add --useJSPI to enable JSPI in the WebAssembly backend - #209

Merged
Gedochao merged 1 commit into
VirtusLab:mainfrom
sideeffffect:feat/wasm-jspi
Oct 16, 2026
Merged

Gedochao merged 1 commit into
VirtusLab:mainfrom
sideeffffect:feat/wasm-jspi

Conversation

@sideeffffect

@sideeffffect sideeffffect commented Oct 13, 2026 •

Copy link
Copy Markdown

Needed when playing with Scala Wasm via scala-cli.

Since Scala.js 1.22 the linker links js.async/js.await on WebAssembly
only when WasmFeatures.useJSPI is set; otherwise linking fails with
"Uses an async block without JSPI support in WebAssembly". scalajsld
had no way to set it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sideeffffect
sideeffffect marked this pull request as ready for review October 13, 2026 20:13
sideeffffect added a commit to sideeffffect/scala-cli that referenced this pull request Oct 15, 2026
…s --useJSPI

The bundled scala-js-cli (1.22.0.1) rejects --useJSPI, so the end-to-end test
can only pass once VirtusLab/scala-js-cli#209 is released and scalaJsCli is
bumped. The option parsing and directive are covered by unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sideeffffect

Copy link
Copy Markdown
Author

@Gedochao this is blocking

@Gedochao
Gedochao merged commit f7ed2a8 into VirtusLab:main Oct 16, 2026
10 checks passed
@sideeffffect
sideeffffect deleted the feat/wasm-jspi branch October 16, 2026 06:10
@sideeffffect

Copy link
Copy Markdown
Author

@Gedochao can you please make a new release with this? 🙏

Gedochao added a commit to VirtusLab/scala-cli that referenced this pull request Oct 21, 2026
* Add --js-wasm-jspi and //> using wasmJspi to enable JSPI on Wasm

Since Scala.js 1.22 the linker links js.async/js.await on WebAssembly
only when WasmFeatures.useJSPI is set; otherwise linking fails with
"Uses an async block without JSPI support in WebAssembly". The option
is passed to the Scala.js CLI as --useJSPI, which needs a Scala.js CLI
release containing VirtusLab/scala-js-cli#209.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ignore the --js-wasm-jspi integration test until scala-js-cli supports --useJSPI

The bundled scala-js-cli (1.22.0.1) rejects --useJSPI, so the end-to-end test
can only pass once VirtusLab/scala-js-cli#209 is released and scalaJsCli is
bumped. The option parsing and directive are covered by unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Enable the --js-wasm-jspi integration test

Skip it on Scala 3.3, whose compiler has no js.async/js.await support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update modules/integration/src/test/scala/scala/cli/integration/RunScalaJsTestDefinitions.scala

Co-authored-by: Piotr Chabelski <ged.subfan@gmail.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Piotr Chabelski <ged.subfan@gmail.com>
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.

2 participants