Announcing Scala.js 1.4.0

Hello everyone,

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

This release complements the module splitting support, introduced in Scala.js 1.3.0, with support for dynamic module loading. It is now possible to structure an application such that specific features are only loaded if necessary, the first time they are used.

In addition, this release significantly improves the performance of scala.Array. In particular, arrays of numeric types (except Longs) are implemented with JavaScript typed arrays under the hood.

This release also contains a number of bug fixes. The version of the Scala standard library for 2.13.x was upgraded to 2.13.4.

Read the announcement on the Web for more details:

4 Likes

I’ve not used Scala.js outside of a couple “hello world” tutorials, nor am I super up to date on the state of the modern JS ecosystem in general, but the dynamic module loading thing seems pretty neat.

At least, I see a lot of sturm und drang online around people wrestling with this feature in the “mainstream” JS ecosystem. Does anyone know of a good writeup for how Scala.js’ implementation of this feature compares with what’s available in Webpack et. al?

There is some interesting discussion in some of the related github issues: https://github.com/scala-js/scala-js/issues/4201.

Anyway, very impressive to see all the progress this project is making. Hope to have a good case to use it more heavily at some point.

1 Like

I don’t think anyone has written up anything yet.AFAICT, in Webpack, dynamic module loading needs the developer to set up separate .js files, configure them in the build as entry points, and properly use import() calls with string arguments to reference the other .js files. And if you want to extract common code in shared modules, you have to enable an additional plugin for that. The way we’ve done it in Scala.js, all that setup and wiring is done automatically for you, by default. Plus, everything’s type safe. :wink:

2 Likes