Skip to content

Announcing Scala.js 1.21.0. - #672

Merged
sjrd merged 1 commit into
scala-js:mainfrom
sjrd:scalajs-1.21.0
Apr 4, 2026
Merged

Announcing Scala.js 1.21.0.#672
sjrd merged 1 commit into
scala-js:mainfrom
sjrd:scalajs-1.21.0

Conversation

@sjrd

@sjrd sjrd commented Mar 30, 2026

Copy link
Copy Markdown
Member

No description provided.

@gzm0 gzm0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've done a quick first pass for content (not wording yet).

I think this is enough to iterate, so I'm releasing.

Comment thread doc/internals/version-history.md Outdated
Comment thread _posts/news/2026-04-04-announcing-scalajs-1.21.0.md
Comment thread _posts/news/2026-04-04-announcing-scalajs-1.21.0.md
Comment thread _posts/news/2026-04-04-announcing-scalajs-1.21.0.md
@sjrd

sjrd commented Apr 3, 2026

Copy link
Copy Markdown
Member Author

Ping @gzm0 ?

@gzm0 gzm0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry this took a while. My week was a bit full :-/

In particular, it deprecates JDK < 17 and support for the Google Closure Compiler (GCC).
GCC is now disabled by default in all configurations.

It also comes with performance improvements and bug fixes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
It also comes with performance improvements and bug fixes.
This release also comes with performance improvements and bug fixes.

Otherwise "it" might be mistaken to refer to GCC.

The [Scala.js semantics]({{ BASE_PATH }}/doc/semantics.html) defines several exceptions are being subject to Undefined Behavior.
These include `NullPointerException`, `StringIndexOutOfBoundsException` and `NegativeArraySizeException`.

In `fastLinkJS`, they are configure in "Fatal" mode by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
In `fastLinkJS`, they are configure in "Fatal" mode by default.
In `fastLinkJS`, they are configured in "Fatal" mode by default.

After [a request for comment](https://github.com/scala-js/scala-js/issues/5244), we have decided to disable the Google Closure Compiler (GCC) by default in all configurations, and deprecate it.
It was already disabled by default when emitting ECMAScript modules, since it never supported them the way we need.

If you are not emitting ES modules, this release will cause an increase on code size in `fullLinkJS`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you are not emitting ES modules, this release will cause an increase on code size in `fullLinkJS`.
If you are not emitting ES modules, this release will cause an increase in code size in `fullLinkJS`.


If you are not emitting ES modules, this release will cause an increase on code size in `fullLinkJS`.
We encourage you to follow the Scala.js `fullLinkJS` task with a JavaScript minifier.
If you use [Vite](https://vite.dev/), in particular, it applies Rollup by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you use [Vite](https://vite.dev/), in particular, it applies Rollup by default.
If you use [Vite](https://vite.dev/), in particular, it applies Rolldown by default.

IDK if it matters. Vite 8 changed to Rolldown 🤷

It is only true if the target platform supports Typed Arrays to begin with.

We unfortunately caught this documentation issue too late in the release process to update the Scaladoc.
We will update it for the next version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
We will update it for the next version.
We will update it for the next version.
In the meantime, you can find the updated documentation on [#5344](https://github.com/scala-js/scala-js/pull/5344).

We made this change as a preparation for targeting WebAssembly environments without a JS host.

As a consequence, the documentation of [`TypedArrayBufferOps.hasTypedArray()`](https://javadoc.io/static/org.scala-js/scalajs-library_2.12/1.21.0/scala/scalajs/js/typedarray/TypedArrayBufferOps.html#hasTypedArray():Boolean) is no longer accurate.
It is only true if the target platform supports Typed Arrays to begin with.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
It is only true if the target platform supports Typed Arrays to begin with.
As a consequence, the contract of [`TypedArrayBufferOps.hasArrayBuffer()`](https://javadoc.io/static/org.scala-js/scalajs-library_2.12/1.21.0/scala/scalajs/js/typedarray/TypedArrayBufferOps.html#hasArrayBuffer():Boolean) and [`TypedArrayBufferOps.hasTypedArray()`](https://javadoc.io/static/org.scala-js/scalajs-library_2.12/1.21.0/scala/scalajs/js/typedarray/TypedArrayBufferOps.html#hasTypedArray():Boolean) is changing in a not strictly backwards compatible manner:
The following code may now throw an `UnsupportedOperationException` depending on the specific target platform:
{% highlight scala %}
if (buffer.isDirect())
TypedArrayBuffer.arrayBuffer(buffer)
{% endhighlight %}
Instead of `isDirect()` use `hasArrayBuffer()`.

As a consequence, the documentation of [`TypedArrayBufferOps.hasTypedArray()`](https://javadoc.io/static/org.scala-js/scalajs-library_2.12/1.21.0/scala/scalajs/js/typedarray/TypedArrayBufferOps.html#hasTypedArray():Boolean) is no longer accurate.
It is only true if the target platform supports Typed Arrays to begin with.

We unfortunately caught this documentation issue too late in the release process to update the Scaladoc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
We unfortunately caught this documentation issue too late in the release process to update the Scaladoc.
We unfortunately caught this issue too late in the release process to update the Scaladoc.

@sjrd
sjrd force-pushed the scalajs-1.21.0 branch from 19a0edd to 0e68631 Compare April 4, 2026 11:48
@sjrd
sjrd merged commit bcc73d8 into scala-js:main Apr 4, 2026
1 check passed
@sjrd
sjrd deleted the scalajs-1.21.0 branch April 4, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants