-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Support ESFeatures in Scala.js #1671
Support ESFeatures in Scala.js #1671
Conversation
ab8be79
to
3b86356
Compare
@lolgab You may want to look into mill/scalalib/src/JavaModule.scala Line 274 in f0358b9
Once we know we have an overridden deprecated target, we can issue a warning message and also use the value to derive the new target, otherwise we can just go with our defaults. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
ScalaJSModule
currently supports theuseECMAScript2015
settings.Nowadays Scala.js offers support for multiple
ESVersion
.In the official Sbt plugin they are set inside an object called
ESFeatures
that contains other settings.This PR tries to mimic the Scala.js API.
It is a breaking change, since overriding the old
useECMAScript2015
doesn't have any effect anymore.How deprecate overriding
useECMAScript2015
Since we can't derive
ESFeatures
fromuseECMAScript2015
, I can't use the same deprecation mechanism astestFrameworks
. What I did instead is to define a private booleanvar
in ScalaJSModule calledoverriddenUseECMAScript2015
that is first set totrue
. It is then set tofalse
by the default implementation ofuseECMAScript2015
which calls back the newesFeatures
. BeforefastOpt
andfullOpt
I call a privatecheckDeprecations
task, which callsuseECMAScript2015()
and then checks theoverriddenUseECMAScript2015
. If it was overridden then the value remainstrue
and it fails the task with an error message; otherwise it findsfalse
and continues with the build.