Skip to content

Commit 5c6c28e

Browse files
authored
Merge pull request #668 from sjrd/scalajs-1.20.2
Announcing Scala.js 1.20.2.
2 parents d9d183d + d9d9861 commit 5c6c28e

4 files changed

Lines changed: 107 additions & 1 deletion

File tree

_config.yml

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

6565
### VERSIONS ###
6666
versions:
67-
scalaJS: 1.20.1
67+
scalaJS: 1.20.2
6868
scalaJSBinary: 1
6969
scalaJS06x: 0.6.33
7070
scalaJS06xBinary: 0.6
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
layout: post
3+
title: Announcing Scala.js 1.20.2
4+
category: news
5+
tags: [releases]
6+
permalink: /news/2026/01/05/announcing-scalajs-1.20.2/
7+
---
8+
9+
10+
We are pleased to announce the release of Scala.js 1.20.2!
11+
12+
This release comes with even more performance improvements to the WebAssembly and JavaScript backends alike.
13+
14+
The Scala standard library has been upgraded to match Scala 2.12.21 and 2.13.17.
15+
16+
Read on for more details.
17+
18+
<!--more-->
19+
20+
## Getting started
21+
22+
If you are new to Scala.js, head over to [the tutorial]({{ BASE_PATH }}/tutorial/).
23+
24+
If you need help with anything related to Scala.js, you may find our community [in `#scala-js` on Discord](https://discord.com/invite/scala) and [on Stack Overflow](https://stackoverflow.com/questions/tagged/scala.js).
25+
26+
Bug reports can be filed [on GitHub](https://github.com/scala-js/scala-js/issues).
27+
28+
## Release notes
29+
30+
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.
31+
32+
This is a **patch** release:
33+
34+
* It is backward binary compatible with all earlier versions in the 1.x series: libraries compiled with 1.0.x through 1.20.1 can be used with 1.20.2 without change.
35+
* It is forward binary compatible with 1.20.0 and 1.20.1: libraries compiled with 1.20.2 can be used with previous 1.20.x versions without change.
36+
* It is backward source compatible with 1.20.0 and 1.20.1: source code that used to compile with previous 1.20.x versions should compile as is when upgrading to 1.20.2.
37+
38+
In addition, like Scala.js 1.20.0 and 1.20.1:
39+
40+
* It is *not* forward binary compatible with 1.19.x: libraries compiled with 1.20.2 cannot be used with 1.19.x or earlier.
41+
* It is *not* entirely backward source compatible with 1.19.x: it is not guaranteed that a codebase will compile *as is* when upgrading from 1.19.x or earlier (in particular in the presence of `-Xfatal-warnings`).
42+
43+
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.
44+
45+
## Enhancements
46+
47+
### Performance improvements
48+
49+
Scala.js 1.20.2 brings a number of performance improvements compared to 1.20.1.
50+
These come in addition to the improvements shipped in 1.20.1.
51+
52+
For both JavaScript and WebAssembly:
53+
54+
* Micro-optimizations in low-level methods in `java.lang.Math`, `Float`, and `Double`.
55+
* Various new micro-optimizations performed by the optimizer, among which:
56+
* Divisions and remainders by constants.
57+
* Constant range checks of the form `x >= c1 && x <= c2`.
58+
59+
For JavaScript:
60+
61+
* Performance improvements for `Long`:
62+
* They are not boxed anymore when stored in fields, stored in arrays, or passed as method arguments. They are still boxed when returned from methods.
63+
* Division and remainder operations received a 3x speedup thanks to a new, state-of-the-art algorithm.
64+
65+
For WebAssembly, performance improvements in the following areas:
66+
67+
* `java.lang.Long.parseLong`, `parseUnsignedLong`.
68+
* Faster allocation of arrays of primitive types.
69+
* Fewer Wasm-to-JS calls for JavaScript methods that return primitive values.
70+
71+
## Miscellaneous
72+
73+
### New JDK APIs
74+
75+
This release adds support for the following JDK methods:
76+
77+
* In `java.lang.CharSequence`:
78+
* `isEmpty`
79+
* In `java.lang.Math`:
80+
* `scalb`
81+
* In `java.util.regex.Matcher`:
82+
* `appendReplacement` and `appendTail` with a `StringBuilder` argument.
83+
* `replaceFirst` and `replaceAll` with a `replacer: Function` argument.
84+
* In `java.lang.IndexOutOfBoundsException`:
85+
* constructors with an `index` argument (`Int` or `Long`).
86+
87+
## Bug fixes
88+
89+
The following bugs have been fixed in 1.20.2:
90+
91+
* [#5287](https://github.com/scala-js/scala-js/issues/5287) `MatchError.getMessage()` requires `getClass()`, which JS classes do not provide.
92+
* [#5246](https://github.com/scala-js/scala-js/issues/5246) Optimizer crash with Labeled+Return of inline class, discarded in statement position.
93+
* [#5180](https://github.com/scala-js/scala-js/issues/5180) Rare `AssertionError` when linking a corrupted codebase with a cyclic inheritance chain.
94+
95+
You can find the full list [on GitHub](https://github.com/scala-js/scala-js/issues?q=is%3Aissue+milestone%3Av1.20.2+is%3Aclosed).

doc/all-api.md

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

66
## All previous versions of the API
77

8+
### Scala.js 1.20.2
9+
* [1.20.2 scalajs-library]({{ site.production_url }}/api/scalajs-library/1.20.2/scala/scalajs/js/index.html)
10+
* [1.20.2 scalajs-test-interface]({{ site.production_url }}/api/scalajs-test-interface/1.20.2/)
11+
* [1.20.2 scalajs-javalib-intf]({{ site.production_url }}/api/scalajs-javalib-intf/1.20.2/)
12+
* [1.20.2 scalajs-ir]({{ site.production_url }}/api/scalajs-ir/1.20.2/org/scalajs/ir/index.html)
13+
* [1.20.2 scalajs-linker-interface]({{ site.production_url }}/api/scalajs-linker-interface/1.20.2/org/scalajs/linker/interface/index.html) ([Scala.js version]({{ site.production_url }}/api/scalajs-linker-interface-js/1.20.2/org/scalajs/linker/interface/index.html))
14+
* [1.20.2 scalajs-linker]({{ site.production_url }}/api/scalajs-linker/1.20.2/org/scalajs/linker/index.html) ([Scala.js version]({{ site.production_url }}/api/scalajs-linker-js/1.20.2/org/scalajs/linker/index.html))
15+
* [1.20.2 scalajs-test-adapter]({{ site.production_url }}/api/scalajs-sbt-test-adapter/1.20.2/org/scalajs/testing/adapter/index.html)
16+
* [1.20.2 sbt-scalajs]({{ site.production_url }}/api/sbt-scalajs/1.20.2/#org.scalajs.sbtplugin.package)
17+
818
### Scala.js 1.20.1
919
* [1.20.1 scalajs-library]({{ site.production_url }}/api/scalajs-library/1.20.1/scala/scalajs/js/index.html)
1020
* [1.20.1 scalajs-test-interface]({{ site.production_url }}/api/scalajs-test-interface/1.20.1/)

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.20.2](/news/2026/01/05/announcing-scalajs-1.20.2/)
89
- [1.20.1](/news/2025/09/06/announcing-scalajs-1.20.1/)
910
- ~~1.20.0~~ ([severely broken](https://github.com/scala-js/scala-js/issues/5231) and therefore never announced)
1011
- [1.19.0](/news/2025/04/21/announcing-scalajs-1.19.0/)

0 commit comments

Comments
 (0)