Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Examples of micro front-end architectures using Webpack (Module Federation), vanilla JS & front-end libraries

NotificationsYou must be signed in to change notification settings

ahadb/micro-front-ends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

There are many front-end architectural styles in our modern world today, one that has gained some popularity over the past couple of yearsis the micro front end-architecture. This repository explores architecture in code so we can have a clear understanding of how this works.We're not concerned with the functionality, data or features in each app, just with how the overall flow and control in the context ofcreating such an architecture.

A little more on micro front-ends:

Micro front-ends replace monolithic Single Page Applications that are built using one code base into multiple applications each having theirown code base (...hence micro). These smaller applications are decoupled and contain their own set of features and modules.

There are some advantages in using this architecture:

  1. In a large application multiple teams can work in complete isolation on their slice or micro front-end
  2. Each micro front-end in turn is easier to grasp and each engineering team focuses solely on changes to their micro-front-end
  3. Each micro front-end can use completely different modules and rendering frameworks. This essentially means that we can use Angularfor one application and React for the other (thought one stack should be used throughout, but note that this is possible)

A tremendous amount of considerations come into play but what's important to understand is that in a micro front end architecturewe have a container that acts as the parent for all other micro front ends to render into. The container, which itself is an app, delegatesand decides when and where to load it's children.

Another key takeaway here is that a distinct understanding of how Webpack (or similar bundler) works is crucial to setting up this typeof architecture. We use Webpack Module Federation and Vanilla JS/DOMe to achieve this in our contrived example. Ultimately we can easilyrefactor this to use a more sophisticated rendering framework such as React or Vue (along with any third party NPM modules needed)

We can have a look at the tree to see that we indeed have a similar structure for of all our micro front-ends:

.├── README.md├── container│   ├── package-lock.json│   ├── package.json│   ├── public│   │   └── index.html│   ├── src│   │   ├── bootstrap.js│   │   └── index.js│   └── webpack.config.js├── mfe-app-one│   ├── package-lock.json│   ├── package.json│   ├── public│   │   └── index.html│   ├── src│   │   ├── bootstrap.js│   │   └── index.js│   └── webpack.config.js└── mfe-app-two    ├── package-lock.json    ├── package.json    ├── public    │   └── index.html    ├── src    │   ├── bootstrap.js    │   └── index.js    └── webpack.config.js

About

Examples of micro front-end architectures using Webpack (Module Federation), vanilla JS & front-end libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp