-
Notifications
You must be signed in to change notification settings - Fork 7
Add sphere-mongo-3 and sphere-json-3 (the scala 3 version of similarly named modules) #651
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
base: main
Are you sure you want to change the base?
Conversation
Enable Scala 3 cross-compilation on all modules
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.
the benchmarks cannot run on scala 3?
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.
Scala 3 compilation was disabled before on the benchmarks module. I tried to compile while doing #664 but it uses jsonProduct
and mongoProduct
that seem to be only available on Scala 2 in the corresponding derivation modules, so I also disabled it for now for Scala 3.
It'd be nice to keep the same API, with the same imports. I've tried to run the current |
There are 3 categories:
So the only real change are the typeSwitch calls. This is also not impossible to make backwards compatible I guess. We could just manually create 22 methods, or at least ~10 as we don't use that much anyway, but we have 12 jsonTypeSwitch and 6 mongoTypeSwitch calls, so it's very little effort to port. If we want to cross compile the whole code base, then it would be slightly annoying I guess 🤔 |
I agree.
We could also change the scala 2 implementation to take a tuple.
👍 |
# Conflicts: # json/json-core/src/main/scala/io/sphere/json/FromJSONInstances.scala # json/json-core/src/main/scala/io/sphere/json/ToJSONInstances.scala
sphere-mongo-core
andsphere-json-core
are now cross-compiled to scala2/3.Some guide for the review:
sphere-mongo-core
andsphere-json-core
now contain scala-3 folders containing scala3 specific code.main
andtest
folders.test
folders contain all tests from thederivation
modules + some new tests