Skip to content

v1.2.0.

Compare
Choose a tag to compare
@vmunier vmunier released this 27 Apr 21:45
· 16 commits to master since this release

Highlights

Breaking changes

There are two breaking changes when upgrading from sbt-web-scalajs v1.1.0 to v1.2.0:

  • Use fastLinkJS/fullLinkJS instead of fastOptJS/fullOptS

    sbt-web-scalajs is now using fastLinkJS/fullLinkJS instead of fastOptJS/fullOptS.

    The new Scala.js' fastLinkJS task writes the JavaScript code to a directory. With the default options, it writes a single file main.js. Let's say we have a client Scala.js project, fastLinkJS writes a single file main.js to a client-fastopt directory (client-fastopt/main.js). Previous versions of sbt-web-scalajs used fastOptJS, which wrote a client-fastopt.js file with no directories.

    This means we need to update the HTTP path when getting the JavaScript files from the server. Where previously we requested GET /assets/client-fastopt.js, we now have to request GET /assets/client-fastopt/main.js.

    Have a look at the following git diff, showing the required changes when upgrading from sbt-web-scalajs v1.1.0 to v1.2.0, for:

    In the above diffs, we removed the scalajs-scripts dependency and added a findScript.scala.html template instead.
    findScript("client-opt/main.js", "client-fastopt/main.js") finds the first existing script and creates a <script> tag.

  • Remove the sbt-jsdependencies plugin

    The sbt-jsdependencies plugin has been removed from sbt-web-scalajs. Users can still add the plugin as part of their build if needed, and override the jsMappings task:

    Compile / fastLinkJS / jsMappings += toPathMapping((Compile / packageJSDependencies).value),
    Compile / fullLinkJS / jsMappings += toPathMapping((Compile / packageMinifiedJSDependencies).value),
    ...
    def toPathMapping(f: File): (File, String) = f -> f.getName
    

Issues