Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Micro Frontends with Module Federation: Why and...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Manfred Steyer Manfred Steyer PRO
June 28, 2021
330

Micro Frontends with Module Federation: Why and How? @WeAreDevelopers 2021

Avatar for Manfred Steyer

Manfred Steyer PRO

June 28, 2021
Tweet

More Decks by Manfred Steyer

Transcript

  1. @ManfredSteyer Reasons for Micro Frontends Huge Product/ Product Suite Scaling

    Teams & Domains Switching out Technologies Rapitely Changing Requirements
  2. @ManfredSteyer Implementation iframes: Legacy & Isolation Web Components: Load into

    SPA, Hide Frameworks Hyper Links: Easy – No Meta Framework needed
  3. @ManfredSteyer Idea const Component = await import('http://other-app/xyz') Does not work

    with webpack/ Angular CLI Even lazy parts must be known at compile time!
  4. @ManfredSteyer Webpack 5 Module Federation Shell (Host) Microfrontend (Remote) //

    Maps Urls in // webpack config remotes: { mfe1: "mfe1" } // Expose files in // webpack config exposes: { './Cmp': './my.cmp.ts' } import('mfe1/Cmp')
  5. @ManfredSteyer How to Get the Microfrontend's URL? Shell (Host) Microfrontend

    (Remote) RemoteEntry.js <script src="…"></script>
  6. @ManfredSteyer How to Share Libs? Shell (Host) Microfrontend (Remote) shared:

    [ "@angular/core", "…" ] shared: [ "@angular/core", "…" ]