-
Notifications
You must be signed in to change notification settings - Fork 81
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 3 JS modifier #504
Scala 3 JS modifier #504
Conversation
scalaJSLinkerConfig ~= { | ||
_.withModuleKind(ModuleKind.CommonJSModule) | ||
}, | ||
libraryDependencies ++= List( | ||
"org.scala-js" %%% "scalajs-dom" % scalajsDom | ||
"org.scala-js" %%% "scalajs-dom" % scalajsDom cross CrossVersion.for3Use2_13 |
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.
DOM library won't be published for Scala 3.
@@ -409,7 +406,9 @@ lazy val js = project | |||
"org.scala-js" % "scalajs-compiler" % scalajs cross CrossVersion.full, | |||
"org.scala-js" %% "scalajs-linker" % scalajs | |||
), | |||
if3 = List() | |||
if3 = List( | |||
"org.scala-js" %% "scalajs-linker" % scalajs cross CrossVersion.for3Use2_13 |
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.
After we obtain sjsir files, it doesn't matter which linker we use.
compat = Map( | ||
"3.0" -> | ||
""" | ||
|-error: compile-only-error.md:3:17: |
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.
Hmm. This is not right.
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.
Right. Seems like it's because the scala binary version has changed for 3.0.0 stable - so our tests aren't actually verifying Scala 3 assertions :-/
assertNoDiff( | ||
Compat(obtainedErrors, compat, postProcessObtained), | ||
Compat(obtainedErrors, Map.empty, postProcessObtained), |
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.
I looked at this and couldn't quite understand - my thinking is that we don't want to apply compat layers to obtained output, otherwise it resolves to the expectation itself and the test trivially passes (which was the reason that before some of the tests for errors were not doing anything)
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.
Looks amazing! I asked two smaller questions, but this is nothing blocking.
Closes #500
Enable JS modifier for Scala 3
What helps here is that mdoc SBT plugin already collects all of the info that ScalaJS needs - Scala.js' own SBT plugin configures the scalacOptions and libraryDependencies depending on Scala version: #504
Which means that it's mostly a game of jenga to arrange the types + fixing a bug in
compileSources
to reset the context correctly.Fix compat messages in tests
checkError
we were applying compat to both the obtained errors and expectations - which means with overrides those were always passing.