Skip to content

Commit 828bf74

Browse files
committed
Announcing Scala.js 1.3.1.
1 parent d12aa2c commit 828bf74

File tree

4 files changed

+126
-1
lines changed

4 files changed

+126
-1
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ colors: #in hex code if not noted else
5757

5858
### VERSIONS ###
5959
versions:
60-
scalaJS: 1.3.0
60+
scalaJS: 1.3.1
6161
scalaJSBinary: 1
6262
scalaJS06x: 0.6.33
6363
scalaJS06xBinary: 0.6
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
layout: post
3+
title: Announcing Scala.js 1.3.1
4+
category: news
5+
tags: [releases]
6+
permalink: /news/2020/11/16/announcing-scalajs-1.3.1/
7+
---
8+
9+
10+
We are pleased to announce the release of Scala.js 1.3.1!
11+
12+
This release fixes the performance issues of the ECMAScript 2015 mode (the default) on Firefox.
13+
This fix **has a cost in terms of emitted code size**.
14+
Read more below about the trade-offs.
15+
16+
In addition, this release fixes several other issues, including three regressions in 1.3.0 ([#4252](https://github.com/scala-js/scala-js/issues/4252), [#4268](https://github.com/scala-js/scala-js/issues/4268) and [#4271](https://github.com/scala-js/scala-js/issues/4271)).
17+
It also contains some improvements to the JDK support.
18+
19+
Read on for more details.
20+
21+
<!--more-->
22+
23+
## Getting started
24+
25+
If you are new to Scala.js, head over to [the tutorial]({{ BASE_PATH }}/tutorial/).
26+
27+
If you need help with anything related to Scala.js, you may find our community [on Gitter](https://gitter.im/scala-js/scala-js) and [on Stack Overflow](https://stackoverflow.com/questions/tagged/scala.js).
28+
29+
Bug reports can be filed [on GitHub](https://github.com/scala-js/scala-js/issues).
30+
31+
## Release notes
32+
33+
If upgrading from Scala.js 0.6.x, make sure to read [the release notes of Scala.js 1.0.0]({{ BASE_PATH }}/news/2020/02/25/announcing-scalajs-1.0.0/) first, as they contain a host of important information, including breaking changes.
34+
35+
This is a **patch** release:
36+
37+
* It is backward binary compatible with all earlier versions in the 1.x series: libraries compiled with 1.0.x through 1.3.0 can be used with 1.3.1 without change.
38+
* It is forward binary compatible with 1.3.0: libraries compiled with 1.3.1 can be used with 1.3.0 without change.
39+
* It is backward source compatible with 1.3.0: source code that used to compile with 1.3.0 should compile as is when upgrading to 1.3.1.
40+
41+
From Scala.js 1.3.0, which was a **minor** release:
42+
43+
* It is *not* forward binary compatible with 1.2.x: libraries compiled with 1.3.1 cannot be used with 1.2.x or earlier.
44+
* It is *not* entirely backward source compatible: it is not guaranteed that a codebase will compile *as is* when upgrading from 1.2.x or earlier (in particular in the presence of `-Xfatal-warnings`).
45+
46+
As a reminder, libraries compiled with 0.6.x cannot be used with Scala.js 1.x; they must be republished with 1.x first.
47+
48+
## Performance fix on Firefox and code size increase
49+
50+
Scala.js code has been known for bad performance on Firefox with the default output mode of ECMAScript 2015.
51+
52+
**This release fixes this issue, but at the cost of increased emitted code size.**
53+
54+
If you have been using the following setting to avoid bad performance on Firefox, you can now remove it:
55+
56+
{% highlight scala %}
57+
// This was necessary before 1.3.1 to avoid bad performance on Firefox
58+
scalaJSLinkerConfig ~= { _.withESFeatures(_.withUseECMAScript2015(false)) }
59+
{% endhighlight %}
60+
61+
If your codebase does not target the Web nor any SpiderMonkey-based environment, you may want to trade it away for the better code size from before.
62+
You can tell Scala.js that avoiding `class`es is not necessary with the following setting:
63+
64+
{% highlight scala %}
65+
// Trade away decent Firefox performance for a smaller output
66+
scalaJSLinkerConfig ~= { _.withESFeatures(_.withAvoidClasses(false)) }
67+
{% endhighlight %}
68+
69+
It turns out that SpiderMonkey, the JavaScript engine of Firefox, exhibits severe performance penalties for JavaScript `class`es.
70+
This has caused slowdowns for Scala.js code of up to 10x compared to other browsers and compared to the ECMAScript 5.1 mode.
71+
Starting from Scala.js 1.3.1, we restrict the usage of `class`es in the emitted JavaScript to the minimum required for correct semantics.
72+
We fall back to `function`s and `prototype`s for the majority of the emitted code.
73+
74+
## Miscellaneous
75+
76+
### Better support of Scala 3 in sbt-scalajs
77+
78+
The sbt plugin now has better support for Scala 3 codebases.
79+
In particular, the JUnit support works out of the box with `enablePlugins(ScalaJSJUnitPlugin)`.
80+
It is also future-proof for when sbt will support Scala 3 out of the box, rather than requiring `sbt-dotty`.
81+
82+
These improvements are only available for Scala >= 3.0.0-M1.
83+
The 0.x versions are not supported.
84+
85+
### New JDK APIs
86+
87+
This release contains some improvements in the JDK APIs that we support:
88+
89+
New classes:
90+
91+
* `java.lang.ClassValue`
92+
93+
New methods:
94+
95+
* `new java.util.HashMap(initialCapacity: Int, loadFactor: Float)`
96+
* `java.util.Objects.requireNonNull(obj: T, message: Supplier[String])`
97+
98+
Methods with fixed or improved behavior:
99+
100+
* In `java.util.regex.Matcher`:
101+
* `lookingAt()` and `matches()` ([#4252](https://github.com/scala-js/scala-js/issues/4252))
102+
* `reset()` ([#4254](https://github.com/scala-js/scala-js/issues/4254))
103+
* `java.util.Formatter` and derivatives (such as `String.format`) now support `java.math.BigInteger` arguments with the `%d`, `%x` and `%o` conversions
104+
105+
## Bug fixes
106+
107+
Among others, the following bugs have been fixed in 1.3.1:
108+
109+
* [#4252](https://github.com/scala-js/scala-js/issues/4252) `regex.Matcher.lookingAt()` and `matches()` incorrect in 1.3.0
110+
* [#4268](https://github.com/scala-js/scala-js/issues/4268) Native superclass of a non-native JS class is not imported (1.3.0 regression)
111+
* [#4271](https://github.com/scala-js/scala-js/issues/4271) Scala.js 1.3.0 fails to fastOptJS/fullOptJS when the project has no exports nor the module initializer
112+
* [#4254](https://github.com/scala-js/scala-js/issues/4254) `Matcher.reset()` does not reset the region
113+
* [#4281](https://github.com/scala-js/scala-js/issues/4281) Bad error message when trying to define `apply` in an anonymous class extending `js.Function`
114+
115+
You can find the full list [on GitHub](https://github.com/scala-js/scala-js/issues?q=is%3Aissue+milestone%3Av1.3.1+is%3Aclosed).

doc/all-api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ title: All previous versions of the Scala.js API
55

66
## All previous versions of the API
77

8+
### Scala.js 1.3.1
9+
* [1.3.1 scalajs-library]({{ site.production_url }}/api/scalajs-library/1.3.1/scala/scalajs/js/index.html)
10+
* [1.3.1 scalajs-test-interface]({{ site.production_url }}/api/scalajs-test-interface/1.3.1/)
11+
* [1.3.1 scalajs-ir]({{ site.production_url }}/api/scalajs-ir/1.3.1/org/scalajs/ir/index.html)
12+
* [1.3.1 scalajs-linker-interface]({{ site.production_url }}/api/scalajs-linker-interface/1.3.1/org/scalajs/linker/interface/index.html) ([Scala.js version]({{ site.production_url }}/api/scalajs-linker-interface-js/1.3.1/org/scalajs/linker/interface/index.html))
13+
* [1.3.1 scalajs-linker]({{ site.production_url }}/api/scalajs-linker/1.3.1/org/scalajs/linker/index.html) ([Scala.js version]({{ site.production_url }}/api/scalajs-linker-js/1.3.1/org/scalajs/linker/index.html))
14+
* [1.3.1 scalajs-test-adapter]({{ site.production_url }}/api/scalajs-sbt-test-adapter/1.3.1/org/scalajs/testing/adapter/index.html)
15+
* [1.3.1 sbt-scalajs]({{ site.production_url }}/api/sbt-scalajs/1.3.1/#org.scalajs.sbtplugin.package)
16+
817
### Scala.js 1.3.0
918
* [1.3.0 scalajs-library]({{ site.production_url }}/api/scalajs-library/1.3.0/scala/scalajs/js/index.html)
1019
* [1.3.0 scalajs-test-interface]({{ site.production_url }}/api/scalajs-test-interface/1.3.0/)

doc/internals/version-history.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Version history
55

66
## Version history of Scala.js
77

8+
- [1.3.1](/news/2020/11/16/announcing-scalajs-1.3.1/)
89
- [1.3.0](/news/2020/10/16/announcing-scalajs-1.3.0/)
910
- [1.2.0](/news/2020/09/09/announcing-scalajs-1.2.0/)
1011
- [1.1.1](/news/2020/07/02/announcing-scalajs-1.1.1/)

0 commit comments

Comments
 (0)