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

Federated Angular – Why and How? @AngularMaster @ngPoland

Federated Angular – Why and How? @AngularMaster @ngPoland

Manfred Steyer

May 19, 2021
Tweet

More Decks by Manfred Steyer

Other Decks in Programming

Transcript

  1. @ManfredSteyer Another Huge European Bank Details from Domain A Customer

    Relationship Management Domain A Customer XYZ Domain B Domain C
  2. @ManfredSteyer Reasons for Micro Frontends Huge Product/ Product Suite Scaling

    Teams & Domains Switching out Technologies Rapitely Changing Requirements
  3. @ManfredSteyer Booking App Booking App Check-in App Check-in App Boarding

    App Boarding App Luggage App Luggage App 1st Step: Domain Slicing
  4. @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!
  5. @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')
  6. @ManfredSteyer How to Get the Microfrontend's URL? Shell (Host) Microfrontend

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

    [ "@angular/core", "…" ] shared: [ "@angular/core", "…" ]
  8. @ManfredSteyer Webpack 5 is Backed Into CLI 12 No need

    for forcing the CLI into webpack 5 anymore: "resolutions": { "webpack": "^5.0.0" }, Feel free to use yarn or npm
  9. @ManfredSteyer Booking Booking Boarding Boarding Shared Shared Feature Feature Feature

    Feature Feature Feature Feature Feature Feature Feature … … … … … … … … … … … … … … … … … … Booking App Booking App Boarding App Boarding App Btw: Also Works Perfectly w/ Multiple Repos Repository n Repository 2 Repository 1
  10. @ManfredSteyer Evolution, not Revolution! Keep Track with upcoming Angular CLI

    versions More Web Components Support SSR Support Tools for Reducing Boilerplate