@vitormalencar
Module-Federation
Module-Federation
A game-changer in JavaScript architecture
Slide 3
Slide 3 text
MY "WHY" 🤔 ðŸ’
WHY I DO WHAT I DO
I believe it is possible to change
the world through technology.....
Slide 4
Slide 4 text
@vitormalencar
Slide 5
Slide 5 text
@vitormalencar
Slide 6
Slide 6 text
Hi 👋,
I'm Vitor Alencar.
I'm a software engineer!
I helped improve Brazil education I helped
people share their opinions online now I'm
helping people get their money back!
@vitormalencar
Microfrontends are especially useful when we have
projects with dozens of developers working together
in a large business domain
Why Micro
front ends ?
Slide 10
Slide 10 text
@vitormalencar
Microsfot
Google
Airbnb
Netflix
You?
Spotify
Slide 11
Slide 11 text
@vitormalencar
Monolith to Microservices
Slide 12
Slide 12 text
@vitormalencar
MFE similar methodology
Be able to be managed from separate teams
Deploy independently
Small application set
Better Domain separation
Slide 13
Slide 13 text
@vitormalencar
Is about scaling teams
Slide 14
Slide 14 text
@vitormalencar
Sharing code is Hard
and it gets harder and harder on a large scale
Slide 15
Slide 15 text
@vitormalencar
Let's check the current state of tools out there for
code sharing
What are our
options now?
Slide 16
Slide 16 text
@vitormalencar
Slide 17
Slide 17 text
@vitormalencar
Slide 18
Slide 18 text
@vitormalencar
Slide 19
Slide 19 text
@vitormalencar
Slide 20
Slide 20 text
@vitormalencar
Why is hard
NPM is slow
It grows in complexity
Custom-made tools get dated fast
Sharing is usually primitive
Slide 21
Slide 21 text
@vitormalencar
The Goal
Performance
Build Time Easy sharing
Slide 22
Slide 22 text
@vitormalencar
Module federation
Slide 23
Slide 23 text
@vitormalencar
What is module federation
Share modules
Share components
Share Functions
Share data
Over the wire
Slide 24
Slide 24 text
@vitormalencar
The place that webpack is initialized during page
load
Host
application
Slide 25
Slide 25 text
@vitormalencar
Another webpack build that will be consumed by
other application
Remote
application
Slide 26
Slide 26 text
@vitormalencar
What is module federation
Share modules / components / functions / data
deploy independent SPA's
Over the wire at runtime
Redundancy and self-healing powers
Slide 27
Slide 27 text
@vitormalencar
Capabilities
Dynamic updates over the wire
Minimal overhead
No dev env changes
Can be handled by independent teams
Slide 28
Slide 28 text
@vitormalencar
Slide 29
Slide 29 text
@vitormalencar
Slide 30
Slide 30 text
@vitormalencar
Recap
Fast updates
Better control
independent Deploys
Slide 31
Slide 31 text
@vitormalencar
Slide 32
Slide 32 text
@vitormalencar
Slide 33
Slide 33 text
@vitormalencar
Consistency and better updates
Design system
library
Slide 34
Slide 34 text
@vitormalencar
Error Handling
How to catch Errors and prevent runtime white screen
Slide 35
Slide 35 text
@vitormalencar
Error
boundary and
similar
Slide 36
Slide 36 text
@vitormalencar
TS
Support ?
Slide 37
Slide 37 text
@vitormalencar
Sharing State
Handle state changes across MFE's
Slide 38
Slide 38 text
@vitormalencar
It works, just be reactive
Redux
Context
RXjs
Zustand
.....
Slide 39
Slide 39 text
@vitormalencar
Slide 40
Slide 40 text
@vitormalencar
Bidirectional Hosts
Slide 41
Slide 41 text
@vitormalencar
Slide 42
Slide 42 text
@vitormalencar
Slide 43
Slide 43 text
@vitormalencar
Self-Healing Capabilities
Fallback to remote apps vendors if a dependency fails to load.
Slide 44
Slide 44 text
@vitormalencar
Slide 45
Slide 45 text
@vitormalencar
Slide 46
Slide 46 text
@vitormalencar
Dynamic Federation
Handeling module injection at runtime