Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions _posts/news/2014-06-30-announcing-scalajs-0.5.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
layout: post
title: Announcing Scala.js 0.5.1
category: news
tags: [releases]
---
{% include JB/setup %}

We are excited to announce the release of Scala.js 0.5.1!

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.

Please report any issues [on GitHub](https://github.com/scala-js/scala-js/issues).

## Improvements in the 0.5.1 release

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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That link is dead. Should be {{ BASE_PATH }}/news/2014/06/13/announcing-scalajs-0.5.0/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Fixing right now.


#### Additions to the Java library

The following two are now implemented according to spec:

- `java.util.Date`
- `java.util.Random`

#### Wrappers for JavaScript Arrays and Dictionaries

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:

{% highlight scala %}
def setHead(x: mutable.Seq[Int]): Unit = x(0) = 42
val array = js.Array(1, 2, 3)
setHead(array)
println(array) // -> 42,2,3
{% endhighlight %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also mention that this allows to use js.Dictionary as a Map by calling its methods directly, e.g., iterate over the pairs key/value with a for comprehension. This is what people wanted mostly.


Further, this allows to call methods defined on `Map` on `js.Dictionary` (`foreach`, `map`, `filter`, etc.)

#### Filter `jsDependencies` when executing JavaScript code

The new sbt setting `jsDependencyFilter` can be used to modify the dependencies used when running/testing:

jsDependencyFilter := (_.filter(_.resourceName != "jquery.js"))

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.

#### Ordered testing output

When testing in the `fastOptStage` or the `fullOptStage`, test output sometimes appeared interleaved. This has been fixed this release.

## Contributors

Thanks to all the code contributors:

- [Sébastien Doeraene](https://github.com/sjrd/)
- [Tobias Schlatter](https://github.com/gzm0/)
- [Alexander Myltsev](https://github.com/alexander-myltsev)
- [Matt Seddon](https://github.com/mseddon)
6 changes: 6 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Generated Scaladocs are available here:

### Scala.js

#### Scala.js 0.5.1
* [0.5.1 scalajs-library]({{ BASE_PATH }}/api/scalajs-library/0.5.1/#scala.scalajs.js.package)
* [0.5.1 scalajs-tools]({{ BASE_PATH }}/api/scalajs-tools/0.5.1/)
* [0.5.1 scalajs-test-bridge]({{ BASE_PATH }}/api/scalajs-test-bridge/0.5.1/)
* [0.5.1 scalajs-jasmine-test-framework]({{ BASE_PATH }}/api/scalajs-jasmine-test-framework/0.5.1/)

#### Scala.js 0.5.0
* [0.5.0 scalajs-library]({{ BASE_PATH }}/api/scalajs-library/0.5.0/#scala.scalajs.js.package)
* [0.5.0 scalajs-tools]({{ BASE_PATH }}/api/scalajs-tools/0.5.0/)
Expand Down
15 changes: 4 additions & 11 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To setup Scala.js in a new sbt project, we need to do two things:

Adding the Scala.js sbt plugin is a one-liner in `project/plugins.sbt` (all file names we write in this tutorial are relative to the project root):

addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.0")
addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.1")

We also setup basic project settings and Scala.js settings in the sbt build file (`build.sbt`, in the project root directory):

Expand Down Expand Up @@ -372,20 +372,13 @@ This even shows you the temporary webpage the plugin generates to launch Phantom

According to the [explanation in uTest's readme](http://github.com/lihaoyi/utest#scalajs-and-sbt), we add the following to our `build.sbt`:

libraryDependencies += "com.lihaoyi" %%% "utest" % "0.1.6" % "test"
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.1.7" % "test"

(loadedTestFrameworks in Test) := {
(loadedTestFrameworks in Test).value.updated(
sbt.TestFramework(classOf[utest.jsrunner.JsFramework].getName),
new utest.jsrunner.JsFramework(environment = (ScalaJSKeys.jsEnv in Test).value)
)
}

testLoader := scala.scalajs.sbtplugin.testing.JSClasspathLoader((ScalaJSKeys.execClasspath in Compile).value)
utest.jsrunner.Plugin.utestJsSettings

And the following to our `project/plugins.sbt`:

addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.1.6")
addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.1.7")

We are now ready to add a first simple test suite (`src/test/scala/tutorial/webapp/TutorialTest.scala`):

Expand Down
6 changes: 6 additions & 0 deletions downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ We strongly recommend using the SBT plugin, as shown in the [bootstrapping skele

The CLI distribution requires `scala` and `scalac` (of the right major version) to be on the execution path. Unpack it wherever you like and add the `bin/` folder to your execution path.

#### Scala.js 0.5.1
* [0.5.1, Scala 2.11 (tgz, 13MB)]({{ BASE_PATH }}/files/scalajs_2.11-0.5.1.tgz)
* [0.5.1, Scala 2.11 (zip, 13MB)]({{ BASE_PATH }}/files/scalajs_2.11-0.5.1.zip)
* [0.5.1, Scala 2.10 (tgz, 15MB)]({{ BASE_PATH }}/files/scalajs_2.10-0.5.1.tgz)
* [0.5.1, Scala 2.10 (zip, 15MB)]({{ BASE_PATH }}/files/scalajs_2.10-0.5.1.zip)

#### Scala.js 0.5.0
* [0.5.0, Scala 2.11 (tgz, 13MB)]({{ BASE_PATH }}/files/scalajs_2.11-0.5.0.tgz)
* [0.5.0, Scala 2.11 (zip, 13MB)]({{ BASE_PATH }}/files/scalajs_2.11-0.5.0.zip)
Expand Down