-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
all: prepare for Scala3 #36
all: prepare for Scala3 #36
Conversation
7666bef
to
62b6281
Compare
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.
@honeycomb-cheesecake could you please check and merge the changes? Thanks!
@ahjohannessen @ndeverge please check my message in the discord play-user channel, thanks! |
62b6281
to
3cbc915
Compare
I do have an almost working version locally, just I got in some conversations/chats this afternoon 😉 We will be done soon here 😉 |
@mkurz oh sorry, I was working on it too this afternoon :-( |
@ndeverge Please push your work either here or in a different branch, so it's not lost, we can incorporate what we both have done. |
I can rebase onto yours, no problem |
@ndeverge Did you run into this |
project/plugins.sbt
Outdated
@@ -10,3 +10,5 @@ addSbtPlugin(dependency = "org.scalariform" % "sbt-scalariform" % "1.8.3") | |||
addSbtPlugin(dependency = "org.scoverage" % "sbt-scoverage" % "2.0.7") | |||
addSbtPlugin(dependency = "org.scoverage" % "sbt-coveralls" % "1.3.11") | |||
addSbtPlugin(dependency = "org.xerial.sbt" % "sbt-sonatype" % "3.10.0") | |||
|
|||
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always |
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.
@ndeverge The problem here is that sbt-scapegoat pulls in scala-xml verson 1, but every other library already upgraded to scala-xml version 2. Given that scapegoat also does not come with Scala 3 artifacts yet (see scapegoat-scala/scapegoat#521), I think we should just drop it... We don't use it in any other Play repos anyway.
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.
Also then this workaround is not necessary anymore.
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.
@mkurz Right, let's get rid of it then!
I was on the main codebase, now I need to make a test against this branch to check if I still get this error. |
@mkurz good news! I tested this branch with my project, migrated to Play 2.9.0 and so far so good. |
Pull Request Test Coverage Report for Build 7140244048
💛 - Coveralls |
@ndeverge Let you me know when you are done or stuck |
- Avoiding automatic dependency on akka http server makes it easier for dependant projects to use Scala 3 and netty instead. - adjust tests to use mockito instead of specs2 mock wrappers. - drop jdk8 from CI
e373023
to
71c6813
Compare
@ahjohannessen @MathisGuillet1 @ndeverge Can you help out here? Please check out this branch and in sbt run
You will see errors, related to
I think this needs more work to port to Scala 3... @SethTisue maye you can help out here as well? |
Here is shorter snippet of the issue: trait Identity
trait Env {
type I <: Identity
}
trait IdentityService[T <: Identity]
trait Environment[E <: Env] {
def identityService: IdentityService[E#I]
} The Scala 3 compiler fails with:
You can try directly on https://scastie.scala-lang.org/IScKT1QfStKC3ILH47LnQw Maybe @DmytroMitin could help too? |
@mkurz I think an equivalent encoding is needed for: trait Identity
trait Env {
type I <: Identity
}
trait IdentityService[T <: Identity]
trait Environment[E <: Env] {
def identityService: IdentityService[E#I]
} In Scala 3 this is a no go. |
(not volunteering to get involved here, sorry) |
Thanks @MathisGuillet1 I'll have a look in a couple of days, and I'll try to do my best. |
Boom, all ✔️ with scala 3 |
@MathisGuillet1 Congrats, thank you SO much! I'll give it a try by integrating the Scala 3 version with my project to make sure that some features are not broken. |
Great! I will review this PR and after it got merged I will quickly set up sbt-ci-release so we can cut the release. IMHO we should publish it under "org.playframework.silhouette" % "play-silhouette" % "x.x.x" Any objections? However, after the release process is set up you, @MathisGuillet1 and @ndeverge, will responsible for this repo. You can of course ping me or someone else if you run into problems in future, but the goal is that you take care of this repo. I want to set up things until tomorrow evening. |
That's perfect for me @mkurz |
@mkurz I discussed with @ndeverge this morning, it's also fine for him. |
@mkurz also, similar to Play 2.9 and 3.0, we think that we could use the 9.x version for Play 2.9 compatibility, and 10.x version for Play 3.0. |
Any update on this @mkurz ? |
This is absolutely next on my list, I guess it should be really now done by tomorrow (if the PR is ok and everything) |
Because Around relies on DelayedInit which was dropped in Scala 3
abstract override def around[T: AsResult](t: => T): Specs2Result = super.around { | ||
try { before; t } finally { after } | ||
} | ||
} |
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 removed these helpers, because they will not work in Scala 3, because Around relies on DelayedInit
which is not doing anything anymore in Scala 3:
https://dotty.epfl.ch/docs/reference/dropped-features/delayed-init.html
Just to safe you from future headaches, why things are not working if you make use of them...
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 took a look and in general should be OK.
Didn't dive in too much in the Scala 3 fixes, but I guess it should work. Also tests I just scrolled over and not much changed as far as I can see.
The only thing which I think could be improved in future is to avoid too much duplicated code between the app-2
and app-3
folders, now it's just copy and paste. Maybe it would be possible to break out just the code that needs to be Scala 3 specific and put that in a class or something and then import/extend it from general Scala code.
Now you might run into troubles if you need to change code twice.
But not for now 😉
Actually wait a moment... |
All good, tests are running for Scala 3 I see 😉 |
You are right, I went straight to the point here but in the future, I'll try to isolate type projection only |
Scala 3 support