question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Scala.js 1.1.0

See original GitHub issue

Bloop is currently able to compile and link Scala.js 0.6.x and 1.0.x, but not 1.1.0. It fails with the following error:

> bloop compile root
> bloop link root
[E] Expected compatible Scala.js version [0.6, 1.0], 1.1.0 given

Based on the release notes of 1.1.0, I think Scala.js 1.1.0 could largely reuse the Scala.js 1.0 bridge.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
sjrdcommented, Jun 17, 2020

At least it won’t break anything that is not already broken today.

But the way bloop handles its dependency on the Scala.js linker has serious flaws already now:

  • It should not depend statically on a version of scalajs-linker. It can statically depend on a version of scalajs-linker-interface, but should load the correct scalajs-linker depending on the scalaJSVersion used by the project. Problems with the current scheme include:
    • issues like this one will keep popping up every time there is a new version of Scala.js
    • if the project uses an older version of Scala.js, the linker used by bloop will be different than the one used by sbt/Maven/the original build tool, resulting in different produced .js files depending on whether bloop is used or not
  • It should not outsmart the build tool’s actual config of scalaJSLinkerConfig and scalaJSModuleInitializers, instead it should just take the value of those two settings from the build and roll with those. bloop currently reconstructs its own StandardConfig and Seq[ModuleInitializer] based on some arbitrary config that is specific to bloop, and is not in sync with what the original build tool does. Problems with the current scheme include:
    • #1304 Builds without a main class, but it generalizes to builds with arbitrary scalaJSModuleInitializers
    • #1309 and #715 mishandling of module kinds (including currently no support for ES modules at all)
    • any other configuration of scalaJSLinkerConfig done in users’ builds and that is not handled by bloop

In general, a Scala.js codebase is entirely defined by (per sbt triple Project / Configuration / (fastOptJS and fullOptJS)):

  • the fullClasspath
  • the value of scalaJSLinkerConfig and scalaJSModuleInitializers
  • the scalaJSVersion, which determines the version of scalajs-linker

These are the specific things that bloop should take from the build tool. It should not try to reconstruct scalaJSLinkerConfig, scalaJSModuleInitiliazers and scalaJSVersion other than through those specific values in the build tool.

0reactions
tgodzikcommented, Jan 26, 2021

@lolgab let’s maybe open another issue and point to this one? Do you know the details enough to create an issue with description?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing Scala.js 1.1.0
May 18, 2020. We are pleased to announce the release of Scala.js 1.1.0! The highlight of this release is the new support for...
Read more >
Announcing Scala.js 1.1.0 - Announce - Scala Users
Hello everyone, We are pleased to announce the release of Scala.js 1.1.0! The highlight of this release is the new support for @js.native...
Read more >
Application bootstrapping - Udash Framework
Developer's Guide to Udash - a Scala and Scala.js reactive web framework for ... structure for IntelliJ in order to better support ScalaJS...
Read more >
Release Notes · Airframe - wvlet.github.io
From this version, AirSpec testing library supports Scala 3 + Scala.js! ... Update scala-js-macrotask-executor to 1.1.0 (#2283) [e9788aec7] ...
Read more >
Using Scala.js With NPM And Browserify - Toptal
SBT already supports NPM. The sbt-web plugin, developed for the Play Framework, can install NPM dependencies. SBT supports execution of JavaScript. You can ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found