This series of tutorials teaches you how to use Scala.js together with modern development tools. They can be followed independently of each other.
If you have time, reading and applying them in order will give you more in-depth knowledge about the development environment.
If you are in a hurry, you can skip the ones you are not interested in. Each tutorial starts with a link to a repo that you can clone to get off the ground.
In any case, make sure that you have the prerequisites listed below covered.
- Scala.js and Vite:
- Set up a hello world project ready for live reloading in the browser.
- Generate minimized production assets.
- Build UIs with Laminar using Functional Reactive Programming (FRP), a hybrid model between imperative and functional programming particularly well suited for UI development in Scala.
In any case, make sure that you have the following tools installed first:
If in doubt, try the following commands in a terminal. They should all succeed, though the reported version numbers may differ.
We also recommend that you use an IDE for Scala. If you do not know what to pick, we recommend VS Code with the Metals extension.
Here are some older tutorials, which may still provide value:
- The old basic tutorial
- Hands-on Scala.js, an extensive tutorial in eBook format
- SPA tutorial for writing a Single-Page-Application using React
Additionally, take a look at the available Project Skeletons to start with a pre-existing template.