While the majority of the time, we would want to leave the existing JS components to work their magic as is, there are times when business requirements are drastic enough to make the whole component unusable. Thinking in terms of PHP classes, we can imagine that class A implements X, whereas we want to have a completely different implementation of X, let's call it B, that shares very little with A. This is a case where simply having B extends A would not suffice, so we opt for directly B implements X. While there are no interfaces in pure JS, this does not mean we cannot completely replace one concrete class with another, as long as we ensure those few crucial methods are available via the new class.
Replacing JS classes is easy with Magento. Let's imagine we want to fully replace the redirectUrl component.
We start by creating the...