MorphRemovalReconciliation

Reconciliation that handles the case where the a morph is removed from a component definition. This usual entails removing the spec that corresponds to that morph, and also removing the mentions of the morph or any of its submorphs in the derived component definitions.

Constructor

new MorphRemovalReconciliation()

Methods

applyRemovalToDependant(interactiveDescriptor)

Apply the source code transformation to the definition of a component derived from the component where the change originated from.

Parameters:
NameTypeDescription
interactiveDescriptortype

description

applyRemovalToOrigin(interactiveDescriptor)

Applies the source code transformation to the definition of the component where the change originated from. We need to differentiate between alteration of an interhited structure via without() or the simple removal of a spec (add() or part() or {}) from the submorphs array in the component definition.

Parameters:
NameTypeDescription
interactiveDescriptorInteractiveDescriptor

The descriptor of the component definition the change originated from.

dropSpec(interactiveDescriptor)

Removes a morph from the 'submorphs' property of a component definition. If there's only one morph left in the 'submorphs' array, the entire 'submorphs' property will be removed. The method updates the changes array with the appropriate removal actions and marks the associated module for linting.

Parameters:
NameTypeDescription
interactiveDescriptortype

The descriptor pointing to the affected component definition.

insertWithoutCall(interactiveDescriptor)

Reconciles the removal of a morph with the replacement or insertation of a without() call that denotes the structural change in the structure inherited from the parent component.

Parameters:
NameTypeDescription
interactiveDescriptorInteractiveDescriptor

The component descriptor of the definition getting reconciled.