Comments (4)
Polyfills are in deed a little bit tricky. We are using two different approaches here. The first one is conditional execution. So every team ships the polyfills they need, but does not run the polyfill code when it detects its already present. Nice thing here is that fragments don't depend on their environment and are truely self contained.
The other option we are acutally using is to have a set of common polyfills that all teams agree on (like fetch, Promise, Symbol, ...) and include it globally for browsers that need it. This inclusion is done by the owner of the page. The actual polyfill-file is located in a shared repository. I think this globally shared code is fine when you talk about polyfills, because well written polyfills are not subject to change and incompatibility. Wouldn't do this with custom libraries though.
Do you have another concrete example of a library that only allows one instance?
When talking about bigger dependencies like react we leverage webpacks dll feature to avoid duplicate downloads while maintaining the ability to use different versions side by side when needed. We wrap libraries like this in a webpack dll package and provide a central url where the actual bundle can be downloaded from in the browser. This works, but you should be aware that the dll format depends on the webpack version it was built with.
When all browsers support js modules
and import()
the same thing could be done nativly.
from micro-frontends.
One thing to keep an eye on is html modules proposal, which could help create the composition team to compose all the micro frontends together WICG/webcomponents#645
from micro-frontends.
Is it right to claim that with this approach the user will need to download all of the frameworks/libs used by fragments? How did you balance the UX/DX to make this decision?
Micro-frontend makes sense for me on the DX side. I just would like to understand on the UX side. What were the costs of it?
from micro-frontends.
As always it depends on how you implement it. I'll write more in depth about "performance" in the future, but in essance it boils down to "keeping it simple, only include dependencies you really need" and "beeing smart about lazy loading code".
Yes, the micro frontend approach focusses on maintaining high velocity in development by dividing a big application into smaller, easier to maintain parts. So that you don't end up with a big ball of mud nobody understands anymore and is afraid to refactor.
from micro-frontends.
Related Issues (20)
- Top-level routing HOT 8
- Nodemon HOT 1
- Apply for translation HOT 7
- Server Side Rendering HOT 1
- Can we achieve this with angular elements HOT 1
- Micro-frontends as an advantage to using web components with a headlessCMS
- Team Blue Missing! HOT 1
- share common resources between teams HOT 3
- Thanks about micro-frontends concept. HOT 1
- Any ETA for navigation reference? HOT 4
- micro frontend
- Added Portuguese Translation HOT 1
- Added Korean Translation HOT 3
- Misleading diagram wrt frameworks HOT 2
- Why did you start to call component architecture as "microfrontends"? HOT 5
- How to have error handling mechanism in microfrontends? HOT 1
- Universal Composition: Render Call Question HOT 2
- Integrate micro frontend from different repo? HOT 1
- Can we create composite app with React and Jinja Template together?
- Added Polish translation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro-frontends.