-
Notifications
You must be signed in to change notification settings - Fork 64
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
[755] zio-schema breaking update #785
Conversation
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.
👍 LGTM
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.
A few remarks/questions from my side, other than that looks good to me. Apart from the code, please revert the documentation "fixes". We can tackle them in a follow-up.
@@ -44,7 +44,9 @@ object EmbeddedRedisSpec extends ZIOSpecDefault { | |||
).provideShared( | |||
EmbeddedRedis.layer.orDie, | |||
RedisExecutor.layer.orDie, | |||
ZLayer.succeed[BinaryCodec](ProtobufCodec), | |||
ZLayer.succeed[CodecSupplier](new CodecSupplier { | |||
override implicit def codec[A: Schema]: BinaryCodec[A] = ProtobufCodec.protobufCodec |
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.
override implicit def codec[A: Schema]: BinaryCodec[A] = ProtobufCodec.protobufCodec | |
implicit def codec[A: Schema]: BinaryCodec[A] = ProtobufCodec.protobufCodec |
} | ||
} | ||
|
||
abstract class ArbitraryInput[-A] extends Input[A] {} |
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.
Two things:
- let's put it in
Input
companion - let's seal it (it could be
trait
if I'm not mistaken)
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.
ah yeah, this is leftover, i was trying something, to split input and arbitrary input, but i think we don't need this at all in the end
trait CodecSupplier { | ||
implicit def codec[A: Schema]: BinaryCodec[A] | ||
} |
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.
A few remarks here:
- let's rename to
CodecSupplier
- let's rename method to
get
- let's remove implicit
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's already called
CodecSupplier
or am i not seeing the difference? - ok sure
- let me check if it's not used somewhere, if not i'll remove
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.
Sorry, typo 🤦♂️ I wanted to write CodecProvider
.
redis/src/test/scala/zio/redis/codecs/ProtobufCodecSupplier.scala
Outdated
Show resolved
Hide resolved
protected def executor: RedisExecutor | ||
|
||
implicit def summonCodec[A: Schema]: BinaryCodec[A] = codec.codec |
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.
Is it necessary?
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.
yeah, we have to "summon" the implicit codec, without this you get like 600 error when trying to compile, is there a better way you think?
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.
I presume the only way around it would be to call codec.get
everywhere, right?
not sure which fixes should i revert, because those "fixes" were actual fixes :D without them mdoc complained about not being able to compile code examples, so imho it would just fail on a different step of a workflow |
#755