I have code-splitted presenters set up in a sequence such that (after getting all the necessary data in stages using user driven background rpc calls) when user finally finished the last action (clicks a button), the placeManager does a revealPlace for the application presenter.
Every thing works very nicely like it should. So far so good.
The issue is that the presenter to show is pretty complex and is code splitted (async provider), and it takes a significant time to get that javascript and load the presenter.
So I'm trying to see if there is a way to asynchronously get the code for that presenter during the slow times while waiting for user input (prefetch the presenter code on demand early), so that when when the user completes all steps and the presenter is revealed, the delay can be minimized.
To be clear, I am NOT talking about getting data asynchronously from the server, that is working fine. I just want to make the code splitted javascript for the presenter made available to the browser during the slow user-action dependent stages so that particular presenter is ready to display when desired. I also don't want to undo codesplitting because that will just make the first presenter load up slower. Right now, the first presenter loads up fast, there's a bunch of user steps, during which I would ideally like to prefetch compiled javascript for the next presenter (which is big), so that it can load fast on the browser.
I imagine this is a very common pattern, so someone must know how to do this easily right? I would greatly appreciate any advice.
Thanks!!