The size of the startup module should be kept small as described in https://www.mediawiki.org/wiki/Wikimedia_Performance_Team/Page_load_performance#Size_of_scripts
The startup module includes a module manifest that is huge. You can see the manifest by accessing mw.loader.moduleRegistry in your browser's console or in the startup module directly: https://test.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector
I'm wondering why the client needs to be aware of the entire module registry? It seems like it only needs to be aware of the modules it is loading or has loaded? Am I missing something?
I suppose a downside would be the client may attempt to load modules that do not exist, but that seems like a better trade off? What would break if we were to do this?