The Microfrontend Revolution Module Federation with Angular @ngnl 2020

The Microfrontend Revolution Module Federation with Angular @ngnl 2020


Manfred Steyer

July 24, 2020


  1. @ManfredSteyer ManfredSteyer The Microfrontend Revolution Module Federation with Angular Manfred

  2. @ManfredSteyer Do you remember her? Bonnie Barstow, PhD

  3. @ManfredSteyer Software Engineering is a Team Sport

  4. @ManfredSteyer Coordination b/w Teams

  5. @ManfredSteyer Monolith Flight System

  6. @ManfredSteyer Booking Service Check-in Service Boarding Service Luggage Service Microservices

    Sub-Domains (DDD)
  7. @ManfredSteyer Booking App Check-in App Boarding App Luggage App Microfrontends

  8. @ManfredSteyer How to implement Microfrontends? ?

  9. @ManfredSteyer Webpack 5 Module Federation

  10. @ManfredSteyer Contents #1: Module Federation #2: Possible Roadmap

  11. @ManfredSteyer About me… Manfred Steyer, (Remote) Angular Workshops and

    Consulting Google Developer Expert for Angular Trusted Collaborator in the Angular Team Manfred Steyer
  12. @ManfredSteyer #1: Webpack 5 Module Federation

  13. @ManfredSteyer DEMO

  14. @ManfredSteyer How to load separately compiled code?

  15. @ManfredSteyer Idea const Component = import('http://other-app/xyz') Does not work with

    webpack/ Angular CLI Even lazy parts must be known at compile time!
  16. @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')
  17. @ManfredSteyer How to Get the Microfrontend's URL? Shell (Host) Microfrontend

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

    [ "@angular/core", "…" ] shared: [ "@angular/core", "…" ]
  19. @ManfredSteyer Conflicting Shared Libs Option A: Reuse it anyway Option

    B: Load own Both might be bad Prevent organizationally (e. g. conventions, contracts, monorepos) Integration-Testing Compare Versions before deployment
  20. @ManfredSteyer DEMO

  21. @ManfredSteyer #2: Possible Roadmap

  22. @ManfredSteyer Well … Webpack 5 is currently beta Shown examples:

    PoC w/ custom webpack conf + patched CLI lib CLI: Not before version 11 (fall 2020) Custom Builder (e. g. ngx-build-plus)
  23. @ManfredSteyer Free eBook Updated for Module Federation and Alternatives

  24. @ManfredSteyer Conclusion Main Purpose of µFrontends: Scaling Teams Decoupling Federation:

    Import From Other App Sharing Libs Take Care of Conflicts
  25. @ManfredSteyer Be like Bonnie and think first! Evaluate whether you

    need µFrontends No: Majestic Monolith Yes: Consider Module Federation
  26. @ManfredSteyer Contact and Downloads [web] [twitter] ManfredSteyer d Slides

    & Examples Remote Company Workshops and Consulting