Repository navigation
Allow users to fully customize Scala.js linker config via a new module - #6872
Merged
alexarchambault merged 3 commits intoFeb 23, 2026
Merged
Conversation
alexarchambault
marked this pull request as ready for review
February 23, 2026 17:19
lihaoyi
approved these changes
Feb 23, 2026
lihaoyi
pushed a commit
that referenced
this pull request
Mar 5, 2026
…dule, and add tests for it (#6902) This cleans-up / clarifies the handling of full optimized Scala.js linking in the newly added `ScalaJSConfigModule` (added in #6872). Full optimized linking is "just" a matter of setting the right properties in the linker config. So instead of passing around an `isFullLinkJS` flag alongside a linking config, we now just let users make the config fully optimized, and only pass the config around. The added tests check that fully optimized linking is taken into account in `run` and `testForked`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new
mill-libs-scalajslib-configmodule, that provides a newScalaJSConfigModule, that users can use instead ofScalaJSModule.ScalaJSConfigModuleallows users to adjust the Scala.js linker configuration using the Scala.js linker's own API, rather than Mill's redefinition of it, that lags behind and is lacking compared to the original one.The
ScalaJSConfigModulescaladoc explains how this module should be used. Basically, users need to addmill-libs-scalajslib-configin their build via the meta-build, alongside the versions they need of the Scala.js linker and js-deps modules. LikeThe corresponding linker API can then be used to customize the linker configuration:
In more detail, bits of the current worker module were moved to the new config module (mainly code going from Mill's Scala.js linker params to actual Scala.js linker API stuff). The worker depends on the config module, in order to keep using the code that was moved.
If they feel like it, users can add the new config module in their build, alongside the linker and js-deps Scala.js modules. This somehow pre-loads parts of the worker class path in the main build. Later on, when the worker class path is loaded, parts of it (config and the mentioned Scala.js modules) are simply already around, and not isolated.
A drawback is that this prevents using any other Scala.js version in builds that do this: given some Scala.js JARs are already in the main build class path, they would clash with any other Scala.js version JARs loaded for the worker. But this limitation only applies to users that pre-load these modules, not users of the current
ScalaJSModule.