The alternative is to bundle every dependency for the entire application in one file to be loaded up front. This is problematic as it would entail, for example, the charting library used by the acquisitions module being downloaded before a patron could be viewed. Indeed, it would be needed even to display the login screen.
Since this is not something that affects the API exposed to module authors I'm not tackling it right now. Especially as v4 is still in alpha and subject to change. Additionally, we may as well wait until we move to Webpack 2.
It is important that we be able to leverage Webpack's "code splitting" feature. It creates bundles of code that are loaded on an as-needed basis.
http://webpack.github.io/docs/code-splitting.html
The alternative is to bundle every dependency for the entire application in one file to be loaded up front. This is problematic as it would entail, for example, the charting library used by the acquisitions module being downloaded before a patron could be viewed. Indeed, it would be needed even to display the login screen.
Before https://folio-org.atlassian.net/browse/STRIPES-24#icft=STRIPES-24 we were able to implement this with the getComponent() callback in the react-router v2 API. react-router v4 does not currently supply a direct equivalent, instead, one must implement it oneself:
https://gist.github.com/acdlite/a68433004f9d6b4cbc83b5cc3990c194
http://blog.netgusto.com/asynchronous-reactjs-component-loading-with-webpack/
Or include another dependency (this does not seem widely adopted yet):
https://github.com/jtmthf/react-router-match-async
Since this is not something that affects the API exposed to module authors I'm not tackling it right now. Especially as v4 is still in alpha and subject to change. Additionally, we may as well wait until we move to Webpack 2.
Definitely something essential for MVP though.