originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.39k stars 241 forks source link

Shared dependencies is loaded sequentially #594

Open ElielGez opened 7 months ago

ElielGez commented 7 months ago

Hello, I noticed that when I'm putting shared dependencies inside federation plugin it's loading those dependencies sequentially and not in parallel, This is causing bad performance when page first init.. Maybe I'm missing something, but couldn't find anything related to this in docs

Versions

Reproduction

Please see the waterfall chart below: image

Steps to reproduce

Just set federation plugin like this: federation({ name: 'host', filename: 'remoteEntry.js', remotes: { }, shared: ['react','react-dom','uuid','bowser', etc..] }),

What is Expected?

Load in parallel to reduce loading time

What is actually happening?

Loading sequentially

infantito commented 2 months ago

@ElielGez , how do you solve it? I have the same issue.

zhangHongEn commented 1 month ago

https://github.com/module-federation/vite/blob/e5f0faac8ee9fcb98e3c179d70ad88f198206fdb/examples/vite-vite/vite-remote/vite.config.js#L31 Using manifest.json can help preload, which is very beneficial for performance.

wwff commented 1 month ago

您好!您的邮件我已收到

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hello! I have received your email

liuwanlong commented 1 month ago

the same problem,what is the solusion?

image