Micro-Frontends: What, why and how

Sdílet
Vložit
  • čas přidán 2. 06. 2024
  • Find out all about Micro Frontends at the high level. Why are they interesting? What are the advantages and disadvantages? And how would you get started in moving your site into a Micro-FE architecture.
    Micro-FE playlist: • Custom Elements & Micr...
    If you liked this video, buy me a coffee! www.buymeacoffee.com/bluecoll...
    Hope you folks enjoy this!
    👉 If you enjoy this video, please like it and share it.
    👉 Don't forget to subscribe to this channel for more updates.
    👉 Subscribe now: bit.ly/2E7drfJ
    👉 Discord server signup: / discord
    #micro-fe #micro-frontend #web-development #web-architecture
  • Věda a technologie

Komentáře • 179

  • @viraj_singh
    @viraj_singh Před rokem +25

    This video made me realize, I was part of a micro front end team in my previous job 🤣. We had a mono repo for our micro frontends and we shared each other's teams reusable code by developing private npm packages for sharable code like UI libraries. We had micro frontends within a micro frontend if you consider loading different page sections in s which was crazy at first.

    • @zdargahi
      @zdargahi Před rokem +1

      that made me laugh out loud at office

  • @rfkashani
    @rfkashani Před 3 lety +7

    Greetings from Redmond, WA :) Thank you, your videos are awesome! I spent the last few hours binge watching your playlist. Nice to see how far the industry has come along. Back in 2015, I worked at Microsoft and we built a proprietary micro-frontend for Azure.

  • @thelavishcoder2553
    @thelavishcoder2553 Před 3 lety +4

    This is awesome. I’ve been writing config based code for the last 3 years and finally something comes out that is going to make this style the norm. I can’t wait for this to happen.

  • @ionut-cristianratoi7692
    @ionut-cristianratoi7692 Před 3 lety +9

    A really helpful video! I like that you presented both the aspects (pro and cons). This way, you will better know when it's a good idea to use it and when it's not.

  • @waellaataoui8502
    @waellaataoui8502 Před 4 lety +45

    this channel deserves some love ❤

    • @Gruby7C1h
      @Gruby7C1h Před 4 lety +1

      Quality content, it will grow!

  • @MrRac00n
    @MrRac00n Před 4 lety +2

    Excellent video. The way you broke this concept down made it very simple to understand.

  • @PatsCeltsBruinsSoxs
    @PatsCeltsBruinsSoxs Před 3 lety +5

    I just want to say Jack, you're awesome! Your ability to break things down and explain they "why" to any technology is uncanny. Keep it up!

  • @WebDevCody
    @WebDevCody Před 2 lety +26

    At a previous job, we tackled micro front ends by basically having a some shared header code, which was written in plain JavaScript html, hosted somewhere; this was injected into the page on load and rendered. The header had all of the links to the various micro uis, and each micro Ui was built and deployed individually by different teams. Some of the stuff you mention sounds like you took it to the next level (which is cool) such as having sub components of pages loaded and rendered via xhr request. I’ve switched projects since then, but it was a cool learning experience! Thanks for the video

    • @jamesbarnes9483
      @jamesbarnes9483 Před rokem +1

      This is super interesting. Did you have any considerations around SEO/pre-rendering etc? I’m wondering how that would be handled in an MFE project

  • @Katan87
    @Katan87 Před rokem +1

    Man.... you are KILLING IT. Keep up with great work!

  • @AndrewWooldridge
    @AndrewWooldridge Před 3 lety +2

    This is such a great video - so well done and thought out

  • @vakhtangnodadze4802
    @vakhtangnodadze4802 Před rokem

    Thank you for your contribution to the Software community. 👏 Your videos are awesome

  • @alexgochenour8740
    @alexgochenour8740 Před 6 měsíci +1

    Thanks for this great video. I worked at a small company that used Web Components that got slotted into a React app. The React app was tiny as a result. We didn't use the term "micro front ends" but what we had basically meets your definition. I'd argue that this is definitely a standard. Certainly not a "Redux of MFEs" as you say, but still a viable standard, especially considering the variety of tools that can stamp out Web Components if you don't feel like rolling your own.

  • @ozkirlisakal
    @ozkirlisakal Před 2 lety +1

    Thank you, there are many helpful videos from you about MFEs.

  • @naudemalounguila8918
    @naudemalounguila8918 Před 2 lety +1

    Thé information is 1 year old and still relevant. Thank you.

  • @nishantjiit
    @nishantjiit Před 3 lety +1

    Thanks @Jack, It is something that I wanted to hear about micro frontends.

  • @zlatkoiliev8927
    @zlatkoiliev8927 Před 2 lety +1

    Awesome! Are you planning to make a tutorial on micro-frontends? I would love to see a nice app split in micro-frontends, with routing, auth, and some code sharing

  • @p20ph37
    @p20ph37 Před 2 lety +3

    Take a shot every time he says micro-frontend / MFE. All jokes aside, I love your videos.

  • @malikrajat
    @malikrajat Před 2 lety +1

    Thanks @Jack Herrington for making MF such easy way to implement.
    Currently, I am struggling with "Cross micro frontends communication" with mono angular MF, through a common/ shared service between all the MFs.
    I hope, I am not alone, Many of us going through same challenge, If you could share any article/ video. From there we can take reference.
    Thanks in advance. I am waiting for hear something from you.

  • @amin001001
    @amin001001 Před rokem +1

    Awesome explanation. Thank you.

  • @THE_G0AlAPAGOS
    @THE_G0AlAPAGOS Před 2 lety +1

    Thank you sir, Gold content 🙏.

  • @joaoigorm.dasilva1418
    @joaoigorm.dasilva1418 Před 2 lety +1

    Thanks Jack, it helped me a lot

  • @SkyrimBeast
    @SkyrimBeast Před 2 lety +2

    The first 3 minutes of this video makes me think of components in a React app. Components are individual blocks of code that do something. The code for such components are often found in 1 file among a collection of other components.

  • @shahji0001
    @shahji0001 Před 3 lety +4

    This is a good Intro. You should share more examples or tutorials on how to begin with Micro Frontends.

    • @jherr
      @jherr  Před 3 lety

      Here is a playlist - czcams.com/video/XUtCnA9WEgQ/video.html&ab_channel=JackHerrington

  • @devrano48
    @devrano48 Před rokem

    I did implement micro apps by in react until i meet with this channel,
    To communicate with parent and children was really tricky and messy in Iframe. thank you!

  • @nhim1705
    @nhim1705 Před 3 lety +1

    Thank you for the video!

  • @SwiftySanders
    @SwiftySanders Před 3 lety +1

    Thanks for this video!

  • @smithjaaron
    @smithjaaron Před 4 lety +1

    Nice overview - thanks

  • @karnellschultz6446
    @karnellschultz6446 Před 2 lety +1

    one of many great videos

  • @zackjackson9674
    @zackjackson9674 Před 4 lety +7

    Nice one! We need more of these to lower the barrier to entry for MFE adaptation. Especially with the tech catching up

    • @jherr
      @jherr  Před 4 lety +1

      Yeah, I've been thinking about doing one of these about GraphQL. Trying to explain the importance of GraphQL for non-technical folks.

    • @chenrvn
      @chenrvn Před 4 lety

      @@jherr maybe some gRpc connection magic :-)

    • @jherr
      @jherr  Před 4 lety +1

      @@chenrvn Man, if you could get me a working gRPC example to work off of I would be much appreciative. I tried for a couple of days a few months back and could just not get it going!

    • @chenrvn
      @chenrvn Před 4 lety

      @@jherr Here is an example for 2 nest js client-server gRpc communication :)
      - i don't have an example of a pure SPA client-side app (but maybe I will create in near future :))
      here are the repos:
      - client: github.com/ChenReuven/nestjs-grpc-client-sample
      - server: github.com/ChenReuven/nestjs-grpc-server-sample

  • @MukhtarXIII
    @MukhtarXIII Před rokem +1

    Very usefull , God bless you !

  • @flemminghansen7748
    @flemminghansen7748 Před 2 lety +5

    Really a good short and precise video, doing exactly what the title said it would do. And I'm now confidant that MFE is the wrong path for our current project. 👍

    • @jherr
      @jherr  Před 2 lety +2

      That's ok, MFEs are not a panacea.

  • @pranilrathod
    @pranilrathod Před 3 lety +1

    my God the video and audio quality, lightings and editing is just awesome!!

  • @abouzarazarpira6198
    @abouzarazarpira6198 Před 2 lety +1

    It was just great and clean like yourself

  • @ManuelPamplona
    @ManuelPamplona Před 2 lety +1

    your videos are gold

  • @knownawol
    @knownawol Před 4 lety +5

    Cool video! Do you see MFE platforms in the future being actual servers/services that are maintained by a platform team, or will they be more likely to leverage things like lambdas@edge for cloudfront or edge workers for akamai?

    • @jherr
      @jherr  Před 4 lety

      I think an infra team should manage the API surface of MFEs for a given company or portion of a company so that everything is consistent. But how those MFEs are deployed, as long as the MFE surfaces conform to that API, should be up to the team. Server based, lambdas, or static, all of that should be supported. The infra team should also maintain a test harness app that MFE development teams can use to ensure that they are playing nice in the ecosystem.
      And thanks for the subscribe!

    • @knownawol
      @knownawol Před 4 lety

      @@jherr thanks for the fast reply! What kind of things are you thinking of when you mention contracts? SLA's, shared `window` resources, analytics apis, and etc?

    • @jherr
      @jherr  Před 4 lety +1

      @@knownawol Lifecycle events (e.g. mount, unmount), and properties (and property changes if that's supported). That would be the base level. And then optionally; versioning, data requirements (e.g. I need this GraphQL query fragment), analytics, perf logging, shared data (e.g. user identity, cart count), or a shared event bus. But what you decide to do or not do should flow from an analysis of what parts of what pages should be MFEs, and then the minimum set of requirements to get that done.

  • @AliBaba-ts7ke
    @AliBaba-ts7ke Před 2 lety +1

    Thanks a lot!

  • @sunhaochhay5479
    @sunhaochhay5479 Před 3 lety +3

    MFE will be the future for remote team.

  • @jatilyadav4000
    @jatilyadav4000 Před rokem +1

    Amazing video

  • @valtrav8996
    @valtrav8996 Před rokem +1

    Thanks!

  • @vkps108
    @vkps108 Před rokem +1

    Hi Jack
    Thanks for a great intro video on MFE. It really helped understand the concept.
    However, I do have a question
    We were always consuming other web portals into a host website using s or something similar. How ar MFEs differeent from these?

    • @jherr
      @jherr  Před rokem +3

      What is something similar to an ? An is a decent mechanism for this but there is a high level of isolation between the host page and the . For most uses an MFE framework that allows for a higher level of integration with the MFE code and the host page code is better. You can get away with less CSS as well and the content appears better integrated.

  • @DarrenJohn10X
    @DarrenJohn10X Před rokem +1

    I watched this mfe THEORY video right after watching your mind-blowing mfe PRACTICAL video ("Micro-Frontends in Just 10 Minutes") -- which really helped convince me of the WHY. 👏 🤜🤛

    • @DarrenJohn10X
      @DarrenJohn10X Před rokem

      czcams.com/video/s_Fs4AXsTnA/video.html
      ^ "Micro-Frontends in Just 10 Minutes"

  • @tbcfrankee
    @tbcfrankee Před rokem

    Just started my first job and we’re considering adopting microfrontends for the various apps across the platform. It’s an interesting concept but I have a hard time distinguishing them from components.

    • @jherr
      @jherr  Před rokem +2

      They are just remote components. But don't use them unless you have a compelling need for them. And don't use them for mission critical UI.

  • @TheTenThousandThings
    @TheTenThousandThings Před rokem +1

    bravo!

  • @kirk-patrickbrown866
    @kirk-patrickbrown866 Před 3 lety +1

    great videos

  • @martingruebler443
    @martingruebler443 Před 3 lety +1

    This voice is nice to listen to

  • @volodymyrmatselyukh8808
    @volodymyrmatselyukh8808 Před 3 měsíci

    It’s interesting to understamd how these microfrontends are hosted. Is that when you build the project everything is in the build or they are built and hosted separately and just injected into the hosted pages?

  • @rubenverster250
    @rubenverster250 Před 2 lety +1

    I have a question. We're working on a POC app at work and we use microservices and microfrontends for the architecture.
    We are dockerizing everything, every microfrontend and microservice. How would you go about having the different microFE containers communicate with each other?
    Any blogs, forums or vids will help. Basically any rresource XD

    • @jherr
      @jherr  Před 2 lety

      There is our book module-federation.myshopify.com/ . :) And that covers a lot of state managers and such. POCs with Docker are ok, but in production you'll want to have your federated modules deployed to an asset store like S3.

  • @Poomastafatz
    @Poomastafatz Před 4 lety +4

    I assume there is a number of different ways to identify "targets" for MFEs, so I would really appreciate your thoughts on this. In the video, you pointed out the "carousel" being a good target for an MFE which makes sense, and I would consider that to be something like a "feature-level" MFE. When hearing/reading recommendations from Luca Mezzalira (who also seems to be a huge MFE advocate), he seems to lean more towards the idea of separating MFE targets at to "domain / sub-domain" level. In the Amazon example, I think that would mean the "cart" would be MFE, maybe "Orders" would be an MFE, and so on. To me, this model makes a lot of sense as it supports the constraints of an organization. I feel that within an organization, you would have teams of developers, business analysts, and data scientists focused on optimizing the "cart" experience, so having an MFE that a single team owns and specializes in makes a lot of sense to me. With the carousel example, I cant really see a single team really "owning" that MFE and I am uncertain how that "feature-level" targeting could be sufficiently delegated amongst a series of teams in an organization. Would love to get your thoughts and if there is an MFE framework that fits the "domain/sub-domain" approach
    Thanks in advance! I just discovered your channel today and just want to say I love the way you explain things and I subscribed right away!

    • @jherr
      @jherr  Před 4 lety +5

      I think SingleSPA is really intentioned to be a domain/sub-domain solution. Their primary use case is to manage the SPA at the route layer, though they do support making "drop-in" MFE components as well (e.g. cart or the add to cart CTA). The product carousel example is probably bad in that it's pointing at an implementation and not a feature. Ideally you'd have a team that would control product recommendations, including the API, the data analysis, modeling, and recommendations algorithm, as well as getting that represented in the front end as a Product Recommendation Carousel MFE. And in that case, it's definitely a team, or several. And then from a scrum team perspective that team would own their conversion metrics around that feature, and optimize accordingly (e.g. let's A/B test a carousel versus a slider, or whatever). And the host page doesn't care either way, it just drops the MFE on the page.
      Thanks for the subscription. I've wanted to do another high level video like this on GraphQL. Would you be interested in that?

    • @Poomastafatz
      @Poomastafatz Před 4 lety +3

      @@jherr Wow thanks for the excellent reply. Your points about the carousel definitely make sense when applying that level of depth, so I see now how a carousel could certainly stand-alone as a MFE with a full team behind it. I was simply perceiving it as an import that took props :) But your description definitely makes sense.
      I would love a video about GraphQL - Personally Ive only used it on Gatsby implementations, and I feel a majority of GraphQLs power is hidden behind Gatsby's build process - so I would love to learn more about it and how it could be applied to more of my projects

    • @jherr
      @jherr  Před 4 lety +4

      @@Poomastafatz Cool. Well, this one one be more for the product manager types who are like "Why should I prioritize this 'Port to GraphQL' ticket? We already have a REST API." But it would also be a decent overview.

  • @Ath9493
    @Ath9493 Před 3 lety +2

    Perfect

  • @marcusrehn5844
    @marcusrehn5844 Před 2 lety +1

    How do we handle sharing libraries? What about one MFE running react 1.16.x and another with 1.16.y? Seems to me that the bundle would be huge, no?
    I'm working on a project that would benefit from this approach given that we could do something about the bundle size. But I'm still not convinced that it's worth the complexity.
    This, just like micro services them selves seems like it comes with a great cost in complexity.

    • @jherr
      @jherr  Před 2 lety

      Webpack 5's Module Federation shares the react and react-dom library (and whatever else you need) across the Micro-FEs. And it does a really good job with version arbitration and making you only load what's needed.

    • @DucinDev
      @DucinDev Před 2 lety

      "I'm still not convinced that it's worth the complexity."
      - that's very good actually! Use them only when you clearly see advantages outweigh disadvantages. Just as you compared MF to microservice architecture: microservices are significantly more difficult and, if you don't need them, stick to monoliths for simplicity. However, in some situations, monoliths reach a size after which the cost of scaling your teams or product is not acceptable.
      When it comes to sharing libraries, apart from Jack's tip on sharing via Module Federation, there's also a rule for microservices (again) which goes: SHARE NOTHING. The thing is: if you have multiple teams that maintain various MFEs and you make them share a dependency, then - whenever you want to change that dependency in a breaking way (e.g. major version bump) - you have to do that in either all of the consumer-apps or none of them. And that's clearly breaking the goal of independent releases. So in ideal world, you'd prefer to share nothing in a distributed system.
      You might, well, share lodash (only 1 dep in runtime, smaller bundle) if you don't expect it to introduce breaking changes anyhow soon, and reuse it. However, when a breaking lodash v5 arrives, you might want to make your apps use their own lodash versions (copies, bigger bundle) and then the seperate teams could migrate independently.
      So in this case the tradeoff is: smaller bundle (shared deps) VS independent ops (shared nothing).
      Common problematic situation in real-life microfrontends is: among many teams, there is a team which maintain internal company component library. It's specific to a certain framework (such as angular material, material UI, etc). The library shares, let's say, 50 components. Now, there are MFEs which use the components as they are right now (most recent versions). But within time, the component library would update their components, break the API at some point (e.g. major material UI being bumped, which breaks API) and some MFEs might decide NOT to update, because they have different business goals. But then, they need to use a component which is available only in the most recent version of the library... and there's a clash: either they update all their components (to enable the new one which they need) or none. You could think of publishing not a whole library, but each component separately - that would allow you to pick certain version of certain component from the lib, but. would introduce a significant overhead on the deployment process, bundle size and complexity.
      Sharing is troublesome in distributed systems.

  • @indranilbanerjee3844
    @indranilbanerjee3844 Před 4 lety +1

    excellent

  • @jr-hp7er
    @jr-hp7er Před 3 lety +1

    loved this channel...you're awesome..!!
    Just one request, Would it be possible for you to share your views and guidance on micro frontend with React + Redux + Redux Toolkit ?? Specifically managing the global state and inside the sub apps, plus how the communication works with subscriptions

    • @jherr
      @jherr  Před 3 lety +1

      Great idea. Thank you!

    • @jr-hp7er
      @jr-hp7er Před 3 lety

      @@jherr thanks Jack, will look forward into this

  • @VirgoSmart
    @VirgoSmart Před 3 lety +2

    Portlets from the yesteryears, but with content aggregation on the browser instead of within a servlet container. Would this be a fair statement ?

    • @jherr
      @jherr  Před 3 lety

      Sure. That would be a fair characterization.

  • @mattgic42
    @mattgic42 Před 3 lety +17

    So how do MFEs differ from Components in React? Aren't they basically the same?

    • @jherr
      @jherr  Před 3 lety +28

      They are implemented as components but imported as a run-time dependency as opposed to a build time dependency. That means that they can be updated separately without re-deploying the application.

    • @mattgic42
      @mattgic42 Před 3 lety +3

      @@jherr Ahh ok, thanks for the explanation!

    • @NguyenNguyen-th2eo
      @NguyenNguyen-th2eo Před 2 lety +5

      for short, it looks like microservice in BE side, where you can combine many different technologies and make them work together without any issue about compatibility, you can combine Vue, React, Angular together in micro FE like when you use Golang and Python and Nodejs together to build a good backend, hope that helps

  • @ashitashukla4714
    @ashitashukla4714 Před 2 lety +1

    Hi, thanks for the explaination, my query is regarding is it possible achieve single spa of MF1 of AngularJs and MF2 Angular 9+ in vanilla JS root container or something like root-container will be Angular 10 or 13 and exposed MF's ie. AngularJs and Angular 2+ ? If it is possible please help to understand.

    • @jherr
      @jherr  Před 2 lety

      I think that's possible. But Angular is not my area of expertise. Feel free to log onto my Discord server and ask your question there in the #module-federation channel, but be sure to read and follow the #rules before posting.

  • @rukshanabegum816
    @rukshanabegum816 Před 3 lety

    Good job

  • @rubenverster250
    @rubenverster250 Před 2 lety +1

    I have a question. We're working on a POC app at work and we use microservices and microfrontends for the architecture.
    We are dockerizing everything, every microfrontend and microservice. How would you go about having the different microFE containers communicate with each other?

    • @jherr
      @jherr  Před 2 lety +1

      There is our book module-federation.myshopify.com/ . :) And that covers a lot of state managers and such. POCs with Docker are ok, but in production you'll want to have your federated modules deployed to an asset store like S3.

    • @rubenverster250
      @rubenverster250 Před 2 lety

      ​@@jherr ok. SO the thing is were working on the POC as like, you know a proof of the concept... We will be using it as our architecture for a v3 of our CMS system. We'll most likely be using Azure to host the fed mods.
      So you'd have like all your microFE just plug into your fed mods in Azure?

    • @jherr
      @jherr  Před 2 lety +1

      @@rubenverster250 You should take this conversation over to #module-federation on the Discord server. But in short, federated modules are just JavaScript files and should be deployed like any other JavaScript modules. The same way you would deploy the bundle of an application to S3 (or the Azure equivalent).

    • @rubenverster250
      @rubenverster250 Před 2 lety

      @@jherr big

  • @darylfong6308
    @darylfong6308 Před 2 lety +1

    Thanks for the video. How should you unit test your app?

    • @jherr
      @jherr  Před 2 lety

      Personally I would mock all the remotes. You unit test against the contract with the remote, not the implementation. For a complete test you can use traditional E2E tools.

  • @joshblf
    @joshblf Před 2 lety +1

    How do MFEs compare with i-frames? It seems to be a similar concept of displaying a different application inside your host application.

    • @jherr
      @jherr  Před 2 lety +1

      IFrames can be MFEs. It's really just a matter of implementation.
      MFEs implemented using IFrames are genuinely independent and walled off from the page. The JavaScript runs independently. The HTML and CSS are entirely independent. And you have to work pretty hard to tunnel data and messages between the host page and the . "Zoid" is the only IFrame based MFE system that I know of.
      Other MFE systems, like SingleSPA, or Module Federation, have components that are integrated into the DOM of the host page. So they pick up the local CSS styling and also can be more easily integrated at the JavaScript level.

    • @joshblf
      @joshblf Před 2 lety

      @@jherr ok that makes sense. At first it seemed like re-creating the wheel until you think about shared styles and data.

  • @arjunmandloi
    @arjunmandloi Před 4 lety +1

    Really helpful

    • @jherr
      @jherr  Před 4 lety

      Thank you!

    • @arjunmandloi
      @arjunmandloi Před 4 lety

      @@jherr i just wanted to know how can I start project with pure javascript is there any reference which you can share with me, I dont want to use js framework need to use pure javascript with JQUERY

    • @jordan59961
      @jordan59961 Před 5 měsíci

      @@arjunmandloijquery is dead bro

  • @sreekumarmenon
    @sreekumarmenon Před 4 lety +1

    Thank you for the video please make a video on micro front end using services rendered framework like next.js

    • @jherr
      @jherr  Před 4 lety

      Can you tell me a little more about that? Do you want a Next.js site to consume Micro-FEs or to use Next.js to create a Micro-FEs?

    • @sreekumarmenon
      @sreekumarmenon Před 4 lety

      Would like to see how the loading and unloading of micro apps works with server side rendering and how this impacts SEO .

    • @jherr
      @jherr  Před 4 lety +1

      @@sreekumarmenon Gotcha, well, in the meantime, you should check out OpenComponents czcams.com/video/9CG0LeswOoM/video.html and Edge Side Includes czcams.com/video/4PoNBZl4t0Y/video.html . OpenComponents has a server side rendering option, and Edge Side Includes would add the micro-fe HTML, JS, and CSS to the page before it gets to the customer. So both of those would have zero impact on SEO. Tailor (github.com/zalando/tailor) also does server side rendering. The other Micro-FE frameworks I've used (thus far) have been client side rendered.
      I hope that helps.

  • @hariharana8458
    @hariharana8458 Před rokem

    Hi sir, please tell any resources to learn micro frontends in react

  • @gustaff.weldon
    @gustaff.weldon Před 3 lety +1

    How do you solve problem of loading same dependencies multiple times for such host page with many MFEs? Say your MFEs are in React, why would you want to force user to load mulitple React instances?
    Are there any tools to help with that or os this still DIY space?

    • @jherr
      @jherr  Před 3 lety

      Module Federation solves that problem by having a Webpack runtime on the page that manages the shared dependencies. So if you've got a host page that has React, and an MFE that use React coming in, then when you ask webpack to load the MFE code it will first look to see if it can share any dependencies, (i.e. React) to avoid having the MFE load its own. That's actually not just an optimization, it's critical because there can only be one React and one React-DOM on the page at a time.

    • @gustaff.weldon
      @gustaff.weldon Před 3 lety

      Ah right, Webpack 5 module federation. That assumes all teams must use it to bundle their mfe's using webpack 5, right? Or are other build tools able to "contribute" to client side modules registry Webpack runtime uses?

    • @jherr
      @jherr  Před 3 lety

      @@gustaff.weldon Yes to Webpack 5 for the time being. Though you can load WP5 federated modules into a Webpack 4 app. And other bundlers are starting to look at having a module standard that matches that. If you are looking for something entirely agnostic I'd look at Single SPA. But I think in that case, depending on how you use it (because it can use Module Federation as a code transport mechanism) you might be looking at having multiple sandboxed React instances.

    • @gustaff.weldon
      @gustaff.weldon Před 3 lety +1

      Thanks. I think foregoing that bit of build tool choice freedom, to gain so much eg. on user front is not a big price to pay.
      Single-spa was quite crude when I tested it last year, but one year is hell of a time in FE, so of course things have moved.
      I'm grokking slowly through your MFE videos to bring myself up to date, so do not be surprised if I dig out some other videos with questions.
      I'm trying to visualise what a possible MFE architecture for our ever growing SPA might be (and if it even makes sense).
      I think you're doing a stellar work with those videos. They have that "meat" I like and learn from. Thanks

    • @jherr
      @jherr  Před 3 lety

      @@gustaff.weldon Ask as much as you like. At the end of the day most projects use a bundler. And that's either gonna be webpack, rollup or parcel in most cases. And way, way, way back Zack had module federation working with Rollup. So it is possible. The actual module federation client side contract itself is not all that complex.

  • @ShaharHarshuv
    @ShaharHarshuv Před 8 měsíci

    I checked now (2023) and it seems like single spa has significantly more downloads and coverage than any thing else you've described.

  • @florianmatz1885
    @florianmatz1885 Před 2 lety +1

    Might be a stupid question, but say you have a Design System / Component-Library / UI-Kit that lives within a Monorepo alongside, let’s say an AppShell (Host App), products page and a cart page.
    All of them are MFs and all of them consume, let’s say the ButtonComponent from our component library. Does the code of the Button gets baked into each and every MF resulting basically in duplicated code and larger bundle per MF?
    Or would you have to setup each and every component of the library as own MF to be able to consume it without duplication (resulting in a lot of request - because you other stuff out of the library too).
    Or is there a chance that the shell imports the UI-Kit and kind of exposes all it’s contents (wildcard expose?!).
    I really enjoyed the video - like all your other stuff ✌🏻❤️

    • @jherr
      @jherr  Před 2 lety +1

      No, the host app exposes the component-library and the MF modules can then use it from the host app's bundle.

  • @mohitdhote2623
    @mohitdhote2623 Před 10 měsíci

    Is it possible to create micro frontend in diffrent framework and render it in one single page application with module federation if yes how to do that configuration
    Please help

  • @vinit.khandelwal
    @vinit.khandelwal Před 2 lety +1

    I like micro frontend

  • @mihaelisaev
    @mihaelisaev Před rokem +1

    I didn't get the diff between microfrontend and library. seems libraries/plugins just now have new name MICROFRONTEND 😁

    • @jherr
      @jherr  Před rokem

      Libraries are a build time dependency, micro-frontends are a runtime dependency.

  • @dancabaniss7565
    @dancabaniss7565 Před rokem

    Great video. I can't help but think that micro FE's could be really difficult to manage if you have multiple components that need to communicate with each other. It just sounds like a recipe for disaster to me. But maybe i'm wrong.

    • @jherr
      @jherr  Před rokem +1

      Ideally every MFE should be largely self-contained. Sharing the minimum amount of data (e.g. user ID and JWT).

  • @hk_build
    @hk_build Před rokem

    Can you make video on
    Exposing component which is connected to api and redux store ??

    • @jherr
      @jherr  Před rokem

      No, because I don't think you should do that.

  • @lucasp1185
    @lucasp1185 Před 3 lety +1

    So if we were to use single-spa your suggestion is to not use any state management tool like redux

    • @jherr
      @jherr  Před 3 lety

      Single SPA parcels are meant to be self contained in their state. So the host app can use redux. And a parcel can use redux internally. But I doubt there is an elegant way to bridge them. I haven’t tried though.

  • @chr1so
    @chr1so Před 2 lety +1

    Micro front ends and generic injectable components, check generic-forms in npmjs.

  • @fineshimaambo847
    @fineshimaambo847 Před rokem +1

    what extension due use for the code snippets

    • @jherr
      @jherr  Před rokem

      GitHub Copilot.

  • @echobucket
    @echobucket Před rokem +1

    I feel like this is a rehashing of the "Portal" architecture stuff from the mid 2000s.

  • @zebcode
    @zebcode Před 2 lety +1

    Although you explained the difference between a library and a micro frontends I just don't really understand what you meant when you said micro frontends are different because they can be deployed independently. So can libraries can't they? I'm not sure what you meant. It's just not clear to me why you'd use a micro frontend over a library and how they really differ?

    • @jherr
      @jherr  Před 2 lety +1

      A library is built into an application. So if, for example, you have your shared header component in a library, and you have five apps, then all fives apps would need to be rebuilt and re-deployed for all a release of the header to be live across the entire site.
      If your header is a micro-frontend then it's code that is consumed at runtime, instead of built into the compiled app. So, when the header is deployed it is live updated across all the sites immediately.

    • @zebcode
      @zebcode Před 2 lety +2

      @@jherr ah so it can be lazy loaded in for example using imports?

    • @jherr
      @jherr  Před 2 lety

      @@zebcode Yep.

  • @marouaniAymen
    @marouaniAymen Před rokem

    To be honest, I still doubt the concept of MFE, because I see no established approach or live example, just an ad-hoc sites. How can the MFI manage authentication if each component have its own provider ? how to manage routing ? what if there is shared data between those MFI components ? How can we manage to make MFE components working together when we have fundamentally different approaches like Virtual DOM in React and a compiler for Svelte ?

  • @Somethingwronghere
    @Somethingwronghere Před 3 lety +1

    I don't understand the scalibility part. Traditional package import/export can achieve exactly same thing

    • @jherr
      @jherr  Před 3 lety

      If you have ten different teams with different applications all of which deploy independently, which are then knitted together by a CDN provider (e.g. Akamai) then if you want to deploy a header update to all the sites simultaneously then each application would need to rebuild, pull the new package, etc. and deploy simultaneously, which is a challenge to say the least. In a Micro-FE approach all the applications are loosely coupled to the applications so they all get updated simultaneously.

    • @Somethingwronghere
      @Somethingwronghere Před 3 lety +1

      Good point, thanks! I get it now. I only thought about a single website with multiple MFE components, not the multiple sites/pages maintained by different team scenario.

    • @jherr
      @jherr  Před 3 lety +1

      @@Somethingwronghere No problemo. That's just one scenario. The other is when you have a SAAS company that wants to provide hosted widgets for use on external uncontrolled pages. Back in the jQuery days we used to call these "widgets". Micro-FEs are a similar/same concept.

  • @pjf7044
    @pjf7044 Před 2 lety +1

    How does microfrontend differ from webcomponents?

    • @jherr
      @jherr  Před 2 lety +1

      Micro-frontends is an architecture, and web components is one, very good, implementation of that architecture.

    • @pjf7044
      @pjf7044 Před rokem

      Thank you!

  • @PeterSedesse
    @PeterSedesse Před 2 lety +1

    I started developing websites in the early 90s and did it professionally for about 6 years, then took a 20 year break.... it is funny coming back and seeing that all the headaches have been fixed. I want to make an uphill, both ways, joke

    • @jherr
      @jherr  Před 2 lety

      It is kinda funny that Micro-FEs are fixing a problem that the bundlers created. We used to just import JS files all the time off the frontend. Or we would use something like requirejs to do dependency management.

  • @boogiman007
    @boogiman007 Před 4 lety

    MFE in ELM, ever come across one ?

    • @jherr
      @jherr  Před 4 lety

      I've done ELM -> Custom Elements, so you could wrap that in an MFE.

    • @boogiman007
      @boogiman007 Před 4 lety +1

      @@jherr way of the future in my opinion.

  • @AussieAmigan
    @AussieAmigan Před 2 lety +1

    Ah, jeez. Everything old is new again. I was at a company building re-usable server side components in early 2000s for various industries, which would embed in their web pages. Now, just because we're moving *some* code to the front end we're suddenly using the "micro-frontend" buzzword. People were doing this crap with s since the year dot until that was disparaged.

    • @jherr
      @jherr  Před 2 lety

      Not just s, things like jQuery components as well. We lost the ability to do this when we went with bundlers. But, as it turns out, in some cases you need that runtime dependency support.

  • @je9625
    @je9625 Před 2 lety +1

    How is this any different from a component ?

    • @jherr
      @jherr  Před 2 lety

      It is a component, but is integrated as a runtime dependency so that it can be deployed independently.
      In addition it can be packaged in a way to make it usable across different view frameworks (e.g. React components on a Vue page, etc.) This is best accomplished using Single-SPA.

    • @je9625
      @je9625 Před 2 lety

      @@jherr Oh. I see

  • @kavindanirman2645
    @kavindanirman2645 Před 2 lety

    can i get the sample

  • @dramos287
    @dramos287 Před rokem

    Con: styling can be an issue, not too terribly easy to create themes that are applicable across different MFE.

    • @jherr
      @jherr  Před rokem

      You could do an emotion theme if you could carry that context through to all the MFEs. Or you can do a common stylesheet. Or you could do a common stylesheet where the MFE injects any additional styling. There are ways, but yeah, it's not OOTB.

  • @ArulinETheKirin
    @ArulinETheKirin Před 9 měsíci

    No standards is a deal breaker

  • @FuzailShaikh
    @FuzailShaikh Před 2 lety +1

    It all sounds good but doesn't sound so much feasible and lot of overkill

    • @jherr
      @jherr  Před 2 lety

      It is overkill for small teams or small projects. Micro-FEs are more of a large company, large architecture thing. If you have multiple applications managed by multiple teams, and they need to share UI component at RUNTIME, then Micro-FEs are the way to go. If you don't need that runtime element then there is no need to pay for that complexity.

  • @trafficface
    @trafficface Před rokem

    I'm starting this video sceptical I'll be honest

  • @bamboo6044
    @bamboo6044 Před rokem

    I see that you haven't touched micro frontends much after this time period(2-3 years ago), is it that they're not trendy anymore and monorepos are the new thing, or is it that there's nothing more to talk about them?

    • @jherr
      @jherr  Před rokem +1

      There is just a lot to talk about, and I released a new video on Module Federation today.

    • @bamboo6044
      @bamboo6044 Před rokem

      @@jherr awesome

  • @Lars-ce4rd
    @Lars-ce4rd Před 3 lety +2

    Who is this "Marco Fernandes"?

    • @jherr
      @jherr  Před 3 lety +2

      One of Monny Lith's rebellious kids.

  • @mrundefined30
    @mrundefined30 Před 2 lety +1

    microfronends

  • @mrwho2513
    @mrwho2513 Před 4 lety +1

    when it's another beautiful day for me I tend to leave outside, not staying in front of the PC, but...thanks anyway

  • @FredYang
    @FredYang Před 2 lety

    Micro frontend concept is created by architect, not developer. The architect try to educate developer how to implement a vision he has, but the he doesn't know how to do it. It is politics, chaos, mess. It is vietname war that you can't win.

  • @szeredaiakos
    @szeredaiakos Před 3 lety +1

    Everything that the micro frontend approach brings to the table can be done via a monolith. That being said, vast majority of people structuring that monolith do it in the technical domain rather than the problem domain. Generally speaking they do not think about issues like extendibility, maintainability and parallel development. The basic architectural concept you are describing is decoupling, which is essential for highly resilient near endlessly extendable applications.
    When it comes to multiple js packages, 2 x 5MB js files are significantly worse than a single 20MB js file (well .. technically not cz 2 files do download simultaneously, but). Latency is much more of a problem than download speeds. That is the case since the late 2000's.
    There is nothing innovative or revolutionary about the modularity of a given project. The ideas behind it where known since the 60's. However, the industry as a whole takes React, Redux, mUI, scss, reducers, vue, the main menu, etc... as THE problem of a UI, not the actual problems which the app should solve. Hiring practices fully reflect this. The internal structures of companies fully reflect this. The hundreds of libraries tailored to help with the side effects of inadequate architectures reflect this perfectly.
    You have all my thx trying to beat some sense into people but I think we are up against a dragon we cannot slay.

    • @jherr
      @jherr  Před 3 lety +1

      This is just offering options to tame the dragon. I think you are right, it will not be slayed.

    • @WebDevCody
      @WebDevCody Před 2 lety +2

      A monolith? Not necessarily. If you have 100 developers on your project, so say 10 different teams working on different sub applications, I don’t think it makes sense to have to redeploy the entire monolith application just to fix a bug or add a feature for users. The issue with monoliths is because as a system gets larger, it’s very difficult to deploy changes; builds take longer, automated tests take longer, manually verifying an application takes longer, and there being a much higher risk someone from one team broke the app for everyone else.

    • @szeredaiakos
      @szeredaiakos Před 2 lety

      ​@@WebDevCody If I am developing that app you can bet there wont be deploy issues or breaking errors for over 350 screens with heavy data processing. Not because I am such a brilliant programmer but ... lets say I have try-catch on some pure code (independent of volatile data, like server returns). I also make heavy use of pure html nodes which has little to no effect on deploy speed.
      However, Its not just me, obviously. And the risk you are talking about is quite real, regardless of the size of the core (core: code which has afferent couplings across the entire app). One team under a joint pattern does not warrant micro frontends. Multiple, however, yes. You can't maintain discipline for multiple teams.
      If you have 100 frontend developers on a project, I wont touch that with ten foot pole.

    • @DucinDev
      @DucinDev Před 2 lety

      "Everything [...] can be done via a monolith."
      No. Don't generalize, not _everything_.
      Real-life example: Your company acquires other companies with systems built on top of completely different toolstacks (i.e. different frameworks), and those systems are really huge. And the dev teams are spread all over the world, each already maintaining one of the sub-apps. And your task is to "merge" them into a single system, and it makes a lot of sense from business perspective.
      You won't rewrite them into a uniform toolstack (way too expensive). You can put them into a single repo, but this doesn't change anything, you NEED the teams to work separately on each sub-app. Welcome to micro-frontends.

  • @StyleTFX
    @StyleTFX Před 4 lety +1

    Hi, thank you for great video! I think you might be also interested in this... We just shipped initial version of the Isomorphic Layout Composer, complete solution for Micro Frontends composition into SPA with SSR support. github.com/namecheap/ilc

  • @maorben3313
    @maorben3313 Před 2 lety +1

    Managing state across applications written with different frameworks/tools?
    Sounds like fun 🤡🤡🤡

  • @saadowain3511
    @saadowain3511 Před 3 lety

    Fix your eye glasses . Not good for your eyes

  • @andre.ramos.1234
    @andre.ramos.1234 Před rokem

    Wy this guy is always saying "micro fernand"? It's "micro front end" 🤣🤣🤣🤣🤣🤣🤣🤣

  • @FrankysButtMoney
    @FrankysButtMoney Před měsícem +1

    So... components. Micro-frontends are components.

  • @victorsalvans7418
    @victorsalvans7418 Před rokem

    First came applets, then portlets, then widgets and now micro frontends. The concept has been the same but the architecture behind changed a lot for good.