π What is Micro Frontend? π
π What is Micro Frontend for?
π How does it work?
π How do we create one?
π What is Micro Frontend?
π What is Micro Frontend for? π
π How does it work?
π How do we create one?
π What is Micro Frontend?
π What is Micro Frontend for?
π How does it work? π
π How do we create one?
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Feed me</title>
</head>
<body>
<h1>π½ Feed me</h1>
<!--# include file="$PAGE.html" -->
</body>
</html>
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
ssi on;
rewrite ^/$ http://localhost:8080/browse redirect;
location /browse {
set $PAGE 'browse';
}
location /order {
set $PAGE 'order';
}
location /profile {
set $PAGE 'profile'
}
}
routeMap:
"/": "/index.html"
"/thiscompany": "/companyHub/pages/thisCompany.html"
"/jobs": "/companyHub/pages/jobs.html"
"/contacts": "/companyHub/pages/contacts.html"
"/reviews": "/companyHub/pages/reviews.html"
<fragment id="ch-background-image" slot="ch-background-image"
timeout="30000" async></fragment>
<fragment id="ch-meta-data-header" slot="ch-header"
timeout="30000" async></fragment>
<fragment id="ch-jobs" slot="ch-block-main"
timeout="30000"></fragment>
<fragment id="ch-assets" slot="ch-block-end"
timeout="30000" async></fragment>
fragments:
ch-assets: http://localhost:8080/assetslinks
ch-background-image: http://localhost:8080/v1/background
/companyId/{companyId}/lang/{langName}/?{additionalParams}
ch-jobs: http://localhost:8080/v1/jobs/companyId/{companyId}
/lang/{langName}/?{additionalParams}
ch-meta-data-header: http://localhost:8080/v1/header
/companyId/{companyId}/lang/{langName}/?{additionalParams}
π standard libraries
π tracking
π a/b tests
import {
PubSub,
CANDIDATE_PROFILE_EVENTS,
} from '@stepstone/pub-sub';
class LoginModal extends React.Component {
public componentDidMount() {
PubSub.subscribe(
CANDIDATE_PROFILE_EVENTS.SHOW_LOGIN_MODAL,
(msg, data) => { /* ... */ }
);
}
}
PubSub.publish('CANDIDATE_PROFILE_SHOW_LOGIN_MODAL');
PubSub.subscribe(...);
PubSub.publish(...);
element.addEventListener(...);
element.dispatchEvent(...);
PubSub.subscribe(
'myEvent',
(msg, data) => { /* ... */ }
);
PubSub.publish('myEvent');
element.addEventListener(
'myEvent',
(msg, data) => { /* ... */ }
);
element.dispatchEvent(
new CustomEvent('myEvent')
);
π What is Micro Frontend?
π What is Micro Frontend for?
π How does it work?
π How do we create one? π
π¦ code repository
π¨ build plan
π― deployment plan
π code style
π code samples
π build and deployment scripts
π easy to switch teams and projects
π easy to share knowledge and solutions
π better performance
βοΈ React
βοΈ React DOM
π polyfills
π other common libraries
π over 100 versions in 1 year
ποΈ repository of 135 megabytes
import styled from '@stepstone/dresscode-react';
const Example = styled.section`
padding: 0 ${(props) => props.theme.spacings.spacingXS};
background-color: ${(props) => props.theme.colors.accent};
font-size: ${(props) => props.theme.typography.fontSizeM};
`;
import {
ThemeProvider,
getThemeVariables
} from '@stepstone/dresscode-react';
const theme = getThemeVariables('stepstone');
ReactDOM.render(
<ThemeProvider theme={theme}>
<Example/>
</ThemeProvider>
document.getElementById('root')
);
{
"breakpoints": {
"screenXSMax": "767px",
"screenSMax": "767px",
"screenMMin": "768px",
// ...
},
"colors": {
"black": "#222222",
"grey": "#8e97a4",
"white": "#ffffff",
// ...
},
// ...
}
(monorepo)
(monorepo)
1. βοΈ battle test
2. πββοΈ propose
3. π review
4. π merge and release
5. π replace
π run unit tests
π check code coverage
π run performance and accessibility tests
π templating engine
π application skeleton and related processes
π common styling
π library of components
π end-to-end tests
π tracking
π a/b tests
π What is Micro Frontend?
π What is Micro Frontend for?
π How does it work?
π How do we create one?
π slides: soofka.pl/slides/microfrontends
π article: medium.com/stepstone-tech