-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow configuring a serializer and support binary data #56
Allow configuring a serializer and support binary data #56
Conversation
finished. |
06d1449
to
776cb4b
Compare
@the-mikedavis Could you review this when you are free? |
Thanks for the PR! I am away for a few weeks but I will give the changes a proper look when I get back. |
I fixed the credo issue. I will fix the following coverall issue later, thanks. |
Coverall issues are fixed, thanks. |
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.
This looks great! The only thing that worries me is the change from json_parser
to serializer
for configuration: that's a breaking change so we'd need to cut a 2.0.0 release. Instead could we keep the json_parser
option around and mark it as deprecated using the :deprecated
NimbleOptions option and use that as a default value in Slipstream.Serializer.PhoenixSocketV2Serializer
rather than hard-coding Jason?
Alternatively we could keep the json_parser
option around without deprecating it so that it would be easy to switch out that module without re-implementing the serializer, and document that it has no effect if using a custom serializer
Thanks for your review! I added one commit for it. This commit make that
How about this? |
a065394
to
d7080f5
Compare
json_parser: [ | ||
doc: """ | ||
A JSON parser module which exports at least `encode/1` and `decode/2`. | ||
A JSON parser module which exports at least `encode!/1` and `decode!/1`. |
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.
This makes a breaking change for users who use custom JSON parser which doesn't have decode!/1
.
before this PR
The original line is not fit the actual codes. The codes expected encode!/1
and decode/1
. This was just document error. Custom JSON parser users know that and implement them to fit the codes.
after this PR
This PR codes expect decode!/1
for json_parser. So this change should be written in CHANGELOG.
d7080f5
to
14d1731
Compare
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.
Looks great, thanks for working on this!
This PR tries to implement handling binary data feature, relates to #28 and #53.
This may include implementation and testing omissions due to a lack of understanding of the Slipstream overview.
Roughly, I first prepare the Serializer
behaviour
asSlipstream.Serializer
, then implement client side silializer which corresponding to Phoenix V2 JSON serializer.I followed the TDD, first added tests to synchronicity_test.exs and then implemented to satisfy them.
This PR is intended to be the base of implementation and should be modified to fit this project.