{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaGizmos/WebIO.jl/issues/119","repository_url":"https://api.github.com/repos/JuliaGizmos/WebIO.jl","labels_url":"https://api.github.com/repos/JuliaGizmos/WebIO.jl/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/JuliaGizmos/WebIO.jl/issues/119/comments","events_url":"https://api.github.com/repos/JuliaGizmos/WebIO.jl/issues/119/events","html_url":"https://github.com/JuliaGizmos/WebIO.jl/issues/119","id":323820243,"number":119,"title":"Restructuring the `register_renderable` methods","user":{"login":"rdeits","id":591886,"avatar_url":"https://avatars0.githubusercontent.com/u/591886?v=4","gravatar_id":"","url":"https://api.github.com/users/rdeits","html_url":"https://github.com/rdeits","followers_url":"https://api.github.com/users/rdeits/followers","following_url":"https://api.github.com/users/rdeits/following{/other_user}","gists_url":"https://api.github.com/users/rdeits/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeits/subscriptions","organizations_url":"https://api.github.com/users/rdeits/orgs","repos_url":"https://api.github.com/users/rdeits/repos","events_url":"https://api.github.com/users/rdeits/events{/privacy}","received_events_url":"https://api.github.com/users/rdeits/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-16T23:17:14Z","updated_at":"2018-05-18T05:00:02Z","closed_at":"2018-05-18T05:00:02Z","author_association":"COLLABORATOR","body":"Since the updates in #106, any time a new provider is loaded, we get method redefinition errors, e.g.: \r\n\r\n```\r\njulia> using WebIO, Mux, Blink\r\nWebIO: setting up mux\r\nWARNING: Method definition register_renderable(Type{T} where T) in module WebIO at /home/rdeits/.julia/v0.6/WebIO/src/providers/mux.jl:73 overwritten at /home/rdeits/.julia/v0.6/WebIO/src/providers/blink.jl:33.\r\nWebIO: setting up blink\r\n```\r\n\r\nOf course, that makes sense, because we really are redefining `register_renderable(::Type{T})`. But I suspect that this design means that registering a new type only registers it for whatever the *last* provider loaded was. \r\n\r\nSo what if we didn't? What if, instead, we replaced `register_renderable_common` with something like: \r\n\r\n```julia\r\nregister_renderable(::Type{T}) = ...\r\n```\r\n\r\nand likewise each provider defined: \r\n\r\n```julia\r\nregister_renderable(::Type{T}, ::Val{:ijulia}) = ...\r\n```\r\n\r\nThen, instead of just storing a vector of renderable types, we could store both a vector of types and a vector of providers. Then we would define `re_register_renderables()` as: \r\n\r\n```julia\r\nfunction re_register_renderables()\r\n  for T in renderable_types\r\n    register_renderable(T)\r\n    for provider in providers\r\n      register_renderable(T, provider)\r\n    end\r\n  end\r\nend\r\n```\r\n\r\navoiding any method overwriting entirely. \r\n\r\n    \r\n\r\n"}}
{"actor":{"display_login":"shashi"}}