How does Mashroom Server compare to…

Jürgen Kofler
Nov 4 · 4 min read
Photo by bruce mars on Unsplash

A question people ask us a lot is, how Mashroom Server compares to other Microfrontend frameworks.

Well, the first thing you should know is that our actual goal wasn’t the integration of client-side Microfrontends, the core doesn’t even support it (the Mashroom Portal plugin does). The goal was to have some kind of JavaScript Application Server with a flexible end extendible module loading system. The reason is that the company behind Mashroom Server is focusing on JavaScript in (big) enterprises which have some specific requirements:

  1. They prefer off-the-shelf software for integrating and operating there business specific applications. They usually use stuff like Apache Tomcat and IIS instead of writing servers by themselves.
  2. They have a lot of existing infrastructure new components have to integrate with. For example an LDAP server or some monitoring solution.
  3. The have a lot of existing applications (e.g. some SPAs) they need to integrate into a new platform.
  4. The have a lot of uneven skilled developers and external software vendors which they don’t want to get involved with integration and platform details (they should just focus on delivering business value).

The second thing you should know is that there are basically three possible ways to integrate Microfrontends:

  1. At build time (results in a monolith at runtime)
  2. On the server-side (similar to Server Side Includes)
  3. On the client side (the most difficult to handle, this is what Mashroom Portal does)

…single-spa

single-spa helps you to build an Application that feels and works like a monolithic SPA from multiple, independently developed SPAs. That’s a fundamental different approach compared to Mashroom Portal, which allows you to compose Web Pages with a specific Layout and Theme and to use (maybe pre-existing) SPAs as content blocks.

On a technical level the main differences are:

  • With single-spa you have to create an application that loads other SPAs as building blocks. Which requires a module loader, a transpiler, a bundler and so on. For Mashroom Portal an App just consists of a bunch of static resources and a global bootstrap method. So, to integrate an existing SPA you just have to write the bootstrap method and add some metadata to package.json and that’s it.
  • single-spa integrates more tightly with the Microfrontends/SPAs, that allows it to share modules and to load/unload apps based on routing rules. Mashroom Portal cannot. (The possibility to share modules such as React with some kind of DLL will arrive in version 1.2)

Since Mashroom is a platform with security and other built-in services you can also:

  • Place the registered Microfrontend/SPA on a page via Drag’n’Drop
  • Allow the Microfrontends to asynchronously communicate with each other (even with ones in different Browsers)
  • Restrict which users are permitted to see a Microfrontend on the page
  • Access to the current user and language settings (i18n)
  • Proxy all REST API calls through the Portal to avoid CORS problems
  • Change the Look&Feel of the Microfrontend via Theme
  • Load Microfrontends dynamically via client-side JavaScript API

…Project Mosaic

Project Mosaic by Zalando has a bunch of components that helps you with server-side integration of Microfrontends. The Microfrontends are not necessarily SPAs but they could be.

The main differences to Mashroom Portal are:

  • Mosaic integrates fragments service-side, whereas Mashroom Portal integrates Microfrontends on the client-side (in the Browser)
  • Fragments can be any kind of HTML since Mosaic doesn’t need to know any semantics of the stuff it loads. Mashroom Portal can only deal with SPAs.
  • Mosaic cannot dynamically update the page content like Mashroom Portal (and single-spa) does.

tl;td

For the impatient:

  • single-spa focuses on decomposition of monolithic SPAs.
  • Project Mosaic integrates Microfrontends as fragments on the server-side.
  • Mashroom Portal allows it to compose Web Pages from independently developed (and maybe pre-existing) SPAs and is not just a framework but a platform with services like security, i18n, theming and communication.
Jürgen Kofler

Written by

Mashroom Server

The official Medium publication for the Mashroom Server open source project, an Integration Platform for Microfrontends.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade