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

Make use of jsx compatibe with 3.x #645

Merged
merged 1 commit into from Jun 29, 2020
Merged

Make use of jsx compatibe with 3.x #645

merged 1 commit into from Jun 29, 2020

Conversation

nalundgaard
Copy link
Contributor

jsx moved to v3.0.0 on Friday, 26 June 2020. See jsx#139. The big change is that the default option is that return_maps now defaults to true, meaning that you will get maps output unless you explicitly pass [{return_maps, false}] when decoding JSON.

This change updates internal use of jsx to always pass return_maps explicitly, true or false, so that it is compatible with jsx v3.0.0. I also updated the pin of jsx to v2.11.0, since I don't want to force 3.x onto clients just yet.

[jsx](https://github.com/talentdeficit/jsx) moved to [v3.0.0](https://github.com/talentdeficit/jsx/releases/tag/v3.0.0) on Friday, 26 June 2020. See [jsx#139](talentdeficit/jsx#139). The big change is that the default option is that `return_maps` now defaults to `true`, meaning that you will get maps output **unless** you explicitly pass `[{return_maps, false}]` when decoding JSON.

This change updates internal use of jsx to *always* pass `return_maps` explicitly, true or false, so that it is compatible with jsx [v3.0.0](https://github.com/talentdeficit/jsx/releases/tag/v3.0.0). I also updated the pin of jsx to [v2.11.0](https://github.com/talentdeficit/jsx/releases/tag/v2.11.0), since I don't want to force 3.x onto clients just yet.
@nalundgaard nalundgaard requested a review from motobob June 29, 2020 16:26
@nalundgaard nalundgaard merged commit 2f4d8cd into master Jun 29, 2020
@nalundgaard nalundgaard deleted the jsx_v3.0.0_compat branch June 29, 2020 18:18
@paulo-ferraz-oliveira
Copy link
Contributor

I found one use of jsx without return_maps, in erlcloud_sm.

@nalundgaard
Copy link
Contributor Author

@paulo-ferraz-oliveira looks like I missed it in the later #654. Will PR a fix. Thanks.

nalundgaard added a commit that referenced this pull request Nov 13, 2020
Follow up to #645. I missed that I didn't catch this regression when `erlcloud_sm` was introduced in #654.

This change just adds the eplicit `[{return_maps, false}]` option to the `jsx:decode(...)` call to ensure that it comes back in the expected format, regardless of which jsx version the client uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants