-
Notifications
You must be signed in to change notification settings - Fork 35
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
Scala 3 support #93
Comments
It is already possible to support Scala 3 by manually re-implementing the “automatic derivation” part with a macro. It might be possible to use Shapeless 3 to ease that work. Unfortunately, note that Shapeless 3 is only available for Scala 3, which means that a solution that works for both Scala 2 and Scala 3 might be complicated to implement. |
Might you be able to help out those of us trying to migrate a little? It sounds like you've posted a solution here @julienrf but I don't know enough to fully understand it The kind of Scala 3 compile issues I'm seeing currently are:
|
Question. If I am using play 3.0.5 with scala 3, there is no way yet to user your library? |
Hello, this is indeed not possible unless someone contributes Scala 3 support in play-json-derived-codecs instead of using Shapeless, or unless Shapeless 2 supports Scala 3. |
Hey Julien, same Javier from the previous question here, just from my personal account now. I have a working version in Scala 3. I'd like to share it with you. I modified your project to cross-compile. I can make a PR but it is not something you could merge because it is work in progress, new files are not documented, the SBT file should be reviewed, a some more details. Let me know what do you think would be the best course of action. I don't have any problem if you just copy the code, no credits are required from my side. I just want your library working again for us. I already have it working great with a code I am migrating that used the Scala 2 version and didn't really need a lot of changes. |
Here the branch with my proposal https://github.com/javierfvargas/play-json-derived-codecs/tree/Scala3_draft |
Hey Javier, thank you very much for sharing your work! |
Julien. Actually, the project as I uploaded it is ready to be cross-compiled. Indeed, I did it locally using sbt +publishLocal and my project is using it as a dependency now. I followed https://docs.scala-lang.org/scala3/guides/migration/tutorial-macro-cross-building.html Regarding unittests, What I did was to copy your tests to the scala-3 folder because I realized that some changes may be necessary. Also you can change across scala versions using ++3.3.3 and there you can run the tests, they run smoothly but when it tries to run the JS tests it fails in my environment because I think I do not have the JS artifacts to run them. I could try to unify the unittests but if you could check the changes and let me know if you have any concerns it would be better. I can trigger a PR so that you can leave comments and we move the conversation over the code there. I am willing to help but during work-days I will be slower. |
It would be great if the library could be used in Scala 3 projects. What are the prerequisites of this upgrade?
As I can see a new version of Shapeless library for Scala 3 exists, however I can't determine whether it is ready to be used in the current project: https://github.com/typelevel/shapeless-3
Is there any oher prerequisite of the migration?
Thanks!
The text was updated successfully, but these errors were encountered: