statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
154 stars 29 forks source link

Internal code refactor: Build, modules, and classes #189

Closed abought closed 4 years ago

abought commented 4 years ago

Purpose

We would like to make the LocusZoom internals more accessible to other developers, as well as clean up a variety of undefined and legacy usages.

Plan of work

  1. Convert existing namespace files (layouts, data, etc) into Es6 modules. Provide a compatibility shim for old usages (and continue building to UMD), but encourage people to use "true" classes rather than a series of slightly incompatible ways LZ currently does things.
    • This is intended to unlock better code readability, better extension support and a potentially smaller build size.
  2. Convert opaque classes with dynamically assigned members into Es6 classes, where members and defaults are set in constructor
    • This should help with "undefined" errors in less common usages
    • Moving definitions outside the registry should also help us to support JSDoc directly.
  3. Move build system to webpack with unit tests directly run via mocha (with --esm flag until native esm lands with Node 14 LTS)
    • This will simplify debugging by shortening slow rebuild cycles and enabling easier code coverage integration. Having gulp as an intermediary complicates a variety of tasks.
  4. Switch to automatically generated (eg JSDoc) documentation for LZ internals
abought commented 4 years ago

Fixed in #193.