Live data from Hacker News

Microfrontends should be a last resort

breck-mckye.com

81–90 of 143 posts

Re: Microfrontends should be a last resort

#81

Most of the implementations of MFEs I've seen are reliant on webpack or Single-SPA (which by default uses webpack under the hood). vite, esbuild, parcel etc. have not adopted anything around this. To me, that says that those putting out the nuts and bolts work that having been leading this space for several years either haven't spent alot of time evaluating them, or have found them overly complex for what they are, o…

The examples that are publicly available and written about, are in my opinion all suffering from a too low level of abstraction. They are more tech demos of possible implementation options, for such an architecture, but as they are all contrived to demonstrate some mechanism, but the not a single of the examples would be actually justify that kind of architecture.

I am working on a MFE shell application for a product (or rather a suite of closely related applications/products), that need to be presented to the users as a single system. Ballpark figure of the business unit 400+ software developers and 80+ modules/sub-products.

I think the MFE architecture was a justified trade-off, given our organizational structure and product landscape, but one should be very cautious if it is presented as a some kind of default solution.

Re: Microfrontends should be a last resort

#83
Isn't the name misleading? When hearing "microfrontend" one might think that it is a technology to make frontend code smaller. But it is the opposite: there are more static resources (because you build a multi-megabyte file for every page or section of the site), and a proper name would be "megafrontend", where "mega" reflects the order of JS/CSS file size.

Re: Microfrontends should be a last resort

#85
post #79

I think microfrontends are the ultimate extension of what I call "the myth of code reuse". Everyone thinks because they can create "small reusable slices" of full frontend code that this comes for free without a load of problems that get in the way of the mythical land. The only issue is everyone who has tried microfrontends is universally full of regret. Other attempts at this are: 1) having an enforced centralised…

Microfrontends are about independent development, not code reuse. They work fine if you understand their purpose.

I was on an MFE team earlier this year. It was sold to higher-ups as being for both, but I think in most cases it's bad for both. IME, it was sold in terms of code code-reuse by providing things like shared navigation bars, shared authentication logic, etc.

My team, at least, did not have the necessary support structures in place to help others who wanted to maintain their own UI. I see this mostly when crossing framework/language boundaries (mixing React + Angular in a SPA, as it was in my case). They declare microfrontends, but then all the component libraries were all React-based anyways.

It just ended up being a mess of N deployment processes, N build systems, N storage buckets, zero standardization whatsoever, and mountains of technical debt, all without much benefit.

...but if you're all working in the same language/framework where that component/style-lock-in is acceptable, why would someone use a microfrontend to begin with? Can the organization not set up a single repository with different teams contributing to it? One deployment, one build system, one storage bucket, and standardization?

IMO CODEOWNERS is the original and best "microfrontend" solution for small-to-medium-sized teams working on a single product. If you have hundreds or thousands of engineers (think FAANG) working on a single experience that just HAS to be a SPA, then maybe you have the resources to build out those support structures and actually get MFEs to work on an organizational level.

In the vast majority of cases, however, I see it as a bandaid on an organizational problem that's eaten up because it's an interesting technical challenge for senior engineers to think about (someone made a great comment about "drawing the perfect box"), and because management thinks it's a cool trend with benefits they can grok.

Re: Microfrontends should be a last resort

#86
post #72

> Microfrontends are very popular on the conference circuit, so I am probably about to make future job interviews awkward by criticisng them. This has been my experience with conferences lately: Way too much emphasis on the next big trend, to the point of being counterproductive for actually getting work done Certain teams and companies live and die by conference trends. If you can't also show interest in those trend…

Disclosure that I'm closer to full stack/generalist than frontend engineer. Have you tried not going to conferences? I'm saying that with a good bit of sarcasm, but frankly look at where a lot of these things occur and who speaks at them. They occur in huge cities that curiously have beaucoup tech companies; companies that we know incentivize promotion based on things like "personal brand" and new project development…

Also, those sexy companies want you to use the hot new thing because they’re selling the pickaxes. AWS sponsor a lot of educational platforms and conferences on cloud for a reason, for example.

Re: Microfrontends should be a last resort

#88
Author makes some solid points. I've seen the road from "monolith" to "microservices" that was actually a descent into a quagmire of "distributed monolith" -- it's supremely inefficient. So much more time is dedicated to the churn vs feature development, it's depressing.

Wanting to couple that with the JS ecosystem, I don't even want to imagine that.

Re: Microfrontends should be a last resort

#89
post #65

Earlier quoted context omitted.

>They hired a lot of "smart" developers, but they also took forever to ship anything. Oh man does this resonate with me. Some of the "smartest" people we've hired have also been the slowest to deliver as they waffle and perfect and theorize and play with the tasks they have.

That's something I didn't get for a long time There is a difference between being smart and effective

I love the word effective and use it all the time.

It almost immediately gets rid of a lot of idealism.

Re: Microfrontends should be a last resort

#90
post #79

I think microfrontends are the ultimate extension of what I call "the myth of code reuse". Everyone thinks because they can create "small reusable slices" of full frontend code that this comes for free without a load of problems that get in the way of the mythical land. The only issue is everyone who has tried microfrontends is universally full of regret. Other attempts at this are: 1) having an enforced centralised…

Microfrontends are about independent development, not code reuse. They work fine if you understand their purpose.

[deleted]
Post reply on HN