salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

When renaming LWCs, assistance should be provided for destructive changes

Open randi274 opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. With the new SFDX: Rename Component, we are not yet providing support for destructive changes. This can provide a strange user experience when they've Renamed the component, and no longer have access to the old metadata, but it still exists in the org. To delete the component you typically have to run SFDX: Delete from Project and Org, but after renaming the component you no longer have access to that old component.

Describe the solution you'd like Option 1 - (Easier) Duplicate the component to create one with the old name, and keep the old component for the user to delete. Option 2 - (Preferred) Create a more guided deletion experience where we don't let them rename until they've updated old references, and then perform destructive changes on behalf of the user. Option 3 - (Less Preferred) Create a destructiveChanges.xml for the user so they can delete the old component once they're done?

Additional context Example of a confusing workflow:

  1. Rename component using the new command
  2. Deploy new component
  3. Navigate to Org Browser and refresh LWCs
  4. See that the old component is still available, and can be retrieved (and then deleted this way as well, but what a roundabout way to get there)

randi274 avatar Apr 21 '22 16:04 randi274