When debugging unexpected re-computations in a Shiny app, what package does 'Mastering Shiny' recommend for visualizing the reactive graph? Additionally, explain what 'invalidation' means in the context of the reactive graph and how it contributes to minimizing unnecessary work, as described in Chapter 14.
Navigate to 'mastering-shiny.org'. Go to Chapter 14, 'The reactive graph'. Locate the recommended package for visualizing the reactive graph. Read section 14.4 'An input changes' and its subsections (14.4.1, 14.4.2, 14.4.3) to understand the invalidation phase. Formulate an explanation of invalidation and its role in minimizing unnecessary work. State the recommended package and provide the explanation of invalidation.
Identify 'reactlog' as the recommended package for visualizing the reactive graph. Accurately explain 'invalidation' as the process where Shiny marks reactive expressions or outputs as 'dirty' or needing re-execution when their upstream dependencies (inputs or other reactive expressions) change, including the three phases: invalidating the input, notifying dependencies, and removing existing connections. Explain that invalidation ensures Shiny performs the 'minimum amount of work' by only re-computing parts of the reactive graph that are truly affected by a change, thus preventing unnecessary re-computations and optimizing performance.