Skip to content

Commit

Permalink
Merge pull request #576 from armanbilge/update/sjs-dom-2.0.0-take2
Browse files Browse the repository at this point in the history
Update to scala-js-dom 2.0.0, take 2
  • Loading branch information
olafurpg authored Nov 2, 2021
2 parents 791a78a + d4d1d27 commit e98df16
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def allScalaVersions = scala2Versions :+ scala3

def scalajs = "1.7.1"
def scalajsBinaryVersion = "1"
def scalajsDom = "1.1.0"
def scalajsDom = "2.0.0"

def isScala2(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2)
def isScala212(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 12)
Expand Down Expand Up @@ -278,7 +278,7 @@ val jsdocs = project
_.withModuleKind(ModuleKind.CommonJSModule)
},
libraryDependencies ++= List(
"org.scala-js" %%% "scalajs-dom" % scalajsDom cross CrossVersion.for3Use2_13
"org.scala-js" %%% "scalajs-dom" % scalajsDom
),
scalaJSUseMainModuleInitializer := true,
Compile / npmDependencies ++= List(
Expand Down
2 changes: 1 addition & 1 deletion mdoc-js/src/main/scala/mdoc/modifiers/JsModifier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class JsModifier extends mdoc.PreModifier {
new CodeBuilder()
.println(s"""@_root_.scala.scalajs.js.annotation.JSExportTopLevel("$jsId") """)
.println(
s"""def $run($mountNodeParam: _root_.org.scalajs.dom.raw.HTMLElement): Unit = {"""
s"""def $run($mountNodeParam: _root_.org.scalajs.dom.html.Element): Unit = {"""
)
.println(input.text)
.println("}")
Expand Down
7 changes: 1 addition & 6 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/basic/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ println("Hello Scala.js!")

lazy val jsapp = project
.settings(
libraryDependencies += {
if (scalaVersion.value.startsWith("3"))
"org.scala-js" %%% "scalajs-dom" % "1.1.0" cross CrossVersion.for3Use2_13
else
"org.scala-js" %%% "scalajs-dom" % "1.1.0"
}
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.0.0"
)
.enablePlugins(ScalaJSPlugin)
6 changes: 3 additions & 3 deletions tests/unit-js/src/test/scala/tests/js/JsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class JsSuite extends BaseMarkdownSuite {
"onclick",
"""
|```scala mdoc:js
|import org.scalajs.dom.raw.MouseEvent
|import org.scalajs.dom.MouseEvent
|node.onclick = {(_: MouseEvent) => println(42)}
|```
""".stripMargin
Expand All @@ -283,7 +283,7 @@ class JsSuite extends BaseMarkdownSuite {
|```
""".stripMargin,
"""|error: no-dom.md:4 (mdoc generated code) object scalajs is not a member of package org
|def run0(node: _root_.org.scalajs.dom.raw.HTMLElement): Unit = {
|def run0(node: _root_.org.scalajs.dom.html.Element): Unit = {
| ^
""".stripMargin,
settings = {
Expand All @@ -299,7 +299,7 @@ class JsSuite extends BaseMarkdownSuite {
|error:
|no-dom.md:3 (mdoc generated code)
| value scalajs is not a member of org
|def run0(node: _root_.org.scalajs.dom.raw.HTMLElement): Unit = {
|def run0(node: _root_.org.scalajs.dom.html.Element): Unit = {
""".stripMargin
)
)
Expand Down

0 comments on commit e98df16

Please sign in to comment.