The easiest way to get started is to follow our tutorial. You can also fork the bootstrapping skeleton and follow the instructions in its readme or try it out in the browser. There's also an e-book Hands-on Scala.js which contains a lot of introductory material to help you get started.
We also have a standalone distribution that doesn't require SBT.
Important notice! Scala.js is still experimental! Although this is a project of LAMP/EPFL for which we will continue to provide best-effort improvements and bug fixes, it is not supported by Typesafe, and not part of any of their support contracts. You have been warned!
- Support all of Scala (including macros!), modulo a few semantic differences
- Integrated with sbt (including support for dependency management and incremental compilation)
- Can be used with your favorite IDE for Scala
- Generates Source Maps for a smooth debugging experience (step through your Scala code from within your browser supporting source maps)
- Integrates Google Closure Compiler for producing minimal code for production. Compiled blobs range from 170-400kb
- Official mailing list
- Scala.js tag on Stackoverflow. Please help building it up by asking questions.
- Hands-on Scala.js at PNWScala, by Li Haoyi
- Cross-Platform Development in Scala.js, by Li Haoyi
- Scala's evolving ecosystem- Introduction to Scala.js, by Ayush Mishra, Knoldus Software LLP
- Scala.js at Scaladays 2014, by Sébastien Doeraene
- Live Coding Scala.js at SF Scala 2014 by Li Haoyi
- Live-coding with Scala.js at Scala eXchange 2013
- Presentation of Scala.js at Scala Days 2013 (older and somewhat obsolete)
This is a collection of libraries that work with Scala.js. Some of them, like
scala-async are pure-macro projects, and thus work with Scala.js out of the box. Most of them, though, started off as Scala-JVM projects and were ported over, and thus have separate artifacts to run on each platforms. The SBT snippets given are for the version that runs on Scala.js.
"org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6"
Static types for the DOM API, by Li Haoyi
"org.scala-lang.modules.scalajs" %%% "scalajs-jquery" % "0.6"
Static types for jQuery, by Sébastien Doeraene
// Minimal usage libraryDependencies += "com.github.japgolly.scalajs-react" %%% "core" % "0.6.1" // Test support including ReactTestUtils libraryDependencies += "com.github.japgolly.scalajs-react" %%% "test" % "0.6.1" % "test" // Scalaz support libraryDependencies += "com.github.japgolly.scalajs-react" %%% "ext-scalaz70" % "0.6.1" // or libraryDependencies += "com.github.japgolly.scalajs-react" %%% "ext-scalaz71" % "0.6.1"
Lifts Facebook's React library into Scala.js and endeavours to make it as type-safe and Scala-friendly as possible, by David Barri
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1") // project/build.sbt resolvers += bintray.Opts.resolver.repo("denigma", "denigma-releases") libraryDependencies += "org.denigma" %%% "binding" % "0.4.4"
A ScalaJS html binding library, by Anton Kulaga
"com.scalatags" %%% "scalatags" % "0.4.2"
A HTML templating library/DSL that works on both Scala-JVM and Scala-JS, by Li Haoyi
"com.scalarx" %%% "scalarx" % "0.2.5"
A change-propagation/FRP library that runs on both Scala-JVM and Scala-JS, by Li Haoyi
addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.2.4") // project/build.sbt "com.lihaoyi" %%% "utest" % "0.2.4"
A tiny, portable unit testing library that lets you run the same tests on both Scala-JVM and Scala-JS, by Li Haoyi
libraryDependencies += "org.qirx" %%% "little-spec" % "0.3" % "test" ScalaJSKeys.scalaJSTestFramework in Test := "org.qirx.littlespec.scalajs.TestFramework"
A small extendable test/specification library that can generate documentation, works on both Scala-JVM and Scala-JS, by EECOLOR
libraryDependencies += "org.monifu" %%% "minitest" % "0.2" % "test" testFrameworks += new TestFramework("minitest.runner.Framework")
MiniTest is a light and effective testing framework for Scala, that lets you share tests across Scala on the JVM and Scala.js, by Alexandru Nedelcu.
NOTE: At this point it is compiled for Scala.js
and won't work with the stable
"com.lihaoyi" %%% "upickle" % "0.2.5"
Statically-typed pickling (via typeclasses/macros) for both Scala-JVM and Scala-JS, by Li Haoyi
"com.lihaoyi" %%% "autowire" % "0.1.2"
Statically-typed Ajax calls and RPCs for both Scala-JVM and Scala-JS, by Li Haoyi
"org.scalajs" %%% "scalajs-pickling" % "0.3"
A cross-compiling pickling (aka serialization) library for Scala.js and Scala with a common JSON-based format, by Sébastien Doeraene
"com.github.benhutchison" %%% "prickle" % "1.1.0"
Yet another statically-typed pickling library for Scala.js / Scala.jvm, with support for pickling object graphs containing shared objects and cycles, by Ben Hutchison
Reactive extensions (Rx) with back-pressure, atomic references and other multi-threading primitives cross-compiled to Scala.js, by Alexandru Nedelcu
"com.github.japgolly.fork.scalaz" %%% "scalaz-core" % "7.1.0-4" "com.github.japgolly.fork.scalaz" %%% "scalaz-effect" % "7.1.0-4" // etc
Port of Scalaz to Scala.js, maintained by David Barri
"com.github.japgolly.fork.monocle" %%% "monocle-core" % "1.0.1"
Port of Monocle to Scala.js, maintained by David Barri
"com.github.japgolly.fork.nicta" %%% "rng" % "1.3.0"
Port of RNG to Scala.js, maintained by David Barri
resolvers += "bintray-alexander_myltsev" at "http://dl.bintray.com/content/alexander-myltsev/maven" libraryDependencies += "name.myltsev" %% "shapeless_sjs0.5" % "2.0.0"
Port of Shapeless to Scala.js, maintained by Alexander Myltsev
"org.scala-lang.modules" %% "scala-async" % "0.9.1"
Scala-Async is a pure-macro project without any runtime dependencies. Thus it works with Scala.js out of the box, without needing to be specially compiled for it.
Another pure-macro project, Scalaxy loops and streams work great with Scala.js without needing to be specially compiled for it.
Static types and complementary API for AngularJS, by Xavier Cho
A skeleton application using Scala.js workbench for live-reloading in the browser, together with a collection of sample applications developed using it
by Vincent Munier
by Rocky Madden
A sbt plugin for Scala.js projects for live-reloading in the browser (example app), by Li Haoyi
- Port of the Dart benchmark harness by Jonas Fonseca
Want to contribute to Scala.js? Check out the list of contributing opportunities.
List of websites using Scala.js:
- September 2014
- July 2014
- Play and Scala.js Showcase, by Hussachai Puripunpinyo
- May 2014
- Papa-Carlo Incremental Parser Demo, by Eliah-Lakhin
- April 2014
- Ray-Tracer, a ray-tracer written in Scala.js by Li Haoyi
- February 2014
- TodoMVC, an implementation of the TodoMVC example application using Scala.js, Scalatags, Scala.Rx and scala-js-dom, by Li Haoyi
- Sierpinski Triangle and Dodge the dot (Scala.js workbench example apps), by Li Haoyi
- Scala.jsFiddle, an online scratchpad that lets you compile and run Scala.js snippets right in the browser, by Li Haoyi
- December 2013
- Roll, a 2D Physics Platformer by Li Haoyi
- December 2013
- October 2013
- Several games by Li Haoyi
- July 2013
- Knapsack on a graph by Krishnan Raman
- June 2013
- April 2013
- The Reversi example by Sébastien Doeraene
Hall of Fame
- Bug in node.js/v8 discovered by Scala.js through Scala test suite