Have the best of both worlds. Construct elegant class hierarchies for maximum code reuse and extensibility, implement their behavior using higher-order functions. Or anything in-between.Learn More
click the boxes below to see Scala in action!
Scala runs on the JVM, so Java and Scala stacks can be freely mixed for totally seamless integration.
So the type system doesn’t feel so static. Don’t work for the type system. Let the type system work for you!
Use data-parallel operations on collections, use actors for concurrency and distribution, or futures for asynchronous programming.
Combine the flexibility of Java-style interfaces with the power of classes. Think principled multiple-inheritance.
Think “switch” on steroids. Match against class hierarchies, sequences, and more.
Functions are first-class objects. Compose them with guaranteed type safety. Use them anywhere, pass them to anything.
This week we release the first version of scalajs-bundler, a tool that makes it easier to use npm packages for Scala.js developers. This effort is part of the Scala Center’s initiative to ensure the continuity of the Scala.js project.
Our goal is to make npm dependencies management as easy as JVM dependencies management.
Basically, if your application needs to use an npm package
foo, all you have to do is to
add to your build a line like the following:
npmDependencies in Compile += "foo" -> "1.0"
And then the usual
test sbt commands just work.
There are mainly two existing approaches to tackle these challenges: using WebJars or combining two build systems (one for the Scala world and one for the npm world). Both of them require extra efforts from developers or have limitations (you can find more details about that in scalajs-bundler’s documentation).
scalajs-bundler leverages the CommonJS modules support brought by the latest Scala.js release.
The 0.1 release contains an sbt plugin that:
We also provide a second sbt plugin that integrates with sbt-web-scalajs: it basically turns bundles into sbt-web assets.
There is still some work to do (in particular to shorten the duration of the bundling process in the context of live reloading workflows) and we expect to release a 0.2 version soon, but this first release is already usable, so don’t hesitate to give it a try, we’d love to get your feedback!