-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bidirectional Module Federation Sharing is Not Working – Browser Hangs on Startup with Numerous Warnings #180
Comments
This is indeed a very important issue. Version 1.1.3 is working fine, and I will definitely fix it this week. |
Thanks for the quick response @zhangHongEn but just tested with v1.1.3 and it also has same problem. |
I tried it, but everything works fine. |
@Emehado can you share with us your system info please?
|
@gioboa here you go
|
@Emehado You are doing a recursive scenario 🤔 |
@gioboa, The purpose is to be able to share code vice-versa. If bi-directional code sharing doesn't work, it means you'd need to have a third MFE which can share code to your host and remotes. If Bi-directional works fine, then you could expose modules from your host to be used in remotes. (eg. sharing color theme state). Also, I'm not sure what you mean by recursive. I found this concept which is supposed to work fine and defined as Bi-directional. Similar case is described here. Is this not correct behavior? |
The problem is that Remote app is loading the Host |
That's just a bad example. I can edit the example repo to only load some component from the host instead of the entire host and the problem would still persist. Also I see your example but wouldn't that also require a rebuild of all dependents? if yes, then that might defeat purpose of runtime code sharing. |
In my example you can share things from mfes without rebuilding anything. I'm looking forward to seeing the new example. |
@Emehado I switched to your branch and did reproduce the issue. Have you tried using Webpack or Rspack? |
This feature can be implemented, but it requires ensuring that @module-federation/core supports it. |
@zhangHongEn I tried using rsbuild which supports this feature but HMR I get from rsbuild was not great (4s) and when I add module federation, it goes nuts. Maybe I'm doing somethig wrong but Vite on the other hand is its still almost instantaneous. That's why I have resolved to use vite thus far. |
@gioboa , I have updated the example branch to only consume a component from the host instead of the entire host. |
Turn off typescript dts stuff. Our remote type generation accounts for 95% of the slowdown. Dts:false on the plugin and hmr will take 50ms or less. |
@ScriptedAlchemy Does rspack support circular references where the host imports a remote, and the remote imports the host? |
Yes. Nested circular and multi cyclic as well as host uses own remote or remote uses hosts remote patterns are all supported |
Thanks @ScriptedAlchemy, But without module federation, HMR was already much slower using rsbuild. Any other pointers that could be causing that? Testing with a fresh project was lightning fast, I would really love to push through with rsbuild if I could get HMR to vite-like speed. |
Do you have a repo or zoom call so I can discuss? Dm me on Twitter. Bytedance has some of the world's largest apps and the slowest hmr on record was 1s, the repo is 40gb |
There is a problem with bidirectional module federation between micro frontends. Upon loading the application, the browser hangs and is unresponsive, with numerous warnings in the console.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: