module-federation-repack
module-federation-repack copied to clipboard
Should fast refresh hmr work?
I see it's disabled right now, enabling it works for the host app but not the remotes.
Is this expected? Is there a way to get it to work?
Yes this is expected. Based on my knowledge it's not possible without some magic trickery inside Re.Pack and generated code. To me the cost and shakiness of such support is not really worth it and I would suggest to develop apps/containers in standalone more for HMR.
I think there's some prior art on the web: https://github.com/module-federation/module-federation-examples/blob/master/react-hmr/README.md
Is there anything that can be taken and ported to native? Would this model work? Or is there some drawback in repack that prevents it?
Looks like the example from the link is missing some files/implementation.
Aside from that, Re.Pack has custom Webpack HMR client. The default one doesn't work for React Native. The main problem with HMR in MF is that we would need to be able to differentiate if the update should do HMR in which container.
Right now, I'm not sure where would the potential blocker be. It might be Webpack, Re.Pack or @pmmmwh/react-refresh-webpack-plugin
problem or a combination of them.