One aspect of scaling a frontend architecture is cleaning up unused resources. This frees memory for new resources that get created as the user interacts with the application. JavaScript is garbage-collected, meaning that once an object doesn't have any references to it, it's eligible for collection the next time the collector runs. This gets us partway there; in that, there's no need to manually allocate/de-allocate memory. However, we have a whole other category of scaling issues, and they're all related to the lifecycle of components.
In this section, we'll talk about the scenarios where we want to reclaim unused resources and how this generally happens in frontend architectures. Then, we'll look at the challenges that component dependencies present, in the context of lifecycle management. Finally, we'll look at memory leak scenarios. Even with the best tools in place, there's always the possibility that our code has done something to circumvent memory...