<

Everything you need to know about Micro Frontends

I have read more than 100 articles related to Micro Frontends (listed in the reference article). What I learned about Micro Frontends is documented in this post. I also leave my research notes in the following repository.

https://github.com/silverbirder/think-micro-frontends

Origin

https://www.thoughtworks.com/radar/techniques/micro-frontends

Achievement Companies

  • Airbnb
  • Allegro
  • Amazon
  • Beamery
  • Bit.dev
  • BuzzFeed
  • CircleCI
  • DAZN
  • Elsevier
  • Entando
  • Facebook
  • Fiverr
  • Hello Fresh
  • IKEA
  • Klarna
  • Microsoft
  • Open Table
  • OpenMRS
  • Otto
  • Paypal
  • SAP
  • Sixt
  • Skyscanner
  • Smapiot
  • Spotify
  • Starbucks
  • Thalia
  • Upwork
  • Zalando
  • ZEISS

ProsCons

Pros

PerspectivesContent
Independence- Can be developed by any technology and any team
Deployment
Deployment- Ensure end-to-end (back, front, deploy) execution of specific functionality
Agility・Distributing work among teams with the best knowledge of a particular domain will certainly speed up and simplify the release process.
・ Smaller front-end and release means a much smaller regression test surface. Fewer changes per release, theoretically reducing the time spent on testing.

・ Smaller costs for front-end upgrades/changes

Cons

PerspectivesContent
Independence-There tend to be teams that cannot be independent and are interconnected
-Many functions require changes across multiple micro-front-ends, reducing independence and autonomy
-Sharing libraries is not a problem in itself, but avoiding arbitrary boundaries created by improper division Using it as a comprehensive location causes problems.
- Building communication between components is not only difficult to implement and maintain, but also removes independence of components
- Changing all micro-front ends with changes to cross-cutting concerns reduces independence
DeploymentThe site-wide CI / CD process, which includes partial implementations of larger features that cannot be released separately
.
Agility-Duplication of work occurs
- As a result of reduced detectability, some standard components cannot be shared, resulting in duplicate implementations between individual front-ends.
・ Without a shared cache, each component must pull down its own data set, resulting in a large number of duplicate calls.
PerformanceImproper implementation of the micro-front end may result in poor performance.

Integration Patterns

https://bluesoft.com/micro-frontends-the-missing-piece-of-the-puzzle-in-feature-teams/

Integration NameSelection CriteriaTech
Server-side integrationGood loading performance and search engine rankings are project priorities・Podium
・Ara-Framework
・Tailor
・Micromono
・PuzzleJS
・namecheap/ilc
Edge-side integrationsame as server-side integration・Varnish EDI
・Edge Worker

CDN
・ Akamai
・ Cloudfront
・ Fastly
・CloudFlare
・ Fly.io
Client IntegrationBuilding interactive applications that need to integrate the user interfaces of different teams into a single screen・Ajax
・Iframe
・Web Components
・Luigi
・Single-Spa
・FrintJS
・Hinclude
・Mashroom
Integration at build timeTo be used only for
small projects (3 teams or less) when other integrations seem very complex
・ Bit.dev
・ Open Components
・ Piral

Function

Communication

https://developer.mozilla.org/ja/docs/Web/API/CustomEvent

https://github.com/postaljs/postal.js

Data share

  • Storage
    • URL
    • Cookie
    • Local Storage/Session Storage

Module share

  • webpack

https://webpack.js.org/concepts/module-federation/

https://webpack.js.org/configuration/externals/

https://webpack.js.org/plugins/dll-plugin/

Routing

Vaddin router

https://vaadin.com/router

Cache

https://developer.mozilla.org/ja/docs/Web/API/Service_Worker_API

https://developer.mozilla.org/ja/docs/Web/API/IndexedDB_API

Authentication

  • JWT

https://jwt.io/

Measurements

  • Google Analytics
  • Navigation Timing API
  • Resource Timing API
  • High Resolution Time API
  • User Timing API
  • Frame Timing API
  • Server Timing API
  • Performance Observer

Real User Monitoring

  • SpeedCurve
  • Catchpoint
  • New Relic
  • Boomerang.js
  • Parfume.js
  • sitespeed.io

Synthetics Monitoring

  • Lighthouse
  • WebpageTest

Proxy

Composition proxy. Combine templates.

https://github.com/tes/compoxure

Access History

https://developer.mozilla.org/ja/docs/Web/API/History_API

Split Policy

Policy on Splitting the Front End

  • Horizontal division
    • Split by elements in the screen
    • Business functionality
  • Vertical division
    • Split by screen

Web site ⇔ Web app

Microfrontends: An approach to building Scalable Web Apps
Microfrontends: An approach to building Scalable Web Apps

Micro front ends are best suited for most of the middle portion of the band, where there is considerable overlap. Trying to implement a micro front-end architecture for projects that fall at the extremes of the band is contrary to productivity, they say.

Repository

PatternsProsConsTechnologies
Mono RepositoryEasy access to the entire codebase.
(Highly detectable)
Mono repositories tend to run
slower, especially when working with large teams, and increase the number of commits and files under version control.
- nx.dev
- lerna
Multi-Repository- Multi-Repository is best when you have a very large project and a
very large team working on it.
In a multi-repository environment, each micro-application must be built
individually.

Other Architectures

Books

https://www.manning.com/books/micro-frontends-in-action

Reference Articles

If it was helpful, support me with a ☕!

Share

Related tags