-
Notifications
You must be signed in to change notification settings - Fork 556
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
Switch to Play 3 and go all in on Pekko #26677
Conversation
@@ -144,7 +144,6 @@ object Filters { | |||
|
|||
} | |||
|
|||
//Note: still using akka (instead of pekko) materializer from Play as both filters extend Play's Filter, so the types need to match |
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.
Is it ok to just remove that comment now? I didn't dig deeper if something else needs to be done.
jackModule, | ||
jacksonDatabind, | ||
) | ||
|
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.
Play 2.9/3 upgraded to Jackson 2.14: https://www.playframework.com/documentation/latest/Highlights29#Jackson-Upgraded-to-2.14
No need to upgrade explicitly anymore.
|
||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") | ||
|
||
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1") | ||
addDependencyTreePlugin |
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.
sbt-dependency-tree is now build-in in sbt, see https://www.scala-sbt.org/1.x/docs/sbt-1.4-Release-Notes.html#sbt-dependency-graph+is+in-sourced
resolvers ++= Resolver.sonatypeOssRepos("releases") ++ Seq( | ||
Classpaths.typesafeReleases, | ||
Resolver.typesafeRepo("releases"), | ||
) |
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.
These typesafe resolver should not be needed anymore 🤞
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.1") | ||
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16") |
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.
Actually not sure if sbt-native-packager needs to be pulled in explicitly because Play should provide it anyway.
build itself. Once the build has succeeded, there is no further risk (ie of a runtime exception due to clashing | ||
versions of `scala-xml`). | ||
*/ | ||
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.
This workaround should not be needed anymore after upgrading sbt to 1.9.x, Play 2.9+, native-packager, etc. They all come with scala-xml 2.x 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.
Hey @mkurz !
Wow! We were not expecting someone else to do this migration for us, thank you so much! We really really appreciate all the work you and the rest of the Play framework team put into maintaining such a great library!
As the group ID for the Play framework is changing to org.playframework
now will we need to make sure that all of our dependencies that use Play also use the new group ID?
I'm thinking these 3 in particular which we maintain https://github.com/guardian/frontend/pull/26677/files#diff-ad2642dc77b3679e4ad2c7d3b2f59a2dcf48c1bf5b93a558a4fa44828315a34cL54-L56
We probably need to do this together 😝
❤️
Yes, all dependencies need to switch their own dependencies to I was looking at the libs you mentioned: It shouldn't be to hard to migrate them. I am somehow motivated to pick this up. However there are some things I would change if you don't mind:
What do you think about that? |
This is really helpful, thanks @mkurz as I was just starting this yesterday for https://github.com/guardian/members-data-api edit: PR here guardian/members-data-api#1037 |
Play v2.9 introduces support for Scala 3 - Play v3.0 also switches from Akka to Pekko, which is great from a licensing perspective (Play v2.9 had to ship with old versions of Akka to avoid the BSL license: https://www.playframework.com/documentation/3.0.x/General#How-Play-Deals-with-Akkas-License-Change ). Here, we're upgrading `play-secret-rotation` to support these new latest versions of Play, and add the new welcome Scala 3 support! To reduce maintenance build complexity, we're also dropping support for Play 2.6, and Scala 2.12. Note, Matthias Kurz made some interesting suggestions about restructuring the multi-Play support in this project and also `google-play-auth`: guardian/frontend#26677 (comment) ...however, for `play-secret-rotation` at least, the changes didn't appear necessary, as `play-secret-rotation` actually has a fairly minimal dependency on Play, and doesn't touch Akka/Pekko related code.
BTW, I guess you still run on Java 11? I recommend that you switch to Java 17, or even better Java 21 already (both are LTS). We plan to drop Java 11 in Play 3.1.0 (ETA somehow next summer or autumn, so like roughly 1 year from now). However very likely just by switching to Java 17/21 you might see a performance boost (?), at least that is what we observed in benchmarks and one Play Framework sponsor reported that to me. |
Can do, we tend not to use forks so we do end up with a fair few stale branches on our repos.
Yea we could probably do with rethinking how we manage our various versions of these dependencies, our current approach doesn't seem that sustainable. Using tags/branches to keep track of older versions of the library feels like it could make upgrades a fair bit easier.
This repo does, our recommendation is to use Java 17 but we haven't gotten around to upgrading everything yet. |
Hi @mkurz, thanks so much for your contribution! As others have already said, we really appreciate it. I have re-raised your PR here: because in order for the tests to run someone from the Guardian organisation has to raise it. I hope that's okay! I am going to add a comment there with an update. |
"This PR is stale because it has been open 30 days with no activity. Unless a comment is added or the “stale” label removed, this will be closed in 3 days" |
This PR was closed because it has been stalled for 3 days with no activity. |
Hi!
Play maintainer here 😉 I see you switched most of the repo to Pekko already:
Not sure if you have seen it, we finally (thanks to your support!) released Play 3, which starts to use Pekko under the hood, more can be found here:
All the new features, release highlights and the migration guide from Play 2.9 apply to 3.0 as well:
I took a look at your repo and started the migration; it's probably not all that needs to be done, but to get started. I will try my best to help to get things working for you. I will see what fails and push more commits to this pull request.
E.g. it might be possible that webjars cause problems, since Play 3 uses sbt-web 1.5 now which was refactored a bit. We will see. Also I think some dependencies need to be upgraded, like https://github.com/bizzabo/play-json-extensions (?). If so, I am happy to help there also.
If you have any further questions I am available.
BTW: Thanks for your ongoing financial support for Play, without it we would definitely not have been able to push out those releases, thank you very much!