· JavaScript
Maljanovic study shows micro-frontends have better architecture but worse Lighthouse runtime performance
The practical reality of development teams often involves grappling with an ownership decision—should the selected project's state persist in the component, the global store, the URL, or the server…
The practical reality of development teams often involves grappling with an ownership decision—should the selected project's state persist in the component, the global store, the URL, or the server cache after a refresh? When this choice isn't explicitly declared, the state defaults to the most convenient location, leading to subsequent features reading it and other features modifying it. Runtime metrics alone fail to capture this creeping entanglement, as the dependency graph silently accrues edges, frequently resulting in cycles.
While teams naturally focus their optimization efforts on measurable aspects like API latency, bundle size, expensive rendering, caching mechanisms, and Lighthouse suggestions, these green dashboard indicators overlook a critical aspect: how tightly bound the application's components are. A front end can achieve measurable speed gains while simultaneously becoming significantly more challenging to modify. Performance tooling observes the application while it is running, offering little insight into the consequences of developers making alterations.
The optimization cycle is familiar territory: heavy bundles prompt code splitting, costly rendering necessitates memoization or list virtualization, and slow requests call for CDN or caching improvements. These factors are all tracked via build metrics and Core Web Vitals. However, these figures do not illuminate the underlying dependency structure—specifically, how many modules import a particular module (afferent coupling, Ca), how many modules it references (efferent coupling, Ce), its inherent instability (I = Ce/(Ca + Ce)), or if the module graph contains any cycles. This structural information is also quantifiable; tools such as Nx, madge, and dependency-cruiser can calculate it during CI, and ESLint boundary rules can enforce it. Yet, these structural metrics are rarely placed alongside Lighthouse scores.
This disconnect manifests during routine tasks. A simple requirement, such as "remember the selected project after refresh," immediately exposes this ownership ambiguity.
A controlled comparison recently brought these two dimensions into sharp focus. Maljanovic duplicated the same React/Vite application in two ways: once as a modular monolith and again as a shell composed of eight Module Federation remotes, each dedicated to a distinct business domain. Across both setups, the implementation was assessed using structural metrics (cohesion, coupling, and cycles derived from a custom dependency-graph script), production build time, emitted bundle output, ESLint findings, and Lighthouse runtime performance. The structural analysis favored the micro-front ends, showing higher cohesion and zero dependency cycles when contrasted with the monolith's single cycle. Conversely, the reported runtime data told a completely different story: every Lighthouse timing was several times slower, the emitted JavaScript was approximately 27 times larger, and the build process took roughly ten times longer. This demonstrated that superior architectural separation did not translate into better performance in this specific measurement, emphasizing that the way things are measured is crucial.
Practitioners must approach these figures with caution. The substantial 27x difference in bundle size largely stems from how the size was aggregated; the study summed the JavaScript output from the shell and all eight remotes. In the Module Federation setup, even when the runtime utilizes a single shared instance, shared libraries might still be emitted in every build as a fallback. Therefore, the reported number reflects duplication stored on disk, not necessarily duplication transmitted over the network.
The runtime outcomes also require nuanced interpretation. While the micro-front-end application involved more script fetches and requests, the disparity in the absolute values between the two Lighthouse reports—due to the use of different presets—means they are "not strictly comparable." The build-time variance warrants similar scrutiny: 113.84 seconds represents the wall-clock time for the shell plus the eight remotes, and since incremental rebuilds were not tracked, the metric that genuinely improves with micro-front ends, namely rebuild scope per change, is absent by design.
Despite these caveats, the measurement artifact highlights a genuine operational hazard. When sharing isn't explicitly configured—which is the default outcome without dedicated engineering effort—Cam Jackson’s widely cited caution applies: “If every micro front end includes its own copy of React, then we’re forcing our customers to download React n times.” The vendor payload scales linearly with the number of remotes (Figure 2). Two practices emerge from this: one must measure the bytes delivered at the network level, never simply summing build artifacts, and the shared scope should be treated as a versioned contract between remotes, rather than a mere build flag.
This does not invalidate the study, but it refines its message. Its lasting contribution is methodological: architecture and performance must be evaluated as distinct dimensions, with their respective limitations stated transparently. The ultimate conclusion for any given organization hinges on the quality of its integration layer engineering and the honesty with which it is measured.
In enterprise shells—host applications paired with product remotes, recently augmented by rapidly proliferating AI assistant interfaces—the pattern I frequently observe is that coupling intensifies precisely where performance dashboards offer no visibility. AI remotes exacerbate this issue, often arriving with substantial dependencies (like markdown rendering, syntax highlighting, or sanitization) that must either reside in the shared scope or be duplicated across every remote. The effective, albeit mundane, practice involves creating an ownership map before any coding begins (e.g., the URL owns shareable filters, the server cache owns persistent entities, and each surface manages its ephemeral UI state), establishing a versioned contract at every seam between remote and shell, and implementing a CI gate that rejects any merge introducing a new dependency cycle. Once cycles are successfully eliminated, the key metric to monitor becomes the blast radius—the quantity of modules affected by any given modification. When the median of this radius increases, boundary erosion occurs long before any user-visible metric registers a change.
Three key approaches should be adopted. Firstly, establish ownership before commencing development; every significant piece of state must have a single designated owner, such as a route, client store, server cache, or derived layer. Secondly, measure architecture independently from performance, tracking cycles, cohesion, coupling, and modules affected per change alongside Lighthouse scores and bundle size, utilizing graph tooling within CI rather than relying on sporadic audits. Thirdly, institute boundaries only where genuine pressures exist: differing deployment schedules, distinct ownership domains, or scaling requirements. Simply having more modules does not equate to superior architecture.
The study ultimately suggests that for most small-to-medium applications, the modular monolith provides the most favorable cost-to-benefit ratio, reserving the overhead of micro-front ends for situations where teams are geographically dispersed and releases must operate independently. Jackson's warning carries an organizational weight: many minor complexities require a level of maturity to manage without descending into chaos.
Performance work remains indispensable. The error lies in assuming its metrics constitute the entire picture of front-end quality. A front end must address two fundamental questions: "How fast is it?" and "How difficult is it to change?" Only the former has default dashboards. The second question requires its own set of metrics: cycles maintained at zero, module instability, and blast radius per change. Whether your front end operates quickly today is the less compelling issue; the structural integrity that allows the next modification to remain contained is the question that accumulates significance over time.
Why it matters
This highlights a critical gap in development tooling: performance dashboards often hide underlying architectural decay. Developers need to integrate structural analysis with runtime metrics to ensure applications remain flexible as they grow.