-
Notifications
You must be signed in to change notification settings - Fork 24
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
monocle3, scala3 upgrade #336
Conversation
@@ -39,6 +39,6 @@ trait JsonNumberOptics { | |||
) | |||
} | |||
|
|||
final object JsonNumberOptics extends JsonNumberOptics { |
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.
stop scala3 compiler warning, also applies to other occurrences.
@zmccoy @zarthross please let me what you think, thanks |
Hi @inanme at first glance we'll want keep the Scala versions at the Build level such as : https://github.com/circe/circe/blob/series/0.14.x/build.sbt#L13. That will keep 2.12,2.13, and 3 in github action workflow yaml. You'll probably want to rebase as well as there were some merges from a few weeks ago that added in the sbt-circe-org plugin which helps make things a bit cleaner. |
@zmccoy I welcome the SBT changes. With regards to my changes, I had to drop scala212 as monocle3 does not support/ dropped 212. Let me know if this is an issue. My main motivation for this PR to get monocle3 upgraded, scala3 nice to have. |
rebase done. |
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.
just few minor style issues, looks good!
|
||
final def applyDynamic(field: String)(index: Int): JsonTraversalPath = selectDynamic(field).index(index) | ||
|
||
final def apply(i: Int): JsonTraversalPath = index(i) | ||
|
||
final def index(i: Int): JsonTraversalPath = | ||
JsonTraversalPath(json.composePrism(jsonArray).composeOptional(Index.index(i))) | ||
JsonTraversalPath(json.andThen(jsonArray).andThen(Index.index(i)(Index.vectorIndex[Json]))) |
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.
It could be more stylish if written in Index.index[Vector[Json], Int, Json](i)
IMO
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.
thanks, agreed, 3e2abe3
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.
also 844a837
|
||
final def filterByIndex(p: Int => Boolean): JsonTraversalPath = | ||
JsonTraversalPath(arr.composeTraversal(FilterIndex.filterIndex(p))) | ||
JsonTraversalPath(arr.andThen(FilterIndex.filterIndex(p)(FilterIndex.vectorFilterIndex[Json]))) |
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.
same reason as above, written as FilterIndex.filterIndex[Vector[Json], Int, Json](p)
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.
thanks, agreed, 3e2abe3
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.
also 844a837
@inanme The dropping of 2.12 for monocle3 is not an issue in that case, I didn't know they dropped 2.12. We're going to want to think about branching strategy and version numbers expectations as this is bin incompat change. |
The failures right now are expected as mima is showing that things are not bin compat. We can solve this once we figure out our branch / version strategy for this then :) |
I didn't found any particular reason for Monocle to drop the support for Scala 2.12.x, Only because they're trying to reduce maintenance burden so decided to only support 2 major versions of Scala, I think we could ask them if it is possible to bring back it. |
Sorry we weren't more clear, we can drop scala 2.12.x just fine. The binary incompatibility we are concerned with this the update to monocle 3. We can't just release this change as 0.14.2 because even if the changes in circe optics are compatible, we would be forcing a binary incompatible version of monocle on all consumers of circe optics. We do need this upgraded, but we need to decide between the options for how to go forward:
|
Would this configuration work in circe ecosystem? I setup projects like this using |
@zmccoy and I discussed, and we think the best approach would be to use this naming scheme:
We'll want to add something to the readme as well, to point users to this new artifact. @GreyPlane How does this approach sound to you? |
Personally, I'd like to say continuously support for circe-optics(monocle2) seems to unnecessary since Monocle itself dropped the support already, so release to next major version looks fine to me, and even Circe itself's major release holds bin comp, but it's more like a bonus since semantic version doesn't enforce that, so even at some point one of the Circe's associated project doesn't keep it, this behavior should be expected with some extent. But I don't hold very strong opinion about this, especially if there is real world needs for using circe-optics with monocle 2, I'm OK with the new artifact. |
@inanme I guess you have to exclude mima previous artifact for Scala 3 cross build as document says. @zarthross and so, are we decided to release new artifact under a new name? |
It would be really great to have this available! |
@GreyPlane, I think you have a persuasive argument. I'm ok with abandoning support for monocle 2, releasing a new version of circe-optics as 0.15 with monocle 3, and including in the readme a table with a note about the versioning and how it relates to circe-core. See https://github.com/circe/circe-generic-extras#versioning please use the same verbiage and structure for consistency. |
Hey, Thanks for the work here! |
@inanme Hi buddy, I am currently un-employed, so I can pick this up as I have bit more time to focus. If you like me to look more into this issue. |
Why is it trying to resolve itself? |
So I understand the current build is not going through because of MiMa. Is there anything we can do to move forward? Sounds like we have a sizable amount of people volunteering. Is the issue technical or political here? We have projects we need to move forward on Scala 3 depending on circe-optics. Can a maintainer step forward? |
@joan38 not any problem really, I think we have reach the consensus here and there isn't any hard technical issue, just have to finish the work. |
Thanks for the work on this. |
I guess it's customary to create a PR for Scala3 & Monocle3 upgrades. This PR removes all deprecated Monocle API usages.