-
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
Conversation
src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorker.scala
Outdated
Show resolved
Hide resolved
@russwyte What do you think about adding the newly supported version in CI pipeline? |
Travis CI seems super slow for this. It may be time to consider moving to github actions. |
class URL(url: String, base: String = js.native) extends js.Object { | ||
class URL(url: String, base: String) extends js.Object { | ||
def this(url: String) = this(url, js.native) |
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.
Why is this necessary? If the original code is not accepted by Scala 3, please report an issue to the dotty repo, because that's a bug.
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.
Yeah the original would not compile in 3.0.0-RC1 - I will report.
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.
Created:
scala/scala3#11592
@sjrd I am a bit stumped as to why this won't compile for 2.10.7/0.6.x:
|
It does seem weird. Can you reproduce the issue locally? |
yes - running:
fails. |
@sjrd The compiler error seems to be an issue with order of build tasks and incremental compiling. I added a clean to the problematic step |
@sjrd It looks like DottyDoc does not like some of our overloaded constructors. That has me stuck. |
Does anyone know if the blockers have been addressed in RC3? |
I tried RC3 a few days ago and unfortunately the DottyDoc issue still persists. Everything else is working. |
It would be nice if someone could minimize and report the issue to the dotty repo. |
|
@sjrd that last commit got scaladocs working for Scala 3. Please let me know if more is needed. |
@russwyte @sjrd What will it take to get this merged? Happy to pitch in a hand :) we'd love this over at http4s/http4s#4938 |
There's nothing that I can approve. It just says "Workflow completed with no jobs." 🤔😕 |
Done |
Thank you very much! |
.github/workflows/ci.yml
Outdated
@@ -17,7 +17,7 @@ jobs: | |||
include: | |||
- scalaversion: "2.10.7" | |||
scalajsversion: "0.6.x" | |||
- scalaversion: "3.0.1-RC1" | |||
- scalaversion: "3.0.1-RC2" |
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.
Why bump to a RC? let's first get this released for 3.0.0 😅
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.
Already tried 3.0.0 (earlier) and it didn't work because of sbt and scaladoc/dottydoc borkage with scalajs. But if it can work now (maybe SBT fix?) - that's great! 👍
3.0.1-RC1 and on will work right now.
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 see! Frustrating. Btw thanks for picking this up again!
PS if you make a tiny PR to this repo (e.g. fix a typo) maybe @sjrd can merge it quick and then you'll be whitelisted for CI.
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 don't mind doing a PR like that, but what is strange is that until a few commits ago CI was working fine.
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.
GH changed their policy recently, maybe while you were working on this. It makes contributing more difficult IMO.
@russwyte @sjrd Scala 3.0.1 was just released and CI is green. So, what will it take to merge? :) |
@sjrd another polite bump. At least let's run the workflow, please? |
@sjrd I agree with @armanbilge :) let's rock please! |
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.
Thanks for the continued efforts.
I have some comments below. In addition, could you squash/rebase everything in 3 commits with appropriate commit messages:
- Upgrade sbt and change the syntax
- Upgrade Scala.js to 1.5.0
- Add the support for Scala 3, and all the other changes.
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" |
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.
(resources in Compile) += (fullOptJS in (example, Compile)).value.data | ||
(Compile / resources) += (example / Compile / fullOptJS).value.data, |
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.
When rebasing, can you isolate those changes of build syntax in a first commit, together with the upgrade of sbt, please?
import scala.scalajs.js.typedarray.{ArrayBufferView, ArrayBuffer} | ||
import scala.scalajs.js.| | ||
|
||
import scala.scalajs.js.typedarray.{ArrayBuffer, ArrayBufferView} | ||
import scala.scalajs.js.{undefined, |} |
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.
Spurious changes that should be reverted.
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 comment
The 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?
import scala.language.implicitConversions | ||
|
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.
Please keep this empty line. We always keep import scala.language.*
separate from the others.
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) |
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.
Do these changes have anything to do with Scala 3 support?
Superseded by #450. |
Add support for Scala 3.0.0-RC1 in anticipation of final release of Scala 3.0.0