Scala.js 1.0.0 is now available after 7 years of development. Scala.js is a close compiler that compiles Scala source code to JavaScript. The 1.0 release features great portability wrt. Scala/JVM, interoperability with JavaScript, and better run-time performance.
“Scala.js 1.0.0 is the culmination of our efforts to simplify, specify, and future-proof all aspects of Scala.js, from the language semantics to the internal APIs, so that there is nothing left to take away,” the Scala development team wrote in a post.
According to the team, the only major breaking change at the language level in the release is access to the global scope instead of the global object.
The changes from global object to global scope mean that magical “global” variables provided by some JavaScript environments, such as ‘require’ in Node.js, are now visible to Scala.js. For example, it is possible to dynamically call ‘require’ in Scala.js 1.x.
Also, Scala.js emits ECMAScript 2015 code by default, which has several advantages over the older ES 5.1 strict mode output, the team explained. For example it allows for better display of stack traces and error messages in interactive debuggers. Static fields and methods in JS classes are properly inherited and the generated code is shorter.
Upgrading to 1.0.0 from version 0.6.32 or later is recommended. Since Scala.js 1.0.0 removes support for all the deprecated features in 0.6.x, it is easier to see the deprecation messages guiding users to the proper replacements, the developers explained.
Additionally, if some of the components have been moved to separate repositories, users will need to add some more dependencies in ‘project/plugins.sbt’.
More information is available here.