mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-16 20:18:00 +00:00
8ba5c0f773
Make the Popups, MobileFrontend, and MinervaNeue JSDocs consistent. For Popups, specify package.json, readme, and default template options and moved doc/ to docs/ and autogenerated JavaScript documentation from doc/autogenerated to docs/js. http://usejsdoc.org/about-configuring-jsdoc.html http://usejsdoc.org/about-commandline.html http://usejsdoc.org/about-configuring-default-template.html Bug: T188261 Change-Id: I81e64f06265f1ecc4e2ee159deef9b204ea7e957
1.2 KiB
1.2 KiB
2. Contain and manage state
Date: 09/11/2016
Status
Accepted
Context
The hardest part of debugging Page Previews issues (especially those related to EventLogging) was understanding the state of the system (the "state") and how it's mutated given some interaction(s). This was in no small part because the state was defined, initialized, and mutated in various parts of the codebase.
The state required for Page Previews to function isn't actually overly complicated. To keep things easy to debug/easy to reason about we should endeavour to isolate the state and its mutations from the various other parts of the system.
Decision
Use Redux.
Consequences
- Newcomers will have to familiarise themselves with the library (especially it's nomenclature).
- All changes will have to be broken down into: the additional state that they require; actions that are dispatched; and how the state is mutated as a result of those actions. This requires discipline.
- We benefit from using a tool that is part of an increasingly rich ecosystem, e.g. see Redux DevTools Extension.