Conversation
|
@teunbrand Hi Teun! This is an interesting question. If you decide to implement this, I suggest using a warning, unless you are sure all old plots will not render at all. Sometimes, it can be useful to get some idea of what a plot is about, even if inperfectly rendered. Another thought is that it would be better to use "object versions" than 'ggplot2' versions. Why issue an error for a change from version 4.0.1 to 4.0.2? I would change the label only when there is a significant compatibility break. In such a case, the warning (or error), could give the 'ggplot2' versions that can render the object as a range, which would be a lot friendlier to users in the case they cannot rebuild the object. |
|
Thanks for your thoughts Pedro! I get that this would be easier from a user perspective, but from a maintenance point of view it'd become tedious to test and verify if there is between-version compatibility and doing the bookkeeping. It is not even guaranteed for minor version updates. People can share plots with themselves and oneanother as data + code, or as graphics, but shouldn't do this as ggplot objects. |
This PR aims to fix #6714.
Whenever a plot is created, the new
versionproperty is populated with the current version.If a plot is to be rendered, an error is thrown if the plot's version is not the same as the current version.
This should typically occur when a plot has been saved to disk with a prior version of ggplot2, and now no longer works.
There are a few open questions:
We can also do a revdepcheck to weed out all the packages that misbehave.