Introduce a JsComponentInstanceUpdater that allows prop shape ("type") changes and accepts data loss
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3587711. --> Reported by: [tedbow](https://www.drupal.org/user/240860) Related to !1015 >>> <h3 id="overview">Overview</h3> <ol> <li>It's a reality today that you can change the type of a prop of a code component </li><li>@lauriii confirmed at <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3586187" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3586187</a></span> to want this:<br> <blockquote><p>[&hellip;] for props we should be allowing them to be changed regardless if the component is in library or not.</p></blockquote> </li></ol> <p>This is NOT a safe operation. Data loss occurs. But for code components, this is considered acceptable.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <ol> <li>Introduce a JsComponentInstanceUpdater that allows prop shape changes and accepts data loss </li><li>Test coverage: <a href="https://git.drupalcode.org/project/canvas/-/merge_requests/1015/diffs#note_821171">https://git.drupalcode.org/project/canvas/-/merge_requests/1015/diffs#note_821171</a> </li></ol> <h3 id="ui-changes">User interface changes</h3> <p>Auto-updating of existing component instances that populate a prop whose shape ("type") changes <em>works</em>.</p> > Related issue: [Issue #3574120](https://www.drupal.org/node/3574120) > Related issue: [Issue #3517941](https://www.drupal.org/node/3517941) > Related issue: [Issue #3509115](https://www.drupal.org/node/3509115) > Related issue: [Issue #3463996](https://www.drupal.org/node/3463996) > Related issue: [Issue #3524751](https://www.drupal.org/node/3524751)
issue