-
Notifications
You must be signed in to change notification settings - Fork 12
WIP: migrate to Scala 3 #36
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
Open
lorandszakacs
wants to merge
31
commits into
main
Choose a base branch
from
refactoring/scala_3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
704672a to
0cf55c3
Compare
This required circe upgrade and dropping of http4s-circe integration, which we're inlining
Pending implementation of decoder
It's due to Scala 2 interop w/ scalascrapper
0cf55c3 to
a0031ca
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It was really easy to get everything to compile and work under
-source:3.0-migrationflag. We just had to upgrade circe, and comment out code that relied on semiauto derivation that no longer works... at all.But this PR is even more ambitious, it replaced _all _ usages of old syntax/features with new ones. No more:
import phms._w/import phms.*implicit classbutextensionimplicit F: MonadThrow[F], butusing MonadThrow[F]implicit0(...)usages from better-monadic-for w/givenimplicit defw/givenimplicit valw/givenThe tricks was not to migrate everything at once, because errors would be extremely unhelpful. For instance, once
implicitwas replaced with agivenin a file, then the import had to change from the oldimport phms.http.*toimport phms.http.{*, given}to also import "givens" (also applies to Scala 2 implicits from libraries), and so on.A dotty bug was discovered trying to get this migration done, which prevents us from replacing all old
type/val skunk.Codec[A]aliases with a singleexport skunk.Codecfor instance.Upgraded circe to
0.14.0-M4, droppedhttp4s-circedependency, and decided to leave code commented, to be rewritten and inlined. Andphms.json.derive.codecmethod is now unimplemented.Things left to do:
Http4sCirceInstancesdecoder w/ circe0.14.0-M4,Codecto work with other opaque types with minimal boilerplate and/or changes.scalaScrapperentirely, and just use jsoup to implement same functionality. It currently crashes at compile time whenever we try to use anything from the DSL because it relies on old complex scalaz things and it's to be expected to run into some interop bug. Currently still depending on scala-scrapper with the.cross(CrossVersion.for3Use2_13)sbt method. Which allows us to use it as a dependency. But it's not worth the hassle, let's just use direct java wrappers instead.