opencobra / memote

memote – the genome-scale metabolic model test suite
https://memote.readthedocs.io/
Apache License 2.0
125 stars 26 forks source link

Reports are very large (~3.7MB) #653

Open matthiaskoenig opened 5 years ago

matthiaskoenig commented 5 years ago

Problem description

The current reports are very large (~3.7MB) mainly due to all the embedded javascript. This will create a lot of issues in the future. Basically every code update of memote will create large diffs in all git repos which contain memote reports. Memote repos could grow very large very fast. Working on larger models cooperatively could have 100s of commits.

Solution: There should be an online version with a very small report footprint which loads the javascript online, but does not hardcode it in every report. I.e. the report just loads the respective javascript for memote via

<script type="text/javascript" charset="utf8" src="https://cdn.something.net/0.9.8/js/memote.min.js"></script>

This is nothing urgent, but it would be very nice to have the option to create such a very slim html report. E.g.,

memote report snapshot --online --filename "report.html" path/to/model.xml
ChristianLieven commented 5 years ago

I totally agree. In fact, we had previously discussed making the report app available as an NPM package and loading it this way.

This could go hand in hand with rewriting the report app in a slimmer framework such as Vue (Currently it is all Angular 7).

Midnighter commented 5 years ago

At the beginning, we also put some effort into bundling everything together because we wanted users to be able to share reports with anyone without requiring them loading additional resources. Your suggestion to make it an option is very reasonable, though. :+1:

matthiaskoenig commented 5 years ago

@Midnighter sounds good. Just reporting this because I just went through this issue in another project where I create HTML reports for SBML models. In the beginning I bundled all the resources (for offline work), but now moved to the solution of just linking the resources and loading them online. My git histories just completely went out of hand. Also I brought things down from a few MBs to ~100kb which is still reasonable.