Announcing Scala.js 0.5.3
Jul 30, 2014.
We are excited to announce the release of Scala.js 0.5.3!
Scala.js 0.5.3 is backward binary compatible with older versions of the 0.5.x branch. However, it is not forward binary compatible. This means:
- You don’t need to re-publish libraries
- You must upgrade to Scala.js 0.5.3 if any library you depend on uses Scala.js 0.5.3
If you choose to re-publish a library, make sure to bump its version.
Please report any issues on GitHub.
Improvements in the 0.5.3 release
Scala.js 0.5.3 is the first release to include an actual optimizer specific to Scala.js.
This optimizer runs as part of the
fastOptJS task, and consistently brings speedups to all applications from 1.3x to 3.3x (Rough benchmarks), along with code size reduction (15 % for the fastOpt version and 6 % for the fullOpt on our demo application) and less memory usage.
Because it runs at link time, the optimizer also applies to libraries you depend on that have been compiled with Scala.js 0.5.0 to 0.5.2 (although a few optimizations won’t be as effective).
The optimizer is incremental in the same sense as the incremental compilation of sbt: on each run, it will reoptimize only the parts of your application that need reoptimizing. This means that it will run much faster starting from the second run within an sbt session (within 200 ms in typical scenarios).
Should you experience any issue (e.g., your code broke), please report them on GitHub. You can also disable the optimizer with the sbt setting
Alternatively, you can force it to run in batch mode (non incremental) on every run with the following setting:
New parts of the Java standard library
The following classes from the Java standard library are now available:
scala.scalajs.js.typearray.ArrayBufferInputStream, an implementation of
These classes are automatically available in all your Scala.js projects.
Other, additional Java classes are also available in the
Currently, the only additional class is
To fix this issue, the
jsDependencies mechanism has been augmented with an optional
commonJSName directive, to be used as:
commonJSName directive should be set to the name used by the library to export itself when run in a CommonJS environment (such as Node.js).
You can typically figure that out from the library’s documentation.
The following bugs have been fixed in 0.5.3:
- #820 Generated html for phantomjs on windows fails to load scripts
js.Array.toList(and others) fails with a
- #865 PhantomJS doesn’t use existing shell environment
string.split('\n')does not work
Changes to the IR
Some (more) minor changes have been made to the IR to better accommodate the optimizer. This is the reason for the lack of forward binary compatibility in this release.