-
Notifications
You must be signed in to change notification settings - Fork 7
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
propose alternative derivation mechanism #174
Comments
I share the same opinion, the pros are really attractive 👍 Regarding the transition, I think I prefer the second alternative, i.e without |
Step 2 of #174 The tests are similar to the ones in sphere-mongo-derivation. We have to make sure the keep those tests consistent in the future.
Step 2 of #174 The tests are similar to the ones in sphere-mongo-derivation. We have to make sure the keep those tests consistent in the future.
Json4s has a couple of not fixed vulnerabilities: https://github.com/json4s/json4s/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+denial Please consider switching to a more safe parser (and AST, if it will be required) or help json4s maintainers to fix it. |
@plokhotnyuk thx for the feedback. This issue is about changing the derivation mechanism for the type classes and is not about the json parser. |
in sphere-json & sphere-mongo we propose a generic derivation of typeclass instances based on scala macros & core generation.
I experimented using another derivation mechanism based on magnolia: https://github.com/sphereio/sphere-scala-libs/tree/derive_with_magnolia
I could use this new mechanism for sphere-mongo in our private backend.
Using magnolia instead of our own macros is a trade-of decisions:
(+) we can mutualize our efforts with other contributors to have a better derivation mechanism
(+) Magnolia advertises having good compilation time
(+) we could only rely on scala annotations and fix #131
(+) less code in this repository
(-) depending on magnolia
(-) less liberty
I personally think that this way is worth a try.
But I'd like to avoid a big-bang release where we move completely from our macros to magnolia.
My proposal:
For the transition, we have 2 possibilities. For example if someone is using
sphere-mongo
:sphere-mongo
can be a library depending onsphere-mongo-core
&sphere-mongo-macro-derivation
.sphere-mongo-core
&sphere-mongo-magnolia
to test in the phase 2.sphere-mongo
intosphere-mongo-macro-derivation
.sphere-mongo-core
.sphere-mongo-magnolia
in the phase 2 as an alternative tosphere-mongo-macro-derivation
.The text was updated successfully, but these errors were encountered: