fizalihsan / microfrontends

0 stars 0 forks source link

Micro Frontends 101 #1

Open fizalihsan opened 5 years ago

captainJack33 commented 5 years ago

Micro-FrontEnd Architecture

Problem we are trying to solve

Screen Shot 2019-04-05 at 3 24 27 PM

Current architecture

Monolith SPA front-end and microservices back-end

Screen Shot 2019-04-05 at 2 53 42 PM

Pain Points

Screen Shot 2019-04-05 at 2 53 55 PM

Micro Frontends + Microservices

What is MicroFrontEnds?

Micro Frontends

Reference

Single Responsibility Principle - Each Micro Frontend is responsible for a specific feature or functionality or aggregation of cohesive functionality

Promotes

Core Ideas behind Micro Frontends

Be Technology Agnostic

Each team should be able to choose and upgrade their stack without having to coordinate with other teams. Custom Elements are a great way to hide implementation details while providing a neutral interface to others.

Isolate Team Code

Don’t share a runtime, even if all teams use the same framework. Build independent apps that are self contained. Don’t rely on shared state or global variables.

Establish Team Prefixes

Agree on naming conventions where isolation is not possible yet. Namespace CSS, Events, Local Storage and Cookies to avoid collisions and clarify ownership.

Favor Native Browser Features over Custom APIs

Use Browser Events for communication instead of building a global PubSub system. If you really have to build a cross team API, try keeping it as simple as possible.

Build a Resilient Site

Your feature should be useful, even if JavaScript failed or hasn’t executed yet. Use Universal Rendering and Progressive Enhancement to improve perceived performance.

MicroFrontEnds approaches

Recommendation

Reference Links

https://opencomponents.github.io/

Blog

Building Microfrontends Part I — Creating small apps Building Microfrontends Part II — Joining apps together

Video reference materials

Micro Frontends: Break Up You Web App! Micro Frontend Architecture - DAZN

Git reference materials

https://github.com/neuland/micro-frontends/blob/master/index.md#additional-resources https://github.com/rajasegar/awesome-micro-frontends https://medium.com/@tomsoderlund/micro-frontends-a-microservice-approach-to-front-end-web-development-f325ebdadc16 https://github.com/willmendesneto/micro-frontend-react-pages https://github.com/topics/micro-frontends

Good examples