From 828122958717f14d0b24ede1fe6087c3e58e7bd7 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 14 Jul 2021 11:14:31 +0000 Subject: [PATCH 1/7] Upgrade sbt and change the syntax Co-authored-by: Russ White --- build.sbt | 6 +++--- project/build.properties | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 371ebc4c8..885c04a96 100644 --- a/build.sbt +++ b/build.sbt @@ -5,11 +5,11 @@ lazy val root = project.in(file(".")). name := "Scala.js DOM" -crossScalaVersions in ThisBuild := { +ThisBuild / crossScalaVersions := { if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1") else Seq("2.12.10", "2.11.12", "2.10.7", "2.13.1") } -scalaVersion in ThisBuild := crossScalaVersions.value.head +ThisBuild / scalaVersion := crossScalaVersions.value.head val commonSettings = Seq( version := "1.2.0-SNAPSHOT", @@ -104,7 +104,7 @@ lazy val readme = ScalatexReadme( ).settings( scalaVersion := "2.12.10", scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"), - (resources in Compile) += (fullOptJS in (example, Compile)).value.data + (Compile / resources) += (example / Compile / fullOptJS).value.data ) lazy val example = project. diff --git a/project/build.properties b/project/build.properties index c0bab0494..10fd9eee0 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 +sbt.version=1.5.5 From 28192a4d895a801d41960e4a755f0584d5fb66e0 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 14 Jul 2021 11:39:11 +0000 Subject: [PATCH 2/7] Upgrade Scala.js to 1.5.0 Co-authored-by: Russ White --- project/build.sbt | 2 +- src/main/scala/org/scalajs/dom/crypto/Crypto.scala | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/project/build.sbt b/project/build.sbt index bc96d108b..91d1d968a 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -1,5 +1,5 @@ val scalaJSVersion = - Option(System.getenv("SCALAJS_VERSION")).filter(_ != "").getOrElse("1.0.0") + Option(System.getenv("SCALAJS_VERSION")).filter(_ != "").getOrElse("1.5.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) diff --git a/src/main/scala/org/scalajs/dom/crypto/Crypto.scala b/src/main/scala/org/scalajs/dom/crypto/Crypto.scala index e411dfc51..b3732ebc1 100644 --- a/src/main/scala/org/scalajs/dom/crypto/Crypto.scala +++ b/src/main/scala/org/scalajs/dom/crypto/Crypto.scala @@ -930,10 +930,8 @@ object KeyFormat { trait RSAPublicKey extends js.Object { /* modulus, as a base64 URL encoded String */ - @js.native def n: String = js.native /* exponent, as a base64 URL encoded String */ - @js.native def e: String = js.native } From 7788a041e7594ff4469316c9a7d7dcfc151766eb Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 14 Jul 2021 11:46:20 +0000 Subject: [PATCH 3/7] Add support for Scala 3 Co-authored-by: Russ White --- .github/workflows/ci.yml | 2 + build.sbt | 2 +- .../scalajs/dom/experimental/intl/Intl.scala | 58 +++++++++---------- .../scala/org/scalajs/dom/ext/package.scala | 13 +++-- 4 files changed, 40 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dfa54c7f..7668d23db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ jobs: include: - scalaversion: "2.10.7" scalajsversion: "0.6.x" + - scalaversion: "3.0.1" + scalajsversion: "1.x" env: SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}" steps: diff --git a/build.sbt b/build.sbt index 885c04a96..5fe801501 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ lazy val root = project.in(file(".")). name := "Scala.js DOM" ThisBuild / crossScalaVersions := { - if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1") + if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1", "3.0.1") else Seq("2.12.10", "2.11.12", "2.10.7", "2.13.1") } ThisBuild / scalaVersion := crossScalaVersions.value.head diff --git a/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala b/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala index e80f410c8..f0c99b381 100644 --- a/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala +++ b/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala @@ -123,12 +123,12 @@ object CollatorOptions { ): CollatorOptions = { js.Dynamic .literal( - localeMatcher = localeMatcher, - usage = usage, - sensitivity = sensitivity, - ignorePunctuation = ignorePunctuation, - numeric = numeric, - caseFirst = caseFirst + localeMatcher = localeMatcher.asInstanceOf[js.Any], + usage = usage.asInstanceOf[js.Any], + sensitivity = sensitivity.asInstanceOf[js.Any], + ignorePunctuation = ignorePunctuation.asInstanceOf[js.Any], + numeric = numeric.asInstanceOf[js.Any], + caseFirst = caseFirst.asInstanceOf[js.Any] ) .asInstanceOf[CollatorOptions] } @@ -200,19 +200,19 @@ object DateTimeFormatOptions { // format: off js.Dynamic .literal( - localeMatcher = localeMatcher, - timeZone = timeZone, - hour12 = hour12, - formatMatcher = formatMatcher, - weekday = weekday, - era = era, - year = year, - month = month, - day = day, - hour = hour, - minute = minute, - second = second, - timeZoneName = timeZoneName + localeMatcher = localeMatcher.asInstanceOf[js.Any], + timeZone = timeZone.asInstanceOf[js.Any], + hour12 = hour12.asInstanceOf[js.Any], + formatMatcher = formatMatcher.asInstanceOf[js.Any], + weekday = weekday.asInstanceOf[js.Any], + era = era.asInstanceOf[js.Any], + year = year.asInstanceOf[js.Any], + month = month.asInstanceOf[js.Any], + day = day.asInstanceOf[js.Any], + hour = hour.asInstanceOf[js.Any], + minute = minute.asInstanceOf[js.Any], + second = second.asInstanceOf[js.Any], + timeZoneName = timeZoneName.asInstanceOf[js.Any] ) .asInstanceOf[DateTimeFormatOptions] // format: on @@ -300,16 +300,16 @@ object NumberFormatOptions { ): NumberFormatOptions = { js.Dynamic .literal( - localeMatcher = localeMatcher, - style = style, - currency = currency, - currencyDisplay = currencyDisplay, - useGrouping = useGrouping, - minimumIntegerDigits = minimumIntegerDigits, - minimumFractionDigits = minimumFractionDigits, - maximumFractionDigits = maximumFractionDigits, - minimumSignificantDigits = minimumSignificantDigits, - maximumSignificantDigits = maximumSignificantDigits + localeMatcher = localeMatcher.asInstanceOf[js.Any], + style = style.asInstanceOf[js.Any], + currency = currency.asInstanceOf[js.Any], + currencyDisplay = currencyDisplay.asInstanceOf[js.Any], + useGrouping = useGrouping.asInstanceOf[js.Any], + minimumIntegerDigits = minimumIntegerDigits.asInstanceOf[js.Any], + minimumFractionDigits = minimumFractionDigits.asInstanceOf[js.Any], + maximumFractionDigits = maximumFractionDigits.asInstanceOf[js.Any], + minimumSignificantDigits = minimumSignificantDigits.asInstanceOf[js.Any], + maximumSignificantDigits = maximumSignificantDigits.asInstanceOf[js.Any] ) .asInstanceOf[NumberFormatOptions] } diff --git a/src/main/scala/org/scalajs/dom/ext/package.scala b/src/main/scala/org/scalajs/dom/ext/package.scala index 90e848b21..19e5aebff 100644 --- a/src/main/scala/org/scalajs/dom/ext/package.scala +++ b/src/main/scala/org/scalajs/dom/ext/package.scala @@ -22,17 +22,20 @@ package object ext { def cast[T] = x.asInstanceOf[T] } - implicit def pimpAnimatedNumber(x: svg.AnimatedNumber) = x.baseVal + implicit def pimpAnimatedNumber(x: svg.AnimatedNumber): Double = x.baseVal - implicit def pimpRichAnimatedNumber(x: svg.AnimatedNumber) = + implicit def pimpRichAnimatedNumber( + x: svg.AnimatedNumber): runtime.RichDouble = x.baseVal: runtime.RichDouble - implicit def pimpAnimatedLength(x: svg.AnimatedLength) = x.baseVal.value + implicit def pimpAnimatedLength(x: svg.AnimatedLength): Double = + x.baseVal.value - implicit def pimpRichAnimatedLength(x: svg.AnimatedLength) = + implicit def pimpRichAnimatedLength( + x: svg.AnimatedLength): runtime.RichDouble = x.baseVal.value: runtime.RichDouble - implicit def color2String(c: Color) = c.toString + implicit def color2String(c: Color): String = c.toString implicit class pimpedContext(val ctx: CanvasRenderingContext2D) { def prepCircle(x: Double, y: Double, r: Double) = { ctx.beginPath() From 5f16c02cb35f270e7225c6be47347431c4d9dbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Wed, 14 Jul 2021 16:56:08 +0200 Subject: [PATCH 4/7] Bump to 2.0.0-SNAPSHOT. So that we can release v2.0.0 with the Scala 3 artifact. Fixes #451. --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 5fe801501..fee60ffa2 100644 --- a/build.sbt +++ b/build.sbt @@ -12,7 +12,7 @@ ThisBuild / crossScalaVersions := { ThisBuild / scalaVersion := crossScalaVersions.value.head val commonSettings = Seq( - version := "1.2.0-SNAPSHOT", + version := "2.0.0-SNAPSHOT", organization := "org.scala-js", scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings") ) From c61b7ec258f209c674be8b2bdb139d3c130421c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Wed, 4 Aug 2021 10:11:22 +0200 Subject: [PATCH 5/7] Drop support for Scala.js 0.6.x. And therefore for Scala 2.10.x. --- .github/workflows/ci.yml | 10 +--------- build.sbt | 6 +----- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7668d23db..c81d9d976 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,15 +12,7 @@ jobs: strategy: fail-fast: false matrix: - scalaversion: ["2.11.12", "2.12.10", "2.13.1"] - scalajsversion: ["1.x", "0.6.x"] - include: - - scalaversion: "2.10.7" - scalajsversion: "0.6.x" - - scalaversion: "3.0.1" - scalajsversion: "1.x" - env: - SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}" + scalaversion: ["2.11.12", "2.12.10", "2.13.1", "3.0.1"] steps: - uses: actions/checkout@v2 - uses: olafurpg/setup-scala@v10 diff --git a/build.sbt b/build.sbt index fee60ffa2..e2dc6c782 100644 --- a/build.sbt +++ b/build.sbt @@ -5,10 +5,7 @@ lazy val root = project.in(file(".")). name := "Scala.js DOM" -ThisBuild / crossScalaVersions := { - if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1", "3.0.1") - else Seq("2.12.10", "2.11.12", "2.10.7", "2.13.1") -} +ThisBuild / crossScalaVersions := Seq("2.12.10", "2.11.12", "2.13.1", "3.0.1") ThisBuild / scalaVersion := crossScalaVersions.value.head val commonSettings = Seq( @@ -36,7 +33,6 @@ scalacOptions ++= { } def hasNewCollections(version: String): Boolean = { - !version.startsWith("2.10.") && !version.startsWith("2.11.") && !version.startsWith("2.12.") } From 3bd1320abd50d3dac63b15bc03c46cff2263795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Wed, 4 Aug 2021 10:17:31 +0200 Subject: [PATCH 6/7] Upgrade to Scala 2.12.12 and 2.13.4. Those are the reference versions for Scala.js 1.5.0, which we use, so they make the most sense. See https://github.com/scala-js/scala-js/blob/v1.5.0/project/MultiScalaProject.scala#L80-L84 --- .github/workflows/ci.yml | 2 +- build.sbt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c81d9d976..be20134b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - scalaversion: ["2.11.12", "2.12.10", "2.13.1", "3.0.1"] + scalaversion: ["2.11.12", "2.12.12", "2.13.4", "3.0.1"] steps: - uses: actions/checkout@v2 - uses: olafurpg/setup-scala@v10 diff --git a/build.sbt b/build.sbt index e2dc6c782..d6a4cc3a6 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,7 @@ lazy val root = project.in(file(".")). name := "Scala.js DOM" -ThisBuild / crossScalaVersions := Seq("2.12.10", "2.11.12", "2.13.1", "3.0.1") +ThisBuild / crossScalaVersions := Seq("2.12.12", "2.11.12", "2.13.4", "3.0.1") ThisBuild / scalaVersion := crossScalaVersions.value.head val commonSettings = Seq( From 2d16b7977b8aaad014ffa4cc495a8913773cba64 Mon Sep 17 00:00:00 2001 From: Nikita Gazarov Date: Tue, 29 Dec 2020 23:34:09 -0800 Subject: [PATCH 7/7] Fix XMLHttpRequest.onerror param type https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/error_event --- src/main/scala/org/scalajs/dom/raw/lib.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/org/scalajs/dom/raw/lib.scala b/src/main/scala/org/scalajs/dom/raw/lib.scala index 77a6c1785..dbbbf89ff 100644 --- a/src/main/scala/org/scalajs/dom/raw/lib.scala +++ b/src/main/scala/org/scalajs/dom/raw/lib.scala @@ -4181,7 +4181,7 @@ class XMLHttpRequest extends EventTarget { * MDN */ var upload: XMLHttpRequestEventTarget = js.native - var onerror: js.Function1[ErrorEvent, _] = js.native + var onerror: js.Function1[ProgressEvent, _] = js.native var onloadstart: js.Function1[js.Any, _] = js.native }