|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Announcing Scala.js 0.5.1 |
| 4 | +category: news |
| 5 | +tags: [releases] |
| 6 | +--- |
| 7 | +{% include JB/setup %} |
| 8 | + |
| 9 | +We are excited to announce the release of Scala.js 0.5.1! |
| 10 | + |
| 11 | +This version features bug fixes and improvements while remaining binary compatible with Scala.js 0.5.0. Therefore, Scala.js libraries may, but need not be republished with Scala.js 0.5.1. |
| 12 | + |
| 13 | +Please report any issues [on GitHub](https://github.com/scala-js/scala-js/issues). |
| 14 | + |
| 15 | +## Improvements in the 0.5.1 release |
| 16 | + |
| 17 | +For changes introduced in 0.5.0, how to upgrade, getting started etc. have a look at the [0.5.0 announcement](./2014-06-13-announcing-scalajs-0.5.0.html). |
| 18 | + |
| 19 | +#### Additions to the Java library |
| 20 | + |
| 21 | +The following two are now implemented according to spec: |
| 22 | + |
| 23 | +- `java.util.Date` |
| 24 | +- `java.util.Random` |
| 25 | + |
| 26 | +#### Wrappers for JavaScript Arrays and Dictionaries |
| 27 | + |
| 28 | +Thanks to `js.WrappedArray` and `js.WrappedDictionary` (and some implicit conversions), `js.Array` and `js.Dictionary` can now be passed to Scala code that expects `mutable.Seq` and `mutable.Map` respectively: |
| 29 | + |
| 30 | +{% highlight scala %} |
| 31 | +def setHead(x: mutable.Seq[Int]): Unit = x(0) = 42 |
| 32 | +val array = js.Array(1, 2, 3) |
| 33 | +setHead(array) |
| 34 | +println(array) // -> 42,2,3 |
| 35 | +{% endhighlight %} |
| 36 | + |
| 37 | +Further, this allows to call methods defined on `Map` on `js.Dictionary` (`foreach`, `map`, `filter`, etc.) |
| 38 | + |
| 39 | +#### Filter `jsDependencies` when executing JavaScript code |
| 40 | + |
| 41 | +The new sbt setting `jsDependencyFilter` can be used to modify the dependencies used when running/testing: |
| 42 | + |
| 43 | + jsDependencyFilter := (_.filter(_.resourceName != "jquery.js")) |
| 44 | + |
| 45 | +The above would prevent "jquery.js" from being included by the sbt runners. See [FlatJSDependency]({{ BASE_PATH }}/api/scalajs-tools/0.5.1/#scala.scalajs.tools.jsdep.FlatJSDependency) for fields that you can use. |
| 46 | + |
| 47 | +#### Ordered testing output |
| 48 | + |
| 49 | +When testing in the `fastOptStage` or the `fullOptStage`, test output sometimes appeared interleaved. This has been fixed this release. |
| 50 | + |
| 51 | +## Contributors |
| 52 | + |
| 53 | +Thanks to all the code contributors: |
| 54 | + |
| 55 | +- [Sébastien Doeraene](https://github.com/sjrd/) |
| 56 | +- [Tobias Schlatter](https://github.com/gzm0/) |
| 57 | +- [Alexander Myltsev](https://github.com/alexander-myltsev) |
| 58 | +- [Matt Seddon](https://github.com/mseddon) |
0 commit comments