The Smallest of Frontends 😂
Mircrofrontends is the broad idea that your frontend is a service that can be independently deployed and interacted with via HTTP
Header
App
localhost:3001
localhost:3000
GET
Host
Remote
Mircofrontends is the idea but they can be implemented quite differently
Header
App
localhost:3001
localhost:3000
GET
Host
Remote
index.html
<script src="localhost:3001/index.js"></script>
App.tsx
<ui-header></ui-header>
Header
App
localhost:3001
localhost:3000
GET
Host
Remote
webpack.config.js
plugins: ModuleFederationPlugin({
  remotes: {
    header: 'header@localhost:3001/remoteEntry.js'
   }
})
plugins: ModuleFederationPlugin({
  exposes: {
    header: '../src/Header'
   }
})
webpack.config.js
App.tsx
const Header = React.lazy(() => import('header/Header'))
Header
App
localhost:3001
localhost:3000
GET
Host
Remote
importMaps.json (client, server)
index.html
<application name="header"></application>