-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala.js: Default to ECMAScript 2015 #1665
Comments
Can you provide a link to that claim? I only found this:
from https://www.scala-js.org/doc/project/module.html, 2022-01-11 |
@lefou |
Yeah. Makes sense. We might infer the default from the selected ScalaJS version then? If that is not possible, we might better provide no default at all. |
Fair challenge, all I can only offer is that Scala.js's author suggested I raise this issue (to be fair he says for 1.x and above), which I realise is an appeal to authority but... I discovered this was a problem for me when I noticed that code compiled in sbt was working as expected, but identical code compiled through Mill resulted in runtime errors. Currently all you've got is a boolean flag, so being consistent with sbt is easy enough, just set it to true as in the PR - however that is a bit of a magic value. Inferring the right version based on Scala.js version will be a marginally more involved change, but I'd also be ok with it being a setting the user had to provide to avoid ambiguity. |
I think that for now we can change the default as you did. In the future we could change mill to have |
Why? We can just depend on
We should do this now. The change is simple and we are still before a 0.10 release, so for adding and deprecating API this is the best time. |
The official default for Scala.js is ECMAScript 2015, but Mill currently defaults to ES 5.1, here:
https://github.com/com-lihaoyi/mill/blob/main/scalajslib/src/ScalaJSModule.scala#L200
Mill should default to ES 2015 instead. The workaround is to add this line to your
build.sc
file:The text was updated successfully, but these errors were encountered: