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

[FR] redesign backend dependencies #4567

Closed
t-bltg opened this issue Nov 29, 2022 · 3 comments
Closed

[FR] redesign backend dependencies #4567

t-bltg opened this issue Nov 29, 2022 · 3 comments
Labels
2.0 enhancement improving existing functionality meta

Comments

@t-bltg
Copy link
Member

t-bltg commented Nov 29, 2022

Some nice design ideas by @mkitti in #4566 (review):

Perhaps we should consider a more radical redesign in the near future?

  1. Each of the pieces of backend glue code could be independent subpackages. GRPlotsBackend, PyPlotPlotsBackend, etc.
  2. Most of the code currently in Plots.jl gets moved to a package named AbstractPlots.jl. All the backend packages depend on AbstractPlots.jl.
  3. Plots.jl becomes a small package which just depends on GRPlotsBackend.jl by default. Via Preferences.jl it can optionally load any of the other backend packages and act as a proxy for that package.

The advantage of this is that each backend now can be precompiled and has its own compiled cache. Also the project dependency tree becomes a bit clearer. One could get all the features of Plots by just doing using SomePlotsBackend.jl directly.

For loading with Requires.jl can then just do @eval using GRPlotsBackend.jl similar to what @timholy recommended here:
https://discourse.julialang.org/t/categoricalarrays-forces-openspecfun-jll-recompilation/87759/18?u=mkitti

The impact here for this PR is still acknowledging that the GR backend is a special case for the current architecture. That is Plots.jl has declared a dependency on GR.jl. One consequence of that special case is that we load GR.jl within Plots.jl rather than Main. Eventually we move that responsibility to GRPlotsBackend.jl.

JuliaLang/julia/pull/47040 or JuliaLang/julia/pull/47695 could help too.

@t-bltg t-bltg added meta enhancement improving existing functionality 2.0 labels Nov 29, 2022
@BeastyBlacksmith
Copy link
Member

  1. Each of the pieces of backend glue code could be independent subpackages. GRPlotsBackend, PyPlotPlotsBackend, etc.

Back in the days (6 years ago) that was how things were done, e.g. https://github.com/JuliaPlots/PlotsGR.jl

@t-bltg
Copy link
Member Author

t-bltg commented Dec 8, 2022

Fixing #4589 would improve the current.

@isentropic isentropic mentioned this issue Jan 12, 2024
37 tasks
@BeastyBlacksmith BeastyBlacksmith mentioned this issue Mar 12, 2024
30 tasks
@t-bltg
Copy link
Member Author

t-bltg commented Apr 17, 2024

Implemented in #4904.

@t-bltg t-bltg closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 enhancement improving existing functionality meta
Projects
None yet
Development

No branches or pull requests

2 participants