sbt-play-scalajs v1.1.0 Release Notes

Release Date: 2020-06-01 // 4 months ago
  • Highlights

    • Look up the scalaJSStage setting from the Scala.js projects to know whether to run fastOptJS or fullOptJS.
    • 0️⃣ Follow Scala.js' defaults, which enable Source Maps for both fastOptJS and fullOptJS.
    • Put the ScalaJSWeb's sourceMappings setting in fastOptJS/fullOptJS scopes.
    • ⬆️ Upgrade to Scala.js v1.1.0.
    • Published for Scala.js v1.1.x.

    💥 Breaking changes

    ⬆️ There are two breaking changes when upgrading from sbt-web-scalajs v1.0.x to v1.1.0:

    Set scalaJSStage to run fastOptJS or fullOptJS

    🔌 The plugin used to parse the SBT command line to know whether fastOptJS or fullOptJS should be run, which did not require any user interventions. However, parsing the command line has proven to be too fragile and sbt-web-scalajs failed to detect dev commands in certain scenarios.

    0️⃣ sbt-web-scalajs v1.1.0 no longer parses the command line, but simply looks up the Scala.js' scalaJSStage setting. sbt-web-scalajs runs fastOptJS when scalaJSStage equals to FastOptStage (default value) and runs fullOptJS when scalaJSStage equals to FullOptStage.

    🏗 This means that scalaJSStage needs to be set to FullOptStage in the Scala.js projects for which you wish fullOptJS to be run. As an example, the following command would set FullOptStage for all the Scala.js projects from the build and run fullOptJS before packaging your application:

    sbt 'set scalaJSStage in Global := FullOptStage' universal:packageBin
    

    0️⃣ Source Maps are enabled in fullOptJS by default

    0️⃣ By default, sbt-web-scalajs v1.0.x disabled Source Maps in fullOptJS.
    0️⃣ sbt-web-scalajs v1.1.0 now follows Scala.js' defaults, which enable Source Maps for both fastOptJS and fullOptJS.

    Source Maps can be disabled in fullOptJS by adding the following line to the Scala.js project's settings:

    scalaJSLinkerConfig in (Compile, fullOptJS) ~= (_.withSourceMap(false))
    

    Issues

    🛠 Fix issues related to the detection of dev commands. sbt-web-scalajs v1.1.0 now relies on scalaJSStage to know whether fastOptJS or fullOptJS should be run:

    • 🛠 Fixes #52
    • 🛠 Fixes #46
    • 🛠 Fixes #40

Previous changes from v1.0.11

    • Published for Scala.js v1.0.0-RC2.