A minimal introduction to working with Scala.js with sbt in IntelliJ.
(Not endorsed by or in any way affiliated with Lightbend or EPFL.)
Scala.js1 is a Scala-to-JavaScript compiler. It allows you to write type-safe, statically-checked Scala code in your favourite IDE, and compile it to optimised JavaScript which you can run in your browser.
Scala.js is not "Scala lite". "Scala.js syntax" is identical to Scala syntax, because Scala.js is Scala. Scala.js just compiles your Scala code to JavaScript instead of Java bytecode.
Scala.js gives you the best of both Scala and JavaScript. Many popular Scala libraries and extensions are fully supported in Scala.js, including Scalactic / ScalaTest2, Cats3, Akka4, Play5, and more. In addition, Scala.js facades6 have been implemented for popular JavaScript libraries and frameworks like jQuery, Plotly, React, Angular, and Vue, among many others.
This is the first step in a series of tutorials which explain how to use Scala.js in an IntelliJ sbt project.
In this step, we will create a Scala.js project from scratch, adding the required libraries and dependencies, and will send some output to the browser console.
Open TUTORIAL.md for the step-by-step tutorial.
Click here for the next tutorial, which covers Li Haoyi's ScalaTags library.
[2] https://www.scalatest.org/release_notes/3.0.0
[3] https://typelevel.org/cats/
[4] https://github.com/akka-js/akka.js/