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

Downstream _print users #158

Closed
4 tasks done
TotalVerb opened this issue Aug 8, 2016 · 3 comments
Closed
4 tasks done

Downstream _print users #158

TotalVerb opened this issue Aug 8, 2016 · 3 comments
Assignees

Comments

@TotalVerb
Copy link
Collaborator

TotalVerb commented Aug 8, 2016

In anticipation of #151 being (hopefully) merged, the following packages are using JSON._print, which will be deprecated:

(List from GitHub search.) From a quick glance, all of these packages will be easily converted to the new style. I'll submit PRs so that they can avoid the deprecation warning (but I'd like to submit that after #151 is merged and tagged).

@EricForgy
Copy link
Contributor

Just FYI, I suspect this is going to hit a LOT of private repos. JSON is used by pretty much any web app. I have at least 10 private repos that will be affected.

I'm a little confused why JSON._print needs to be deprecated, but if you guys agree, I can deal with it.

Get Outlook for iOShttps://aka.ms/o0ukef

On Mon, Aug 8, 2016 at 10:55 AM +0800, "Fengyang Wang" <notifications@github.commailto:notifications@github.com> wrote:

In anticipation of #151#151 being (hopefully) merged, the following packages are using JSON._print, which will be deprecated:

  • Bokeh
  • Escher
  • PlotlyJS
  • Plots

(List from GitHub search.) From a quick glance, all of these packages will be easily converted to the new style. I'll submit PRs so that they can avoid the deprecation warning (but I'd like to submit that after #151#151 is merged and tagged).

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/158, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIijauNucrb7Ek6tnyj0RuFZTJpg2c9Cks5qdpqwgaJpZM4Jeqp9.

@TotalVerb
Copy link
Collaborator Author

The package has not been very clear about what is to be considered an internal implementation detail, but let me be frank: JSON._print is:

  • not documented in the README
  • preceded by an underscore

That should speak loud and clear that this is an internal function, and that it needs to be deprecated at all (as opposed to just removed) is unfortunate. However, I sympathize with the fact that this package did not have a good API to extend JSON serialization before. #151 fixes that, and so JSON._print becomes redundant and unnecessary.

This code:

JSON._print(io::IO, state::JSON.State, a::MyType) =
    JSON._print(io, state, do_something_to_convert_to_JSON_primitive(a))

will become

JSON.lower(a::MyType) = do_something_to_convert_to_JSON_primitive(a)

If your use case for JSON._print is similar, then the migration will be very easy. If there is any valid use of JSON._print that is difficult to migrate, please post on #151.

As to why the deprecation is necessary: tagging JSON v0.5.2 broke PlotlyJS, because an internal function was renamed, because PlotlyJS was reimplementing the JSON serialization code. This is a bad situation that is best to avoid. Having a documented, stable API is better from the consumer's perspective.

@TotalVerb TotalVerb self-assigned this Aug 19, 2016
@TotalVerb
Copy link
Collaborator Author

All four PRs have been merged.

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

No branches or pull requests

2 participants