9 ms·
Microfrontends should be a last resort
- toasted-subs 3y agoOkay I think we have crossed a line here. What's the difference between microfront ends and a website with multiple pages? Wouldn't the point be to keep the style consistent anyway?
- DanielHB 3y agousually microfrontends have some shared UI and functionality core and several applications under them. This usually comes in the form of a shared top-bar and authentication layer as well as some kind of loader/routing to load each specific frontend. Keeping style consistent is actually harder using microfrontends compared to shared libraries. It is more about letting each application choose its own tech stack and not be burdened by the other application's tech debt.
- ktsangop 3y agoI 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 complex way of authenticating and storing user data, since we haven't got a centralized auth server. So we keep multiple copies of user data, and authentication mechanisms, which leads to duplication, trouble in syncinc changes etc. Also, our customers, need to log in to different systems each time they need to work on 2 separate products, let alone that the UI/UX might be quite different. This leads to frustration, confusion and bad UX in general. At the moment, we are implementing a centralized authentication service, which means that we can finally integrate users across systems. However we are trying to re-architect our frontend applications also, that's why I've been exploring microfrontends. My first attempt, will be to integrate the Angular apps under a single login page which leads to a host app that will only handle : 1. Users (login/logout/manage) 2. Navigation (Send me to the required web app) I have already used module federation (webpack) to integrate a new web app (module), into an existing product and it has been working fine for some time. So I am exploring integrating all of the Angular apps under a single host (new webapp), and using module federation (or whatever else works) to fetch and run the other modules, with routing (lazy loaded, remote modules) It's worth noticing that our 2 main products I am trying to integrate, are Angular SPAs that use the same UI framework, and similar UI/UX. There are 2 (currently) small-sized teams that work in these projects, and they have their own release cycles. Each project has its own backend service. The issues I have identified so far are : 1. Angular/package upgrades must be done simulatneously (if we care about performance, and don't want multiple copies of the framework downloaded and running in the same page) 2. JWT token sharing/refreshing (Since everyone will live under the same domain, we can share auth tokens in cookies/headers, but we require a mechanism for all apps/modules to request a token refresh, and a way to communicate user status changes : user logs out, permissions have changed etc) (p.s. Backend services - hosted in separate domains - will of course have to integrate the new Auth service, and inspect/validate the shared JWTs) 3. ALthough module federation might work for Angular SPAs, we will have to implement a separate mechanism for importing JSP apps (iframes probably?) and the way we share JWTs with them. Since I've read a lot of constructive critisism on the issue here, I would love any feedback regarding my approach. Is there anything else I should explore? I've thought about NX monorepos, with separete CI/CD pipelines for each project, but that looks more complicated from where I stand. Thanks in advance.
- tjosepo 3y ago[dead]
- _uhdj 3y agoMy friend works at a company on an internal product where they are using MFEs, and it is a sisyphean marathon of pain. They're only 2.5 developers -- .5 because one of their juniors is practically useless. The reason they went with it is because the "senior" in charge wanted to experiment, which can be all well and good in certain contexts, but they've had nothing but trouble. Instead of doing the reasonable thing and stepping back and thinking "Okay, solving <very common frontend problem> shouldn't be this hard. Maybe we should rethink this MFE approach", the "senior" just keeps piling more turds on top of their already huge, steaming pile of turds. Examples: The MFEs(which live in iframes) need to be able to tell the umbrella that a certain keyboard shortcut was pressed. Normally this would just be an `addEventListener` call by whatever component is interested.. but with iframes it's not that simple. Solution? Capture every keystroke in the application in all the MFEs and send them, as JSON, over your custom messagebus. Because they use graphql(with apollo client), every graphql request should be cached and you can set up "rules" to do optimistic mutations and whatnot. You should be able to show a lot of UI instantly to the users because you already have data cached. But the caching obviously doesn't work across iframes.. so they tack on yet another hacky solution to transport the cache across iframes sometimes when it's necessary. Anyway, the point isn't to rant about this specific scenario forever, but rather explain how fucking awful MFEs can be when you make the wrong decision. They are very obviously building a monolith and MFEs should never have been considered, even if you don't look at the team size of 2(which is enough to make the decision ridiculous on its own). I honestly don't think there are any real use cases for MFEs outside absolutely massive organizations working on very specific kinds of products.. maybe stuff like cloud platform management UIs.
- tusharmath 3y agoThe iframes can share service workers if they are all on the same origin. I would recommend using a service-worker which intercepts every graphQL request and caches on that layer. You can do a lot more on that layer once it's setup. For example — Enable batching, Rate limiting etc.
- darepublic 3y agoI was working somewhere earlier this year that was thinking about going into micro frontends. To me the frameworks seemed pretty immature. I had perhaps naively thought when I first heard about micro frontends that they would be a bunch of iframes that you could compose together on a page, each with its own data fetching logic and thus reuse stuff that was otherwise totally disparate. But someone pointed out some practical difficulties of doing this and I agree it would be quite tough to pull off. It seemed like micro frontends just were trying to get the benefits of a monorepo but with everything in separate repos. And then having some complicated build logic so that hypothetical team could be working in angular 2 and hypothetical team b could be working in react and they could harmoniously mingle their work, in page divided blocks. i.e. at least as it was proposed where I was you couldn't mix and match components on a page, it was just 'route a will use one micro fe, route b will be another'. I'm wondering is this how micro fe is actually done? To me it seems pretty hackneyed and basic, not to mention if you wanted to do this monorepo would be more suitable.
- phendrenad2 3y agoMicrofrontends are just another example of a design pattern. The problem is developers think that they can solve any problem by stacking design patterns in the right order. At some point you need to write the code that makes your app work. Your special sauce. But people procrastinate by obsessing over which patterns they will use.
- anotherhue 3y agoMicro-anything tends to cause engineering orgs to spend more time drawing boxes and fantasising about what tech would be 'just-perfect' for that particular box than actually considering their users needs. The killer truth is, the connections between your components start to become more important than the components, and the work to maintain this system is only really justifiable if the components can be worked on in parallel. But that never happens, and now you spend all your time trying to herd cats. Embrace a monolith, modularise the code, discuss your work with your colleagues so you don't step on each others' toes. We're here to build systems, not pet-projects/fiefdoms. There is no software architecture that will allow you to work in isolation.
- mjr00 3y agoSeparate services helps a lot with bigger teams. No matter how much you modularize code -- which will gradually fall apart anyway unless you have custom tooling that enforces API boundaries programmatically -- you're still tying people to the same runtime environment, which means you're tying people to the same libraries and underlying framework/operating system. Which means major library upgrades become nonstarters (too much code to test/change), and runtime upgrades are rare and challenging (hello, enterprises still running Java 6/7). There's a balance and the "every function should be a microservice" approach is kind of insane, but "just use a monolith for everything" falls apart pretty quickly at larger team sizes.
- anotherhue 3y agoYou're right, I didn't give any numbers. IMO for every dozen engineers you are allowed one monolith (but now you call it a service).
- marcosdumay 3y ago> but now you call it a service What is a problem in itself. On every sane place, most of the "services" aren't providing any on-demand service, instead they are just thematic monoliths doing all of a part of a task. I'm settling on the opinion that a service-based architecture is always wrong. But people keep calling the good architectures by that name.
- earthboundkid 3y agoMicrofrontend was such an obviously dumb idea. It's just a pretty name for tech debt.
- mjr00 3y ago> So let’s say our frontend app is a hairball that’s full of interdependencies. How do we break that link? I think engineers - and managers! - are so excited about the prospect of escaping the monolith, they forget about the intermediary stage of actually chopping up the hairball. Absolutely this, true in both the back and front ends. The first step to breaking apart any monolith is the extremely boring refactoring process. People want to skip over this because it's not the sexy cool part where you're using Kubernetes and lambdas or whatever other tech will look great on your resume. But I'll say that every monolith->microservice (or MFE) move that I've seen, whether or not it was successful was entirely determined by if the upfront refactoring work was done.
- baz00 3y agoI am always frowned upon when I describe our product as a monolith with network hops. These just add more network hops, complexity, latency and projects to upgrade every 30 seconds.
- klysm 3y agothankfully the network never fails, is fully synchronous, and doesn't require any configuration
- jchanimal 3y agoMy persuasion is opposite. As software development gets easier we should expect the pendulum to swing back to custom apps that are fit for purpose, and those have a natural gravity towards this style of architecture.
- nforgerit 3y agoI think there's more fruitful discussions to be had, e.g. which editor is to be preferred or which programming language is best.
- rahkiin 3y agoSpaces are superior over tabs
- Ensorceled 3y agoYears ago, long BC, I was at a tech conference and the CTO of a local tech giant gave a talk on micro services that was very good and touched on some of these same points. They, in fact, refactored in the monolith and then broke it out into micro services but, surprisingly, never shipped the refactored monolith ... they just kept it running full test suites as more and more of its features were carved off into micro services until the test suites were running entirely on the micro services. They shipped that. During the Q&A somebody asked a question about their company's struggle to move their monolith to micro services and the CTO asked two questions that, at the time, was very illuminating: how many teams did they have and how many developers were in their tooling team. When they said they had a relatively small team the CTO said "you don't have any of the problems micro services solve, why are you switching".
- simonbarker87 3y agoI worked at a place that added micro frontends and it made an already horrible app and stack an order of magnitude harder to work on. Avoid unless you know you reallllly need them.
- Aurornis 3y ago> 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 trends, they don't want you. I was asked to review hiring practices for the front-end team at a company I worked for a couple years back. They had a long list of questions about the latest web technologies and frameworks that they used to screen candidates. I was puzzled because we didn't use many of the technologies they listed. Several of them weren't even stabilized standards that could be used in production. The team lead explained that knowing about them was his primary signal for someone's overall competence. They hired a lot of "smart" developers, but they also took forever to ship anything. They were always trying to do things like micro front-ends, rewrite part of the app in the latest framework, experiment with new web technologies that were too immature to ship, and other things that weren't really related to getting product out the door.
- rglover 3y ago> The team lead explained that knowing about them was his primary signal for someone's overall competence. God help us.
- js8 3y ago> God help us. Good luck, I think God is too busy refactoring his Perl code.
- nickpeterson 3y agoI think we both know it’s all lisp.
- sakjur 3y agoThe worst thing about configuring emacs is when you accidentally create a pocket universe and now you have to keep that process running.
- jmull 3y agoI see orgs trying to use micro-things to solve problems caused by a lack of high-level direction, architecture, design and organization. The problem is, micro-things require better high-level direction, to avoid becoming a tangle of poorly integrated, poorly performing, expensive things. If end users can tell you're using micro-frontends, you've done it wrong. If you need 20 people in 10 meetings to change your app's chrome, you've done it wrong. If you don't know how and why these problems won't crop up for you before you've gotten started, you're going to be doing it wrong. You need a strong architecture group, and the buy-in of the micro-thing implementors to take responsibility for their place in the whole to pull off.
- makeitdouble 3y agoFWIW, these architectures tend to follow the org or business entities (there must be a catch name for that phenomenon). Solving a balkanized, poorly integrated services often goes through restructuring the business teams and realign them under a single umbrella. I see it as the poster child for "solving technical problems through social solutions"
- esafak 3y agohttps://en.wikipedia.org/wiki/Conway%27s_law https://en.wikipedia.org/wiki/Conway%27s_law
- gedy 3y agoMicro frontends are mostly trying to solve organizational issues, from what I’ve seen. You have some teams or individuals who really want to use a different tech for their project, or get away from legacy code without rewriting it, etc. I interviewed at a place a couple months ago that was looking for an front end architect, and all the assumptions and questioning were that their use of microfrontends (both angular and react) was a good thing and how would I make teams follow this approach. They passed on me when I made it clear that I didn’t think it was a very good approach for their smallish team, and in general that the challenges they were experiencing were mostly because of this architecture, not solved by it.
- Raidion 3y agoI think it's less about the technology than the organizational structure. If you have more than one monolith (aka any company with an acquisition) you either have to have it in code in two places (gross) or as a library. If you have it as a library, then you have N version bumps to do an N pipelines to deploy. Not hard technically, but tons of overhead. This means that you lose independence and doing A/B testing becomes very difficult when you can't really control what the user is seeing because the version is pinned. A micro front end allows you to deploy independently, test independently, and truly own your code. Network hops are reasonably cheap for most consumer applications and collaboration on a shared component is very expensive. I'm speaking from the perspective of a checkout flow, which my company is actively ripping out from the monolith in order to ensure people outside the monolith can use it AND to ensure we're able to do the price testing/conversion rate testing at a level that doesn't need a separate suite of tools for each business unit. This also has the benefit of reducing integration points with the billing system leading to better standardization and consolidated data in one billing system.
- dwb 3y agoI have designed and built something that could be described as a microfrontend system (though it's much more restrictive than "do what you like within this part of the page") and though it's been pretty successful I agree totally with the article. It's a lot of complexity if it isn't definitely worth it. Our "microfrontends" are really dynamically-loaded JavaScript modules of a particular type. They conform to one of a small handful of well-defined extension points, including defining UI (in React components, as it happens, but clearly this isn't React-specific). In this way engineers stay more or less on the golden path, and we can do some runtime checks to try and give better error messages. I think if we'd built something more general it would have been a mistake.
- steven-xu 3y agoI’ve worked on two 100+ weekly committer monoliths and two similar sized MFE architectures. I think the article hits good points though I’d add some acutely painful ones it misses[1]. I’m someone who is by gut now squarely in the pro-monolith camp, but I think that in the comment thread of a similarity anti-MFE article it’s worth steel manning the pro-MFE arguments rather than characterize it simplistically as cargo-culting or resume-boosting. First, MFEs solve organizational issues by cheaply offering release independence. An example is when teams that do not overlap in working hours. Triaging and resolving binary release blockers is hard to do correctly and onerous on oncall WLB. Another example is when new products want to move quickly without triggering global binary rollbacks or forcing too fast a release cadence for mature products with lower tolerance for outages or older test pyramids. Second, MFEs are a pragmatic choice because they can proceed independently from the mono/microrepo decision and any modularization investment, both of which are more costly by several multiples in the cases I've seen. Most infra teams are not ivory towers and MFEs are high bang-for-buck. Finally, MFEs are a tool to solve fundamental scaling issues with continuous development. At a certain level of commits, race conditions cause bugs or build breakages or test failures, and flaky tests cause inability to (cheaply) certify last known good commit at cut time. You can greatly push out both of these scaling limits with good feature flag/health-mediated releases and mature CI, but having an additional tool in the kit allows you to pick which to invest in based on ROI. Advocating for modularity is nice but I've never met an MFE advocate who didn't also want a more tree-shakeable modular codebase. We should not jump to the conclusion the MFE as bad or a "last resort" because there exists another solution that better solves an partially overlapping set of problems, especially if the other solution doesn't solve many problems that MFEs do or requires significant more work to solve them. [1] Runtime JS isolation (e.g. of globals set by third party libraries) is hard and existing methods are leaky abstractions like module federation or require significant infra work like iframing with DOM shims. CSS encapsulation is very hard on complex systems, and workarounds like shadow DOM have a11y and library/tooling interop issues. Runtime state sharing (so not every MFE makes its own fetch/subscriptions for common data) is hard and prone to binary skew bugs. Runtime dynamic linking of shared common code is hard to reason around and static linking of common code can result in the same transition of a lazy loaded module to go from taking 10kB to 1MB+ over the wire.
- 3y ago
- wintogreen74 3y agoI agree with a lot of this - MFE are much harder to pull off than the backend services, and I have yet to see a successful solution based on how they are often presented at the bleeding edge. We have had moderate success with pretty rudimentary implementations (think: iframes) but it is definitely not pain free. I'd highly recommend you look for this sort of architecture to STOP contributing to the monolith before you look to fix it, which I think aligns with the author's recommendation to get your sh!t in order before you distribute your monolith, which will be a Vietnam for your team.
- andy_ppp 3y agoI 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 library of components (this just about works) - how this is managed and the engagement with other teams is critical. 2) turn everything into an npm package and create version hell at the end of a sprint as hundreds of devs try to version bump everything and the main package.json all at the same time. 3) free for all with moving people regularly between teams. This is the best solution because best practices automatically filter their way through each team through the people and everyone learns and gets on with each other in a human way that allows real collaboration. 4) splitting vertically rather than by components so one team does the search UI another does the homepage another does the product detail etc. but hopefully in the same technology! Or you could probably just reduce the number of people adding pointless features to your ecommerce site... Ah there is five of you and you did microfrontends didn't you, I can't and won't help you then :-/
- williamcotton 3y agoHow many times per second do you think awk, grep, sed, et al are being used right now? Composable tools exist. Whatever horseshit is going on around ANY bigger sized application is not. Excel, any random React app, GIMP… sure, compositional engineer might be taking place WITHIN the application, but it is barely composable beyond a Copy, Paste, Save As dialog and the ability to arrange the window with other windows. Can’t you see how things immediately invert and turn inwards, away from interaction, away from composability, the moment the turn towards structured interfaces begins? An API is a narcissist. You have to live in its world. A Unix pipe is a communist. Think, aggregate vs combined in terms of the GPL… pipes vs APIs…
- tsss 3y agoMicrofrontends are about independent development, not code reuse. They work fine if you understand their purpose.
- davepeck 3y ago"Microfrontends" is a new term for me. Are there specific frameworks that embody the concept (and if so, where on GitHub would I look)? Is it more of a broad architectural pattern?
- JCharante 3y agoIt’s not really a framework. I mean that’s the whole point of not being so tightly knit. Imagine you have a website with some kind of router for different paths. You might also have a unique domain per market (e.g. amazon.co.uk or amazon.jp) / -> home page repo /search -> search repo /products/xyz -> products repo /products/xyz/review -> product review repo It might seem crazy to have so many repos, but each of these pages already imports so many different components from different teams, and separating them is an easy way to make sure you don’t accidentally separate something else. You could use Gatsby to prebuild all the products pages when there’s a change in the CMS and serve them on S3, and you could use a Next.js project to handle the /search page. You could use Vue to do the reviews page, or just have a normal create react app SPA. It gives you flexibility to experiment and lets teams not stop all over each ofher. If your build step results in 20 * 300 product pages, then you’ll be glad to not have other stuff in that repo. Of course you could accomplish this in a monorepo, but I’m just using project & repo to mean the same thing (a micro frontend) It gets easier to A/B test and you could deploy a different site version for different markets (e.g rollout a new search result layout in Ireland and see if there’s a difference in click through rates). It’s just easier to deploy a MFE to serve that route in that market and have the old MFE still deploy to other markets.
- davepeck 3y agoThanks, that's helpful. Amazon famously built the company with OBIDOS, a monolith; these days, backend microservices abound — as do what we’re calling here microfrontends, although my understanding is at AMZN they are granular not just to market-specific domains or route prefixes, but sometimes also to pre-defined sections of a final rendered page. Would love to hear from AMZN engineers that work on such things.
- FlorianRappl 3y agoPersonally, I wouldn't call it a "last resort", but I definitely agree that keeping a functioning monolith is preferred. Nevertheless, one thing to keep in mind (and I do consulting on MF for the last 5 years) is that most projects / teams are not well prepared and actually not at all suited for MF. MF solutions are usually just done from a technology POV, which is already a problem. Next thing is that the used technologies are often also not well suited. People tend to use strongly coupled things that just create hidden monoliths. In the end projects fail often because either the organization is not ready to have truly independent teams or / and because the software has just become too complex and unmaintainable. To end with something positive: We also know many success stories in that area where people spent the right amount of research on what technologies to use and where everyone in the organization was prepared to accept the new teams setup.
- gratitoad 3y agoWe’re about to embark on the MFE journey and I’m concerned about pulling it off in a way that will have justified the effort. Our motivations are pure, we have many feature teams, we’re driving toward team independence, already breaking up the monolith into Microservices, etc. But on the FE we have the standard requirement to maintain eventual (definition tbd) UI consistency and so intend to continue to maintain a large number of build-time dependencies between MFEs and shared libraries. So I’m not sure exactly how to pull this off. Are any of these “many success stories” talked about online? Case studies we can get pumped on?
- DanielHB 3y agoThis 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 independently run for development (something like storybook, although I don't recommend it) 6) Preferably with the packages being kept small, lean, with limited number of external dependencies (ie, settle on the cross-team deps to use, so framework, routing, data-fetching, etc) 7) Some kind of pre-commit git hook or CI script to validate a set of core shared dependencies used by packages are kept in sync (ie, everyone is running the EXACT SAME React version). I use this one: https://gist.github.com/DanielHoffmann/a456aadb2f27880d592419dff0df0ec8 https://gist.github.com/DanielHoffmann/a456aadb2f27880d59241... 8) Shared build configuration and tools, all apps are validated, built and bundled by the same code. 9) NO PACKAGE PUBLISHING/VERSIONING, all dependencies are workspace:* For example: folder-structure: /apps/{team1-app-name}/ /apps/{team2-app-name}/ /packages/auth/ /packages/some-util-lib/ /package.json "scripts": (test, lint, format, typecheck all done at the top level package.json) "workspaces": [ "apps/*", "packages/*", ], /packages/auth/package.json "scripts": (dev to run in development mode) "devDependencies": { "some-util-lib": "workspace:*", "react": "^18.0.0" } "peerDependencies": { "some-util-lib": "*", "react": "*" } /apps/{team1-app-name}/package.json "scripts": (dev to run in development mode, build for production builds) "dependencies": { "auth": "workspace:*" "some-util-lib": "workspace:*" } This doesn't give you 100% of the independence of microfrontends, but it does give you quite a lot of bang for your buck. Depending how much independence or reuse you want you might want more or less shared external dependencies (for example your shared packages could be framework agnostic and just use raw JS) The build/bundling configuration can set up separate chunks for the core set of shared dependencies (react, router, etc) to improve build times, load speeds and caching*
- no_wizard 3y agoMost 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, or perhaps think there is a better way to accomplish their goals. I'm not sure MFEs are the best tech, to be honest. I've seen demos where it seems to be an addition (bootstrapping speed, neat tricks with routing etc.) but I've never seen them demonstrated in practice. I'm on a team now that is adopting MFEs and our payload is somehow considered acceptable at 8 MB. Given this is a behind-the-login app, I think somewhere between 300-500KB bootstrapping and getting to interactive with the rest lazy loaded is fine, but 8 MB to boot the app seems like we aren't doing even basic optimizations (I unfortunately do not have the control I wish I had on this) I'm really unsure about MFEs, they seem like something looking for a problem in practice. They certainly appear hard to get right
- fabianholzer 3y agoThe 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.
- no_wizard 3y agoThat is what I think MFE is meant for, where you have entirely different parts of an organization working on an application but you need it to feel the same to the user. That feels right. Another I've been apart of is applying it to a given codebase post acquisition, helps speed up integration in some respects One example I've seen floated though is remote modules for design systems. This one I'm unsure about. I can only speak from one experience when this was tried and it was a disappointing result.
- duxup 3y agoI would rather see articles about "How to do Microfrontends right" rather than all these "X sucks" articles.
- euler2100 3y agoThere's a million of those. Certainly, having a few dissidents is _expected behaviour_.
- revskill 3y agoThis is mostly skill issues. There's not much magic or difficulty with MFE. It's the same as when you break your program into multiple libraries, and you just do it all the time. The moment you do npm install, pip install, cargo install,... you're basically doing the Micro-program already.
- didip 3y agoMicro anything is only useful if your company is big and has a lot of separate departments. It solves a real organizational issues. If your company is small, don't bother with any of these micro trends. The overhead of micro architecture is non-trivial: telemetry, tracing, test infra, build infra, non-prod environment setup, etc.
- leemcalilly 3y agoIsn’t a “micro front-end” just like a Turbo Frame in Rails now? Except, easier to manage within a monolith?
- simantel 3y agoThe microfrontends that OP is referring to are generally standalone single-page apps which sit underneath some kind of top-level router that loads the correct MFE as needed. Often these are split up by functional area or product at a company with multiple products.
- JCharante 3y agoMicrofrontends are so nice because you get to experiment with different tools more frequently with less risk.
- ChicagoDave 3y agoMicrofrontends require modularized behaviors with zero cross grained abstractions. It’s often referred to as Packaged Business Capabilities. The MFE is an adapter pattern that hosts discrete modules deployed from their own repositories and configuration should be automatically integrated. But as the OP states, there are many ways to do this badly. A strict non-abstraction discipline is required. No shared utility libraries between modules.
- eezing 3y agoIf reusable frontend code for your within a single organization or business unit is important, then having separate repos is crazy. A monorepo with separate build pipelines is better, but still unnecessarily complex. A framework like Next.js can do the heavy lifting for you. One build pipeline where components are shareable, and pages/routes ans entry are isolated during development and can be deployed independently if required.
- JCharante 3y agoHow is it crazy? I think a lot of big companies have design standards and then some teams create UI libs that follow those standards (and then the UI/UX designers will use the design standards while devs use the ui lib). That’s plenty of reusability, and if you really need to share some components between two MFEs then maybe they should just be 1 MFE. A page footer could easily just be a small react component library built on top of the ui lib, and then everybody can just import it and stick it at the bottom of their MFEs.
- afjeafaj848 3y agoPersonally I think we should go one step further and introduce an <electron> tag to HTML so you can embed an electron instance within webpages
- Pxtl 3y agoImho the web has done ferocious damage to modularization with its history of "global everything". css classes are global, element ids are global, the root Javascript namespace is global. This made constructing modular web code aggressively difficult, and only now we've got technologies that make modular components in the web manageable. That's a lot of historical velocity to overcome. All these nonsense approaches like "microfrontends" feel like they're still fighting that war. We're finally at the point there reasonable isolated components are totally doable within the web platform. We just need to lay down the rules for good practice to keep the inherent globalness of the web from creeping back in and ruining everything.
- alex_lav 3y agoMicro anything should be the direct result of build-measure-optimize after having exhausted all non-micro solutions. Micro front ends seem like an incredible (arrogant/low experienced) smell.
- projektfu 3y agoIs MFE the approach that's turning so many sites into dogs? American Express account website, for example.
- bluSCALE4 3y agoI just implemented a microfrontend application and it's pretty cool in theory. My issue is that it requires a lot of buy in from all developers and they have to have a level of commitment I've only seen in very senior devs to avoid code bloat.
- codedokode 3y agoIsn'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.
- hofo 3y agoI hadn’t heard of MFEs before but this reminded me of renderings in the Sitecore CMS and the Helix organizational methodology to handle dependencies and coupling.
- Aaargh20318 3y agoTo me it sounds like they are re-inventing portlets (JSR-168).
- namtab00 3y agoI'm having flashbacks of ASP.NET WebForms controls, but much much worse... as in SharePoint WebParts worse
- deleted 3y ago[deleted]
- btbuildem 3y agoAuthor 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.
- klysm 3y agothis might be a bad take, but I think microservices make _more_ sense in a JS world (idk why you'd chose to live there) because you lack strong modularity primitives
- mrinterweb 3y agoI think people forget that code in monoliths can be written in a way to set boundaries with namespaces and thinking through class-level API design. Most of the time you can accomplish the same outcome of what a microfrontend might provide inside a monolith. Same is often the case for the backend.
- klysm 3y agoThey can, but the walls are not strong enough to perturb those programmers who do not know any better, don’t care, or are under sufficient pressure to sweep aside good practice. Micro-anything is the philosophy based in the presumption that your engineers will not respect softer walls and modules and therefore strong ones must be constructed. It’s obvious that strong walls have immense cost, but perhaps for a large enough organization it enables faster movement overall with fewer faults. Walls are good after all. What’s fascinating to me about micro-anything vs. monolith-anything is it’s much more a function of team structure and culture than of technical merit. In some cases, the technically inferior solution can deliver more to the business when combined with the unfortunate realities of human development. I agree with the original offer that micro-anything should ultimately be considered a failure of better modularity mechanisms.
- strken 3y agoI thought it was more about independence. Got a bug in your service? Instead of one massive build deployed once an hour/day/week/etc. that gets rolled back if any commit was bad, you deploy your service when it changes and don't worry too much about the unrelated pieces.
- Sankozi 3y agoGot a feature that touches several modules? Instead of one massive build deployed once, you deploy each service. With dependencies you need to wait after each deployment to check if everything is ok. Instead of one big build and one deployment, you get quick build, deployment, check, quick build deployment, check... So in case of microservices/microfrontends you gain minutes on build time but lose hours/days on deployment and verification.
- 29decibel 3y agoI think Microfrontends could really work pretty well if you have end to end vertical tooling support, like organization unified package management, authentication, logging, error tracking, testing, CI/CD etc. If any team can bootstrap all of these vertically supporting any major frameworks, then it might be a good idea. But let's face it, most of us don't have that luxury.
- throw156754228 3y agoMicro everything shop. Rebrand involves releasing N front ends. Util code copy pastitis. Putting shared code in an npm module or git submodule is painful.
- ivanjermakov 3y agoYou know what it better than micro-anything? Modules. Learn to decouple code by functionality and there will be no need to force it.
- williamcotton 3y agoThe more state that gets shared, the more dependencies that exist, the further away you are from actual isolation. It’s not just state. It is the kind of state. Think about the difference between aggregate and combined software systems, and I’m using the GNU and FSF definitions here. Loosely coupled systems with pipes? Aggregate. API interface? Combined. Every step away from something as generic as a stdin/stdout pipeline brings you more and more coupling. You want to know the real problem with contemporary software development? We don’t actually compose our tools together beyond some meatheaded level of “specialized database”, “specialized frontend”, “specialized backend”. Cat, awk, grep, sed, and most importantly | and < and > and you can compose any number of specialized tools. The inclusions of libraries of code into a single executable environment that exposes an HTTP API is a non-generic data interface to another software system. Only generic interfaces are truly composable. I’m still long on void *…