Skip to content
 
 

Latest commit

 

History

8,389 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-wasm

CI

This is a friendly fork of Scala.js, targeting stand-alone Wasm runtimes such as wasmtime, leveraging WASIp2 and Wasm Component Model.

Getting Started

scala-wasm is available as 1.21.1-wasm.4.

In project/plugins.sbt:

addSbtPlugin("io.github.scala-wasm" % "sbt-scalajs" % "1.21.1-wasm.4")

Prerequisites

cargo install wit-bindgen-scala --version 0.1.0-rc.1
  • (optional) wkg
    • Required if you want to add Wasm Component Model dependencies.
  • (optional) Required for running test-component-model:

Examples

Test

test-suite

sbt:Scala.js> set Global/enableWasmEverywhere := true
sbt:Scala.js> set scalaJSLinkerConfig in testSuite.v2_12 ~= (_.withModuleKind(ModuleKind.MinimalWasmModule))
sbt:Scala.js> testSuite2_12/test

Tests that do not link in pure Wasm are filtered out from unmanagedSourceDirectories and sources, see testSuiteCommonSettings.

test-component-model

Test suites for Wasm Component Model based interop.

Build Wasm Component from Scala.

$ sbt
sbt:Scala.js> set Global/enableWasmEverywhere := true
sbt:Scala.js> testComponentModel2_12/fastLinkJS

Build Wasm Components from Rust.

$ cd examples/test-component-model/rust-exports
$ cargo component build --target wasm32-wasip2 -r

$ cd examples/test-component-model/rust-run
$ cargo component build --target wasm32-wasip2 -r

Compose Wasm Components and run.

$ cd examples/test-component-model
$ make run SCALA_VERSION=2.12

What follows below is README.md of the upstream scala-js project


Scala.js

Chat: #scala-js on Discord.

This is the repository for Scala.js, the Scala to JavaScript compiler.

License

Scala.js is distributed under the Apache License Version 2.0.

About

Friendly fork of Scala.js, with Wasm Component Model support

Resources

Contributing

Stars

42 stars

Watchers

5 watching

Forks

Releases

Contributors

Languages