mizx / module-federation-examples Goto Github PK
View Code? Open in Web Editor NEWExamples showcasing Webpack 5's Module Federation
License: MIT License
Examples showcasing Webpack 5's Module Federation
License: MIT License
I think the nested example is not 100% accurate.
https://github.com/module-federation/module-federation-examples/tree/master/nested
Yes "technically" it works, but if the main goal is to mimic the functionality of un-federated modules (i.e npm packages). this example is not accurate.
the way in nested example gets it working is by including the remote address from app2 and app3 in the index.html. however this is not accurate as when we are using dep A in package.json
, we do not need to include the deps of dep A. we simply include depA like so:
dependencies: {
"depA": "version1"
}
vs
dependencies: {
"depA": "version 2",
"depA_subDep": "versionX"
....
"depA_subDepX": "..."
}
the current approach you have means that the host application needs to know each remote sub dep address (in the case of example, app3). which is not feasible at all.
imagine if this is a complex application, where app2 has multiple sub dependencies...that means the host app1 needs to know each of these.
what is lerna function for?
Hello @mizx,
I have been testing the examples you have in the repo and it works really well!
However, I have been trying to do one little thing different with the Host one, in my project I have a legacy of a app running Play Framework 1.4.3, but they needed to use ReactJs, but not enough time to switch all the frontend to React (5 years of project).
So, I have create some small micro apps and injected in the HTML the react app that I wanted. Thats work but it is a big hack and will be harder and harder to maintain as it grows.
<script src="/public/reactJS/app.bundle.js"></script>
Have you tried to connect the same module federation in a dumb HTML or in a different app without NodeJS? or is it even possible?
Sorry, it was the place that I could find someone that know more about this new tech.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.