Glitch-lily would benefit from a rewrite
The whole Mastodon frontend relies heavily on a one-time-fetched initial state, as well as a pre-initialized locale. This means these two need to be there before we load anything from the React hierarchy.
In a vanilla glitch/mastodon, this is provided by the backend. Here, we do not want backend changes, so we modified the parts that take the initial state to the ones coming from the store
, as meta in the initial state will go to the store anyway.
But the more we change this, the harder we would be when keeping up with upstream.
Here is another possibility: we could do the state initialization, and then lazily load Mastodon stuff ( https://reactrouter.com/web/guides/code-splitting ), in such way that the scripts that requires pre-initialized state and locales are only loaded after we have set up everything. The setup could still happen within React, though we would need some way to tweak that.