gecko-dev/devtools/client/inspector/animation
Razvan Caliman da154ce911 Bug 1464876 - Load reducers on-demand in Inspector sidebar panels r=gl
The Inspector [loads all its panels' Redux reducers](https://searchfox.org/mozilla-central/source/devtools/client/inspector/reducers.js) up front, regardless if they're used or not.
Some of the reducers are quite hefty. It seems needless to load and parse code that's not needed.

In addition, the reducers are loaded in a different place than their corresponding actions. Actions are loaded and used in the panels, but the reducers are all loaded in the [Inpector when creating the store](https://searchfox.org/mozilla-central/rev/d69ec052bed8700af7a283e37b60b4af22734930/devtools/client/inspector/store.js#8,11). It helps reduce the cognitive load if actions and reducers are loaded together where they are used, in the sidebar panels.

This patch uses the approach described in the Redux docs to inject reducers on-demand: https://redux.js.org/recipes/code-splitting/#reducer-injection-approaches

There still are reducers which need to load immediately when the Inspector is initialized (mostly related to the Rules panel). But others, like the reducer for the Animations or Fonts panel, are loaded on-demand when the corresponding panels are visible.

For the most part, reducers are used in response to actions from their corresponding panels. However, the grid, flexbox and grid highlighter reducers are also [used  in HighlightersOverlay.js](https://searchfox.org/mozilla-central/rev/d69ec052bed8700af7a283e37b60b4af22734930/devtools/client/inspector/shared/highlighters-overlay.js#502) to provide highlighters with configuration or node context. In these cases, we load the reducers on-demand even if their corresponding panels haven't been opened yet. When the panels do get opened, the reducers are not re-loaded since they're already available.

Differential Revision: https://phabricator.services.mozilla.com/D67008

--HG--
extra : moz-landing-system : lando
2020-04-07 18:19:13 +00:00
..
actions Bug 1596686 - Use absolute paths for require calls r=gl 2019-12-27 12:23:47 +00:00
components Bug 1622996 - Refactor devtools codebase to use optional chaining (automated changes). r=jdescottes 2020-03-19 21:13:38 +00:00
reducers Bug 1596686 - Use absolute paths for require calls r=gl 2019-12-27 12:23:47 +00:00
test Bug 1620194 - Remove test-actor-registry and expose simplified helpers in shared-head.js r=ochameau 2020-03-18 09:29:58 +00:00
utils Bug 1596686 - Use absolute paths for require calls r=gl 2019-12-27 12:23:47 +00:00
animation.js Bug 1464876 - Load reducers on-demand in Inspector sidebar panels r=gl 2020-04-07 18:19:13 +00:00
current-time-timer.js
moz.build