Open sistla001 opened 6 months ago
Can you pls share your code?
Can you pls share your code?
@manfredsteyer - Thanks for your reply. Here is the sample repo I created to demo this - https://github.com/sistla001/mfe-poc
It has 3 projects
1) ng-shell - Angular shell - npm start
serves on localhost:4200
2) ng-mfe1 - Angular remote - npm start
serves on localhost:4201
3) react-mfe2 - react remote built using @originjs/vite-plugin-federation - npm run preview
serves on localhost:4173. I used https://dev.to/abhi0498/react-micro-frontends-using-vite-30ah#setting-up-the-remote-app as an example. remoteEntry.js is http://localhost:4173/assets/remoteEntry.js
http://localhost:4200/mfe1 works! I am having issue with http://localhost:4200/mfe2
Thanks!
I have also created another route called mfe3 to ng-shell, this route is using app-wrapper2 instead of app-wrapper. I am passing the react_mfe2's remoteEntry.js to this and doing the following instead of using loadRemoteModule from @softarc/native-federation-runtime. This is loading the css but content is not loading, looks like some success. I will keep trying and post my research here. Thanks!
private loadRemoteModule(options: LoadRemoteModuleOptions): Promise<any> {
return import(options.remoteEntry || '').then((module) => {
return module.get(options.exposedModule);
});
}
@manfredsteyer does native federation supports a remote built using @originjs/module-federation as in this case?
also, is it possible to create a remote using native federation and load using webpack module federation host?
@renansoares , that's a good question. I'm also looking for an answer.
@manfredsteyer , can you confirm?
Thank you
I have created an Angular Shell and an Angular MFE according to https://www.angulararchitects.io/en/blog/micro-frontends-with-modern-angular-part-1-standalone-and-esbuild/ which works. Then I created a react remote app using https://dev.to/abhi0498/react-micro-frontends-using-vite-30ah#setting-up-the-remote-app
I am getting the following error in the console of the shell app when going to http://localhost:4200/react
Below is my setup
in vite.config.ts of the React MFE1
and in angular shell project, I did the following federation.manifest.json
app-wrapper component:
app.routes.ts
Any help with this regard is very much appreciated. Thanks!