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

Moving to Jason #234

Closed
wants to merge 2 commits into from
Closed

Conversation

BlueHotDog
Copy link
Contributor

Hi,
This is still work in progress but wanted to share to get some feedback.
As you know Ecto moved away to Jason in v3, which breaks Commanded.
This PR is an effort to align Commanded with Ecto by moving it to Jason as well.
I've made a couple assumptions in this PR which i'm happy to discuss:

  • It's a breaking change. Since Jason requires explicit @derive Jason.Encoder vs the implicit behavior in Poison.. If you think this is too harsh of a change, i think we can, with more work, do something to have a better upgrade experience. E.g have a Commanded.JsonEncoder which will define the encoding behaviour depending if Jason or Poison is loaded and basically delegate to the appropriate @derive. But this is quite a lot of work and i'm not sure its worth the effort - What do you think?
  • Aside from that the only change is in how Jason handles NaiveDateTime, seems like Poison automatically decodes it to DateTime when Jason keeps it as string for manual decoding. Not sure how to overcome this or whats the best approach - Suggestions are welcome(1 test is failing due to this)

I've updated the documentation but i think more needs to be written in regard to this change.

Help appreciated.
Thank you for the awesome lib!

@BlueHotDog
Copy link
Contributor Author

The commit messages are a mess, i'll make sure to rewrite them before merge.

@slashdotdash
Copy link
Member

@BlueHotDog Thanks for taking the time to work on this pull request, it's really helpful.

I'm finally looking at finishing off the Jason upgrade for Event Store and Commanded so will take this and get it merged in.

I think it's acceptable to have a breaking change with Jason requiring explicit @derive Jason.Encoder in event modules for serialization. As for date time parsing we can support it via the existing Commanded.Serialization.JsonDecoder protocol.

@slashdotdash
Copy link
Member

@BlueHotDog I've rebased your changes on master and have merged in 6dcc60b.

slashdotdash added a commit that referenced this pull request Jan 16, 2019
Add Danni Friedland to Contributors in README.
@BlueHotDog
Copy link
Contributor Author

Whoo hoo!! excited!

@BlueHotDog BlueHotDog deleted the moving_to_jason branch January 18, 2019 10:14
slashdotdash added a commit that referenced this pull request Jan 21, 2019
They have been superceeded by #243 and #234 respectively.
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

Successfully merging this pull request may close these issues.

2 participants