Live data from Hacker News

Microfrontends should be a last resort

breck-mckye.com

141–143 of 143 posts

Re: Microfrontends should be a last resort

#141

Earlier quoted context omitted.

This gets you most of the advantages of a microfrontend: 1) Monorepo with multiple workspaces 2) With several separate independently deployed applications, each maintained by a separate team 3) That share a set of common packages for common stuff (auth, etc) with full typescript definitions 4) Add CI to typecheck if any shared package changes types you get errors 5) Preferably with the packages being able to be indep…

First off, I appreciate the thoughtful write-up, under different circumstances this is the direction I’d probably be heading. However our web Frontend code is all currently in a large-ish (500 packages, 100 apps) monorepo and we’re actively pursuing breaking that up into a hybrid repo model, largely in the interest of true team autonomy. We want our code organization to better reflect our Eng org structure and to est…

Fair enough, probably far bigger scale than I am used to. But I wonder why move away from a monorepo? Publishing and versioning common packages is a huge pain in the ass, especially for JS projects where you need transpiling, sourcemaps, etc.

Some smart branch management so teams can work independently seems better for me. For example each project gets their own production branch and development branches to trigger deployments and can pull changes from master as they see fit.

If you are planning on these shared components and dependencies be versioned I highly advise against that, the permutation of versions of underlying common libraries (like React) can make an incompatible versioning hell where component X works on React ^16.0.0 but in practice was tested in React ^18.0.0 only. In my own project I explicitly force all shared dependencies (which I try to keep to a minimum) to be on the same version.

> without the need for built-time coupling

There are two ways of having build-time coupling:

1) Shared build/bundling code, configuration and tools

2) Single build/bundling for all the code

You can most definitely have independent projects sharing the same build/bundling code, configuration and tools while every project is built separately and independently. This can make it hard to integrate with solutions that rely on taking over your bundling though.

Re: Microfrontends should be a last resort

#142
post #136

Earlier quoted context omitted.

Yes that is true, but the other side of that coin is that deploying changes to the interface between modules is now hard - that's the tradeoff space. If you have really clear interfaces with low churn then you probably have a net win, but in my experience it's really hard to get those interfaces right and that cost can end up beating your gains.

Not sure what you mean. Changes to the interfaces in modular monolith are much easier than in microservices. You just release new version with updated interfaces - no need for versioning if you update interface and its usages. In case of microservices you must do versioning and either have to keep and support old version of the interface or spend some time to determine when to remove it.

Oops I replied to the wrong comment. I meant to reply to the parent and was trying to say the same thing

Re: Microfrontends should be a last resort

#143

I am currently investigating the use of microfrontends in our company. We have multiple web apps (Angular, but also some legacy JSP ones) that are currently hosted on different domains. Some of them are part of a product suite (see JSP), and some of them are separate products themselves. However all of them target the same users : 1. Our Customers 2. Our employees (dev, service, support teams) Those products have a c…

[dead]
Post reply on HN