Basics of ButterCMS versioning and history
For a more in-depth overview of ButterCMS versioning and history functions, see Revision history.
Components can be thought of as mini schemas; in the same way that a Page Type schema defines the structure of the fields for the entire Page instance, a Component defines the structure of the fields it contains.
ButterCMS provides versioning and history for the content of a Page instance or Collection item via its history feature, but the schemas themselves are not tracked. As such, there are limitations to be aware of when it comes to Global Components, particularly when it comes to restoring previous versions.
Some changes made to a Global Component affect all versions of the Page in the Page’s history. This is necessary so that we are able to restore previous versions of your content without also affecting all other Page content that uses the Component.
Component changes and current versions
Imagine that your Component Library included a Navigation Global Component that was used on two Page Types, A and B, and you had created two Pages (or instances) of each of these Page Types.
If you made a change to this Component, such as adding a field, you would create four new drafts of Page content, i.e., one draft for each Page instance for each Page Type.
Component changes and versions in history
Imagine that you now want to revert Page Type A to a previous version. Because the Component is a Global Component, reversion would not only affect Page Type A, but also Page Type B, meaning it would likely be a breaking change for your content.
To avoid breaking linked content, ButterCMS edits the previous versions of your content stored in history when you make a change to an included Global Component.
Without these changes, it would be impossible to restore previous versions of your Page content, as the changes to Component structure would affect all other content that shares the Component.
It is important to proceed carefully with changes to Components in your Component Library and make sure you will not need to restore content that includes these fields.
Adding a field to a global Component
All previous versions of this Page in the history would now show this field in the Component, albeit with a blank value.
Deleting a field from a global Component
If you deleted a field from the Global component, all previous versions of the Page in its History would no longer have that field on the Component.