umijs / qiankun

📦 🚀 Blazing fast, simple and complete solution for micro frontends.
https://qiankun.umijs.org
MIT License
15.84k stars 2.02k forks source link

[Feature Request] I want to expose one seperate module or component to main app, how can I implement this? #2804

Open hanalice opened 1 year ago

hanalice commented 1 year ago

Background

My main app is based on angular, and my sub app is base on angular also. I want to render one component(not the app.component) of sub app in the host app, how can I implement this?

Proposal

I see there has some props named moduleNames and containers cofiguration in registerMicroApps. From my understanding, only if I provide the right module names and containers, qiankun should render the correct module/element in the specified container. image

Additional context

I have see a issue related with this https://github.com/umijs/qiankun/issues/1397, it recommends to pass parameters from main app to sub app, and let the sub app to do the handle or display logic, but I think it's too complicated for the sub app intergration, and it violates the main idea of micro frontend. From my understanding, mfe aims at modify the sub app in the least effort, and the dynamical loading and rendering logic should be handled by mfe framework, like qiankun.

hanalice commented 12 months ago

@kuitos @gongshun any idea about this scenario?

kuitos commented 12 months ago

I think what you need is webpack Module Federation.

hanalice commented 11 months ago

I think what you need is webpack Module Federation.

so it's not a expected use scenario about qiankun, right?

thanks Kuitos, I would like to look into webpack Module Federation, and currently I turn to Web Component, and it also can work.