It's #FrontendFriday

It's #FrontendFriday - The status quo on microfrontend frameworks

,

Yeah, it's #FrontendFriday!

In today's blog post, I would like to show you the status quo of microfrontend frameworks. In our web frontend research group, we are constantly monitoring new technologies and architectures - including since the initial hype surrounding the buzzword Microfrontend. As part of the evaluation of microfrontend frameworks, I was able to determine that two frameworks in particular have proven themselves in recent years as the microfrontend frameworks have established. I would now like to introduce them to you.

First things first: since the start of the microfrontends, the page micro-frontends.org from Michael Geers a must readwhen it comes to gaining a basic understanding of the microfrontend topic.

Geers is also the author of the well-known book "Microfrontends in Action", which I can also highly recommend.

However, before considering which microfrontend framework is suitable for a project, it is essential to ask yourself the following question:

Is a microfrontend really needed?

("we want" !== "we need")

This is only the case if all four questions are answered with "yes.

  1. In general: Is the benefit of independently deployable units in the project in a healthy relationship to the integration effort?
    1. Is it foreseeable that the project will be implemented in several teams (at least 3 teams with at least 2 developers each) in the frontend in the future?
    2. Is it necessary to use different technologies (frameworks/libraries) in the frontend - if so, why?
  2. Is a vertical architecture (microservices) also used in the backend?

If the answer to one of the questions is "no", you inevitably have to critically question whether a microfrontend architecture makes sense, i.e. whether it is economical and sustainable.

Distribution of microfrontend frameworks


Source:https://www.npmtrends.com/qiankun-vs-@teambit/bit-vs-single-spa-vs-piral-vs-oc-vs-@luigi-project/client-vs-frint-vs-node-tailor-vs-puzzle.js
Means npm-trends.com shows very clearly that the single-spa framework is by far the most frequently downloaded and therefore the most widespread. In second place is qiankun, which is based on single-spa and is still considered a "newcomer".

What is the difference between the two frameworks?

qiankun is based on single-spa - but the basic microfrontend setup is different. Therefore, single-spa or qiankun should be selected depending on the requirements.
Both frameworks solve the problem of microfrontends very well - but in different ways. The exact differences are explained in the following table and should help with the selection of the use case.

single-spaqiankun
Motto"javascript router for front-end microservices""Probably the most complete micro-frontends solution you ever met"
"Micro-granularity"Fine: Module loader (microservice approach from the backend to the frontend).
→ Sharing common libs, functions and variables is easy(er). No strict decoupling.
Roughly: App loader (the "generally known" microfrontend approach).
→ The micro apps are to be understood as separate, decoupled applications.
Entry modeJS Entry (via JS imports)
SystemJS
HTML Entry (via HTML tags)
JavaScript SandboxNoYes
Style IsolationNoYes
Global State availableNoYes
Module FederationYes (Webpack 4 and 5)Only under Webpack 5 Apps
Visualization

In summary, it can be said that single-spa is the right framework for a "fine" microfrontend architecture on a module basis, and qiankun is the method of choice for a "coarse" microfrontend architecture with separate, separate apps.

 

Read more about frontend development

Markus Wingler

About ME

Markus Wingler is a Senior Software Developer, specialist team leader for "Fullstack JavaScript Applications" and has been working at doubleSlash since 2010. After successfully completing his training as an application developer, he studied Applied Computer Science (B. Sc.) at the DHBW Stuttgart. His many years of experience have made him an expert in the development and design of modern Web applications in the B2B environment. He also specializes in the field of mobile apps. He is particularly enthusiastic about new technologies and trends in the mobile and web sector.

All contributions from Markus Wingler

Learn more

Further information on our website and in our newsletter

Arrow up