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

Move DashBase.to_dash type-piracy definitions to DashBase repo #221

Closed
etpinard opened this issue Jul 31, 2023 · 2 comments · Fixed by #223
Closed

Move DashBase.to_dash type-piracy definitions to DashBase repo #221

etpinard opened this issue Jul 31, 2023 · 2 comments · Fixed by #223

Comments

@etpinard
Copy link
Collaborator

etpinard commented Jul 31, 2023

import PlotlyBase
import JSON
function DashBase.to_dash(p::PlotlyBase.Plot)
data = JSON.lower(p)
pop!(data, :config, nothing)
return data
end

import JSON
function DashBase.to_dash(p::PlotlyJS.SyncPlot)
data = JSON.lower(p.plot)
pop!(data, :config, nothing)
return data
end

are defining DashBase.to_dash methods on type the Dash module does not own. This is type-piracy!

We should move these method definitions to https://github.com/plotly/DashBase.jl inside package extension modules with PlotlyBase.jl and PlotlyJS.jl as weakdeps.

@etpinard
Copy link
Collaborator Author

related: #214

@etpinard
Copy link
Collaborator Author

etpinard commented Jul 31, 2023

After resolving this issue, we'll be able to drop PlotlyBase as a dep.

Moreover, we'll be pretty close to dropping all references to the JSON package, with the exception of

reply = JSON.parse(HTTP.payload(resp, String))

tested = json.loads(dashjl.wait_for_element("#tested").text)

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 a pull request may close this issue.

1 participant