-
Notifications
You must be signed in to change notification settings - Fork 25
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
Remove Poison as dependancy #28
Conversation
lib/chartkick.ex
Outdated
end | ||
|
||
defp options_json(opts) when is_bitstring(opts) do | ||
opts | ||
end | ||
|
||
defp json_serializer do | ||
Application.get_env(:chartkick, :json_serializer) || Poison |
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.
Wouldn't Poison
cause problems if the user doesn't include it as a dependency (since its been removed as a dependency from here)?
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.
Great catch, that means that we have a couple of options:
Option 1:
We might need to throw back an error to the user if the json_serializer
they have defined is not available?
Option 2:
We can instruct the user to install the serializer together with the chartkick dependancy.
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.
Hm.. If we go with option 2 and the user forgets to install the serializer the error would be weird/confusing.
I'd option 1 since that would enable us to give the user a reasonable error message were we could ask them to install and configure a serializer properly.
Thoughts?
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, sure that is better user experience too. Let me try something out and push
LGTM 👍 Merging this. Thanks a lot @sigu 🙌 Unrelated question |
One thing I just realized is that this change isn't backwards compatible 🤔 In previous versions this would add I will update the |
Since we are allowing the user to choose either
Poison
orJason
as the decoding library, we can removePoison
as a dependency and allow the user to install an encoder of their preferenceWe also add
eex
into extra applications to remove elixir1.11
warnings