Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Migrate JsonEncoder/Decoder macro to Scala 3 native macro. No more magnolia#929

Open
987Nabil wants to merge4 commits intozio:series/2.x
base:series/2.x
Choose a base branch
Loading
from987Nabil:scala-3-native-macro

Conversation

987Nabil
Copy link
Contributor

  • annotation handling
  • decoders for recursive data structures

plokhotnyuk, fsvehla, and guizmaii reacted with heart emoji
@987Nabil
Copy link
ContributorAuthor

Still needs some refactoring. But it would be nice, if one could approve the workflows.

@@ -161,7 +161,7 @@ final class WithRetractReader(in: java.io.Reader) extends RetractReader with Aut
private[zio] sealed trait RecordingReader extends RetractReader {
def rewind(): Unit
}
private[zio]object RecordingReader {
object RecordingReader {
def apply(in: OneCharReader): RecordingReader =
Copy link
ContributorAuthor

@987Nabil987NabilApr 12, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The macro basically inlines the code that calls this apply. Therefore we get a compile time error if it is package private.

@987Nabil987Nabil changed the titleMigrate JsonEncoder macro to Scala 3 native macro. No more magnoliaMigrate JsonEncoder/Decoder macro to Scala 3 native macro. No more magnoliaApr 12, 2023
@987Nabil987Nabil marked this pull request as ready for reviewApril 14, 2023 06:32
@987Nabil987Nabil requested a review froma team as acode ownerApril 14, 2023 06:32
@987Nabil
Copy link
ContributorAuthor

987Nabil commentedApr 14, 2023
edited
Loading

I thought one could extract the common macro code to some helper. But this does not seem to work since the imports of theusing Quotes are path dependent. So I guess this is ready for review.

@jdegoes
Copy link
Member

@987Nabil Looks great! Can you add some more tests for this under Scala 3 so we can be more assured the derivation is working correctly?

@987Nabil
Copy link
ContributorAuthor

There are actually a lot of shared tests. I think most cases are covered. But I can take a look if I find something missing.
Do you have something particular in mind?

@plokhotnyuk
Copy link
Contributor

plokhotnyuk commentedApr 25, 2023
edited
Loading

@987Nabil Usingthis benchmark set you can test both correctness and performance of the new way of derivation on ~60 synthetic and real-world JSON samples.

jdegoes reacted with thumbs up emoji

@987Nabil
Copy link
ContributorAuthor

fyi: The benchmark does not compile. Did not find the time yet to take a deeper look.

fsvehla reacted with thumbs up emoji

@plokhotnyukplokhotnyuk mentioned this pull requestMar 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@987Nabil@jdegoes@plokhotnyuk

[8]ページ先頭

©2009-2025 Movatter.jp