Officially, CodePush is only supported if you're not using Code Splitting.
With Code Splitting, the support is not official. It should be still possible to use Code Push, but you might face unexpected difficulties. In general, the usage of Code Push should be limited to the main bundle and the rest should rely on Caching & versioning to invalidate and download new scripts.
The process of using Code Push with Code Splitting could be described as follows:
- Bundle the application using Webpack and Re.Pack.
- Upload scripts to a server/CDN.
- Release application to the store.
- Make changes to the code.
- Change the
bodywhen resolving script in resolver added to
- Bundle the application using Webpack and Re.Pack (and build other scripts and containers when using Scripts/Module Federation approach).
- Upload scripts to a server/CDN under new
bodyfrom point 5.
- Push main bundle using CodePush.
resolvefrom a new main bundle is called, it should return different
body, which will cause cache invalidation and new script will be downloaded.
Re.Pack is not an alternative for CodePush, and both projects aim to accomplish different use cases.
Code Push works only on the main bundle, meaning all local chunks will not be updated by Code Push.