[META] We'd like to modernize the MG codebase

Author: hamiltonCreated Feb 8, 2018Updated Jul 21, 2020
Labelsenhancementcode quality

Our high-level aim over the next few months is to get Metrics Graphics into a more modern state. This codebase was developed in another era, and in a ES-averse manner.

The library works as we'd expect. In theory, the code is reasonably clear enough to read and contribute to, if you're comfortable with the idiosyncratic and outdated style of the JS we used when we were last contributing full-steam. But the second-order effect is that it's much more difficult to add new features, test, and have fruitful contributions from others because no one writes JS this way anymore, and that hurts MG.

This issue will reflect discussion & the high-level steps needed to make this happen.

  • remove stale dependencies (particularly all references to bootstrap and jquery)
  • clarify the data-to-graphic pipeline and make it much clearer
  • update the general code to reflect modern ECMAScript standards, suitably decomposed for better testing
  • update the build system to reflect modern practices
  • migrate to a testing framework that is faster and easier to use, like Jest

We will be tackling these refactors in a series of PRs over the coming months.

Source: metricsgraphics/metrics-graphics