eweitz / ideogram

Chromosome visualization for the web
https://eweitz.github.io/ideogram
Other
288 stars 72 forks source link

Improve offline handling in related genes kit #311

Closed eweitz closed 2 years ago

eweitz commented 2 years ago

This makes the related genes kit more robust to network connection loss, and reduces reliance on third-party services.

Previously, related genes ideogram would fail to complete its first initialization on a given page load, if:

Now, the related genes kit always uses data from its service worker cache. This means third-party APIs are no longer called at run-time for end users; only occasionally at cache-build-time by Ideogram developers. This reduces load on upstream bioinformatics API servers, and makes it easier to develop the related genes kit while e.g. on a train.

Web workers were investigated as part of this, but shelved due to an issue in Webpack (https://github.com/webpack/webpack/discussions/14066).

This also substantially refactors service worker caches to consolidate redundant code and improve commentary.

coveralls commented 2 years ago

Coverage Status

Coverage increased (+1.06%) to 86.645% when pulling 84963c7c48bc37c69ff927e7441f782fff5a5073 on offline-cache into 9a5d4cc9ffda2bd670395bbe7543c39600b302be on master.