Description
What's the current behavior?
When working with iOS and Android there is a need to keep some level of control over which remotes and versions are used because some SDK updates may prevent a remote from being usable with OTA updates.
In order to resolve this we are creating an environment for each platform and each binary version that is shipped to the app store / play store.
This has a level of complexity that needs to be managed in the module federation config.
new Repack.plugins.ModuleFederationPluginV2({
remotes: {
remote1: resolveRemote1(platform),
remote2: resolveRemote2(platform),
remote3: resolveRemote3(platform),
},
}),
There is an additional level of complexity that comes with cache keys because currently Re.Pack leverages the URL as the cache key. The caching breaks when Zephyr uses the same URL and serves different versions as the environment updates for OTA updates.
What's the expected behavior?
We're working through this with Repack via customizing the URL resolution to append the remote app version from mf-manifest.json (as well as probably independently caching those in addition to the js bundles), but it seems like a more natural solution would be something like this:
- Providing a way to fetch a collection of remote URLs from Zephyr for a platform and a version / environment.
- Zephyr deploys would change the return value of this remote url endpoint or a timestamp on it that can be used for caching
- No need for heavy Re.Pack customization
Alternatively we could look at appending the url's with semver, that would serve as the cache key, that then can be cache checked against the response from Zephyr