Skip to content

v1.2.0

Compare
Choose a tag to compare
@Gedochao Gedochao released this 07 Mar 08:40
· 87 commits to main since this release
251223e

Scala 3.3.3, 3.4.0, 2.13.13 & 2.12.19 support

This version of Scala CLI adds support for a whooping 4 new Scala versions, it's been busy these past few days!
The default version used when using the CLI will from now on be the Scala 3 Next version (3.4.0 as of this release).
Using the lts tag will now point to Scala 3.3.3.
The LTS is also the version used for building the internals of Scala CLI (although we now also cross-compile with 3.4.0).

scala-cli version
# Scala CLI version: 1.2.0
# Scala version (default): 3.4.0

Added by @Gedochao in #2772, #2736, #2755, #2753 and #2752

Remapping EsModule imports at link time with Scala.js

Given the following importMap.json file:

{
  "imports": {
    "@stdlib/linspace": "https://cdn.skypack.dev/@stdlib/linspace"
  }
}

It is now possible to remap the imports at link time with the jsEsModuleImportMap directive.

//> using jsEsModuleImportMap importMap.json
//> using jsModuleKind es
//> using jsMode fastLinkJS
//> using platform js

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.typedarray.Float64Array

object Foo {
  def main(args: Array[String]): Unit = {
    println(Array(-10.0, 10.0, 10).mkString(", "))
    println(linspace(0, 10, 10).mkString(", "))
  }
}

@js.native
@JSImport("@stdlib/linspace", JSImport.Default)
object linspace extends js.Object {
  def apply(start: Double, stop: Double, num: Int): Float64Array = js.native
}

The same can be achieved with the --js-es-module-import-map command line option.

scala-cli --power package RemappingEsModuleImports.scala --js --js-module-kind ESModule -o main.js --js-es-module-import-map importMap.json

Added by @Quafadas in #2737 and VirtusLab/scala-js-cli#47

Fixes

Enhancements

  • Add the ability to remap EsModule imports at link time by @Quafadas in #2737

Internal changes

  • Fix overeager Scala version docs tests by @Gedochao in #2750
  • Lock script wrapper tests on the internally used Scala 2.13 version by @Gedochao in #2754
  • Use Scala LTS as the default version while cross compiling all Scala 3 modules on both LTS & Next by @Gedochao in #2752
  • Explicitly set sonatype publishing to use the default cross Scala version by @Gedochao in #2757
  • Fix publishing of artifacts to include non-cross-compiled modules by @Gedochao in #2759
  • Run integration tests with both Scala 3 LTS & Next versions by @Gedochao in #2760

Documentation changes

Updates and maintenance

New Contributors

Full Changelog: v1.1.3...v1.2.0