-
Notifications
You must be signed in to change notification settings - Fork 161
Support scala 3 #446
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 scala 3 #446
Changes from all commits
344bb13
ad63fe5
5910767
5079836
d8abc03
4397c7b
bf33bf1
f561225
0425741
9606d60
28eeb7d
3c0e714
d15c21b
7d70b3d
ea04026
b8c4311
47cc047
fb8188a
d70eaa0
f594b66
5176b44
f77e53a
ed3ad20
0432c8f
cf5e4e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -26,11 +28,11 @@ jobs: | |
java-version: "[email protected]" | ||
- uses: coursier/cache-action@v5 | ||
- name: Build | ||
run: sbt "++${{ matrix.scalaversion }}" package | ||
run: sbt "++${{ matrix.scalaversion }} package" | ||
- name: Test generate documentation | ||
run: sbt "++${{ matrix.scalaversion }}" doc | ||
- name: Build examples | ||
run: sbt "++${{ matrix.scalaversion }}" example/compile | ||
run: sbt "++${{ matrix.scalaversion }} clean;example/compile" | ||
- name: scalafmt | ||
run: sbt "++${{ matrix.scalaversion }}" scalafmtCheck | ||
readme: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,14 @@ lazy val root = project.in(file(".")). | |
|
||
name := "Scala.js DOM" | ||
|
||
crossScalaVersions in ThisBuild := { | ||
if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1") | ||
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") | ||
} | ||
scalaVersion in ThisBuild := crossScalaVersions.value.head | ||
ThisBuild / scalaVersion := crossScalaVersions.value.head | ||
|
||
val commonSettings = Seq( | ||
resolvers += Resolver.JCenterRepository, | ||
russwyte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version := "1.2.0-SNAPSHOT", | ||
organization := "org.scala-js", | ||
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings") | ||
|
@@ -104,7 +105,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, | ||
Comment on lines
-107
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When rebasing, can you isolate those changes of build syntax in a first commit, together with the upgrade of sbt, please? |
||
) | ||
|
||
lazy val example = project. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.2.8 | ||
sbt.version=1.5.3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,8 @@ package org.scalajs.dom.experimental.webrtc | |
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation._ | ||
import scala.scalajs.js.typedarray.{ArrayBufferView, ArrayBuffer} | ||
import scala.scalajs.js.| | ||
|
||
import scala.scalajs.js.typedarray.{ArrayBuffer, ArrayBufferView} | ||
import scala.scalajs.js.{undefined, |} | ||
Comment on lines
-8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spurious changes that should be reverted. |
||
import org.scalajs.dom.Blob | ||
import org.scalajs.dom.raw.{ | ||
DOMException, Event, EventInit, EventTarget, MessageEvent | ||
|
@@ -503,7 +502,8 @@ trait RTCDataChannelInit extends js.Object { | |
class RTCDataChannelEvent(typeArg: String, | ||
init: js.UndefOr[RTCDataChannelEventInit]) | ||
extends Event(typeArg, init) { | ||
def this(init: RTCDataChannelEventInit) = this("datachannel", init) | ||
def this(init: js.UndefOr[RTCDataChannelEventInit]) = | ||
this(typeArg = "datachannel", init = init) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this change have anything to do with the support for Scala 3? |
||
|
||
/** | ||
* Contains the RTCDataChannel containing the data channel associated with | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package org.scalajs.dom | ||
|
||
import scala.language.implicitConversions | ||
|
||
Comment on lines
3
to
-4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please keep this empty line. We always keep |
||
import scala.collection.mutable | ||
import scala.runtime.RichDouble | ||
|
||
package object ext { | ||
|
||
|
@@ -22,17 +22,18 @@ 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): 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): 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() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1561,11 +1561,9 @@ class MouseEvent(typeArg: String, init: js.UndefOr[MouseEventInit]) | |
@js.native | ||
@JSGlobal | ||
class PointerEvent(typeArg: String, | ||
pointerEventInit: js.UndefOr[PointerEventInit] = js.undefined) | ||
pointerEventInit: js.UndefOr[PointerEventInit] = js.native) | ||
extends MouseEvent(typeArg, pointerEventInit) { | ||
|
||
def this(typeArg: String) = this(typeArg, js.native) | ||
|
||
/** | ||
* An identifier assigned to a pointer event that is unique from the identifiers | ||
* of all active pointer events at the time. Authors cannot assume values convey | ||
|
@@ -3115,10 +3113,11 @@ class Touch extends js.Object { | |
*/ | ||
@js.native | ||
@JSGlobal | ||
class KeyboardEvent(typeArg: String, init: js.UndefOr[KeyboardEventInit]) | ||
class KeyboardEvent(typeArg: String, | ||
init: js.UndefOr[KeyboardEventInit] = js.native) | ||
extends UIEvent(typeArg, init) with ModifierKeyEvent { | ||
|
||
def this(typeArg: String) = this(typeArg, js.native) | ||
// def this(typeArg: String) = this(typeArg, js.native) | ||
Comment on lines
-3118
to
+3120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these changes have anything to do with Scala 3 support? |
||
|
||
/** | ||
* Returns the Unicode value of a character key pressed during a keypress event. | ||
|
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.
Those changes shouldn't be necessary.