-
Notifications
You must be signed in to change notification settings - Fork 12
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
WIP: migrate to Scala 3 #36
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 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
lorandszakacs
force-pushed
the
refactoring/scala_3
branch
from
March 29, 2021 16:06
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
lorandszakacs
force-pushed
the
refactoring/scala_3
branch
from
April 22, 2021 14:40
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-migration
flag. 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 class
butextension
implicit F: MonadThrow[F]
, butusing MonadThrow[F]
implicit0(...)
usages from better-monadic-for w/given
implicit def
w/given
implicit val
w/given
The tricks was not to migrate everything at once, because errors would be extremely unhelpful. For instance, once
implicit
was replaced with agiven
in 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.Codec
for instance.Upgraded circe to
0.14.0-M4
, droppedhttp4s-circe
dependency, and decided to leave code commented, to be rewritten and inlined. Andphms.json.derive.codec
method is now unimplemented.Things left to do:
Http4sCirceInstances
decoder w/ circe0.14.0-M4
,Codec
to work with other opaque types with minimal boilerplate and/or changes.scalaScrapper
entirely, 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.