Overview
In #3567413: When editing a Canvas entity with a component tree (e.g., page, template, or region), automatically upgrade component instance versions for cases where there's no impact on existing data we added the infra for updating component instances to the latest (active) version if possible.
However, there's a benefit to doing intermediate updates when we cannot update to the latest (active) one, but at least a more recent one:
a) Consistent UX if there are many instances of the same component. We might not be able to update all of those to the active one, but we can minimize the number of different widgets/UX each one might be using, providing a (more) consistent UX.
b) Reducing the number of versions in use. This way we can clean-up unused past versions of a Component config entity at some point.
Proposed resolution
Expand \Drupal\canvas\Plugin\Canvas\ComponentSource\GeneratedFieldExplicitInputUxComponentInstanceUpdater so, when an upgrade to the active one is not possible, we iterate through them from most recent to oldest, and check if that update can happen.
Comments
Comment #2
wim leers#3567413: When editing a Canvas entity with a component tree (e.g., page, template, or region), automatically upgrade component instance versions for cases where there's no impact on existing data landed ⇒ this is unblocked? Except AFAICT this should wait until all of #3463996: [META] When the field type, storage/instance settings, widget, expression or requiredness for an SDC/code component prop changes, the Content Creator must be able to upgrade's children are done?