Skip to content
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

scala3 auto derivation module (than Magnolia and shapeless). #506

Open
afsalthaj opened this issue Apr 5, 2021 · 6 comments
Open

scala3 auto derivation module (than Magnolia and shapeless). #506

afsalthaj opened this issue Apr 5, 2021 · 6 comments
Assignees

Comments

@afsalthaj
Copy link
Collaborator

afsalthaj commented Apr 5, 2021

Probably this would involve a generic module in Scala3, with its own Generic that allows to and fro from tuples.

The intermediate tuple elements can stay as type members, allowing us to use Conversion[Product].to(product) to do a few computations. Incase, we end up needing to propagate the type info of B, use an Aux pattern can be repeated here type Aux[A, X] = Conversion { type B = X }.

This implies the magnolia specific module will look-like-shapeless but through zero dependency (for scala3)

trait Conversion[A] {
  type Out
  def to(a: A): Out
  def from(b: Out): A
}

@afsalthaj afsalthaj changed the title Use scala3 functionalities for scala3 compatible zio-config auto derivation modules (than Magnolia and shapeless) Use scala3 functionalities for scala3 compatible zio-config auto derivation modules (than Magnolia and shapeless). Make sure latest scala3 is used! May 15, 2021
@afsalthaj afsalthaj added the good first issue Good for newcomers label May 16, 2021
@afsalthaj afsalthaj changed the title Use scala3 functionalities for scala3 compatible zio-config auto derivation modules (than Magnolia and shapeless). Make sure latest scala3 is used! scala3 compatible auto derivation module (than Magnolia and shapeless). Jun 19, 2021
@afsalthaj afsalthaj changed the title scala3 compatible auto derivation module (than Magnolia and shapeless). scala3 auto derivation module (than Magnolia and shapeless). Jun 19, 2021
@danielbe1
Copy link

Id like a shot at tackling this if you don't mind :)
I've been dying for zio-config in scala 3!

@afsalthaj afsalthaj self-assigned this Jun 26, 2021
@afsalthaj
Copy link
Collaborator Author

@danielbe1 Sorry for the late response. Unfortunately, I have already been working on this issue, and I apologise I didn't mention it in the list of assignees.

@afsalthaj
Copy link
Collaborator Author

@danielbe1 Thanks a ton for offering the help. I have been looking for someone up until 1 week before, however, I started straight away once I got some bandwidth.

@afsalthaj afsalthaj removed the good first issue Good for newcomers label Jun 27, 2021
@afsalthaj
Copy link
Collaborator Author

For those who would like to know the progress, here is it:
https://github.com/afsalthaj/zio-config-scala3-auto-derivation

ETA: Mid July, however we will try our best to smash this even before.

@afsalthaj
Copy link
Collaborator Author

There will not be DeriveConfigDescriptor and inheritance pattern of custom derivations.
Any custom behaviour related to names and nesting will be part of the annotations:
https://github.com/afsalthaj/zio-config-scala3-auto-derivation/blob/master/src/main/scala/zio/config/magnolia/Macros.scala

@afsalthaj
Copy link
Collaborator Author

Draft PR that implements almost all functionalities is here:
#574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants