Skip to content

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

Closed
wants to merge 25 commits into from
Closed

Support scala 3 #446

wants to merge 25 commits into from

Conversation

russwyte
Copy link
Contributor

Add support for Scala 3.0.0-RC1 in anticipation of final release of Scala 3.0.0

@vhiairrassary
Copy link
Contributor

@russwyte What do you think about adding the newly supported version in CI pipeline?

@russwyte
Copy link
Contributor Author

russwyte commented Mar 2, 2021

Travis CI seems super slow for this. It may be time to consider moving to github actions.

@russwyte russwyte requested a review from sjrd March 2, 2021 20:21
Comment on lines 14 to 15
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)
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@russwyte
Copy link
Contributor Author

russwyte commented Mar 3, 2021

@sjrd I am a bit stumped as to why this won't compile for 2.10.7/0.6.x:

[info] set current project to Scala.js DOM (in build file:/home/runner/work/scala-js-dom/scala-js-dom/)
[info] Setting Scala version to 2.10.7 on 2 projects.
[info] Excluded 1 projects, run ++ 2.10.7 -v for more details.
[info] Reapplying settings...
[info] set current project to Scala.js DOM (in build file:/home/runner/work/scala-js-dom/scala-js-dom/)
[info] compiling 53 Scala sources to /home/runner/work/scala-js-dom/scala-js-dom/target/scala-2.10/classes ...
[error] /home/runner/work/scala-js-dom/scala-js-dom/src/main/scala/org/scalajs/dom/experimental/beacon/package.scala:44:70: js.native may only be used as stub implementation in facade types
[error]     def sendBeacon(url: String, data: BodyInit = null): Boolean = js.native
...

@sjrd
Copy link
Member

sjrd commented Mar 3, 2021

It does seem weird. Can you reproduce the issue locally?

@russwyte
Copy link
Contributor Author

russwyte commented Mar 3, 2021

It does seem weird. Can you reproduce the issue locally?

yes - running:

 SCALAJS_VERSION="0.6.28" sbt "++2.10.7" example/compile

fails.

@russwyte
Copy link
Contributor Author

russwyte commented Mar 3, 2021

@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 example/compile and it cleared up the CI build.

@russwyte
Copy link
Contributor Author

russwyte commented Apr 1, 2021

@sjrd It looks like DottyDoc does not like some of our overloaded constructors. That has me stuck.

@raquo
Copy link
Contributor

raquo commented Apr 25, 2021

Does anyone know if the blockers have been addressed in RC3?

@russwyte
Copy link
Contributor Author

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.

@sjrd
Copy link
Member

sjrd commented Apr 25, 2021

It would be nice if someone could minimize and report the issue to the dotty repo.

@russwyte
Copy link
Contributor Author

It would be nice if someone could minimize and report the issue to the dotty repo.

scala/scala3#12215

@russwyte russwyte changed the title Support scala 3.0.0-RC2 Support scala 3 May 13, 2021
@russwyte
Copy link
Contributor Author

russwyte commented Jun 3, 2021

@sjrd that last commit got scaladocs working for Scala 3. Please let me know if more is needed.

@armanbilge
Copy link
Member

@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

@armanbilge
Copy link
Member

@sjrd @gzm0 just a polite bump. I understand if you are busy to review, but at the very least could you kindly approve the workflow, so we can see how this PR stands against CI?

@sjrd
Copy link
Member

sjrd commented Jul 6, 2021

There's nothing that I can approve. It just says "Workflow completed with no jobs." 🤔😕

@armanbilge armanbilge mentioned this pull request Jul 6, 2021
@armanbilge
Copy link
Member

@sjrd thanks for your attention ... that's strange. I tried re-opening in #449, can you approve there?

@sjrd
Copy link
Member

sjrd commented Jul 6, 2021

Done

@armanbilge
Copy link
Member

armanbilge commented Jul 6, 2021

Thank you very much! I'll continue working on the PR there.

@@ -17,7 +17,7 @@ jobs:
include:
- scalaversion: "2.10.7"
scalajsversion: "0.6.x"
- scalaversion: "3.0.1-RC1"
- scalaversion: "3.0.1-RC2"
Copy link
Member

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 😅

Copy link
Contributor Author

@russwyte russwyte Jul 6, 2021

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@armanbilge
Copy link
Member

@russwyte @sjrd Scala 3.0.1 was just released and CI is green. So, what will it take to merge? :)

@armanbilge
Copy link
Member

@sjrd another polite bump. At least let's run the workflow, please?

@Myp
Copy link

Myp commented Jul 14, 2021

@sjrd I agree with @armanbilge :) let's rock please!

Copy link
Member

@sjrd sjrd left a 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:

  1. Upgrade sbt and change the syntax
  2. Upgrade Scala.js to 1.5.0
  3. Add the support for Scala 3, and all the other changes.

Comment on lines -29 to +35
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"
Copy link
Member

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.

Comment on lines -107 to +108
(resources in Compile) += (fullOptJS in (example, Compile)).value.data
(Compile / resources) += (example / Compile / fullOptJS).value.data,
Copy link
Member

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?

Comment on lines -8 to +9
import scala.scalajs.js.typedarray.{ArrayBufferView, ArrayBuffer}
import scala.scalajs.js.|

import scala.scalajs.js.typedarray.{ArrayBuffer, ArrayBufferView}
import scala.scalajs.js.{undefined, |}
Copy link
Member

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)
Copy link
Member

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?

Comment on lines 3 to -4
import scala.language.implicitConversions

Copy link
Member

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.

Comment on lines -3118 to +3120
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)
Copy link
Member

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?

@armanbilge armanbilge mentioned this pull request Jul 14, 2021
@armanbilge
Copy link
Member

armanbilge commented Jul 14, 2021

@sjrd In #450 I rebased and fixed according to your comments. I hope that adding @russwyte to the rebased commits as a co-author is consistent with your coding style; please advise.

@sjrd
Copy link
Member

sjrd commented Jul 14, 2021

Superseded by #450.

@sjrd sjrd closed this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants