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

Sustainable Client Architectures with Angular and Micro Apps @BASTA 2016 in Mainz, Germany

Sustainable Client Architectures with Angular and Micro Apps @BASTA 2016 in Mainz, Germany

Manfred Steyer

September 26, 2019
Tweet

More Decks by Manfred Steyer

Other Decks in Programming

Transcript

  1. @ManfredSteyer ✓ Commodore 64 ✓ 1982 ✓ ~ 1 MHz

    ✓ 64 KB RAM ✓ Disks with 170 KB
  2. @ManfredSteyer About me… • Manfred Steyer SOFTWAREarchitekt.at • Angular Trainings

    and Consultancy • Google Developer Expert (GDE) • Collaborator in the Angular Team Page ▪ 12 Manfred Steyer Public: Frankfurt, Munich, Vienna In-House: everywhere http://softwarearchitekt.at/workshops
  3. @ManfredSteyer Idea µService µService µService Client Fragment Client Fragment Client

    Fragment ✓ Easy (Tooling) ✓ One optimized Bundle ✓ Consistent  No separate deployment  Mixing Technologies: Difficult npm Packages ?
  4. @ManfredSteyer Disadvantages Distribution • Annoying within project Versioning • Old

    versions • Conflicts • How to force devs to use latest version?
  5. @ManfredSteyer Advantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project
  6. @ManfredSteyer Disadvantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project Team A Team B Contract
  7. @ManfredSteyer Solution Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project Team A Team B
  8. @ManfredSteyer Solution App App App App Lib Lib Lib Lib

    Team A Team B Lib Lib Shared Libs Lib
  9. @ManfredSteyer One or many repos? • Full isolation • Different

    lib versions • Difficult to shared code (npm) Multiple Repos • Less isolation, however: Nx allows to restrict access b/w libs • Often: One-Version-Policy (depends on implementation) • Easy to shared code Monorepo More "by the book" Pragmatic Solution
  10. @ManfredSteyer Solution App App App App Lib Lib Lib Lib

    How to "integrate" apps for the user?
  11. @ManfredSteyer µService Providing a (SPA based) Shell µApp µApp µApp

    Shell ▪ iframes ▪ Bootstrapping several SPAs ▪ + Lazy Loading
  12. @ManfredSteyer Lazy Loading const script = document.createElement('script'); script.src = 'assets/external-dashboard-tile.bundle.js';

    document.body.appendChild(script); const clientA = document.createElement('client-a'); clientA['visible'] = true; document.body.appendChild(clientA);
  13. @ManfredSteyer Bundles Custom Element 1 Custom Element 2 Custom Element

    3 Libraries: Angular, Bootstrap, … Libraries: Angular, Bootstrap, …
  14. @ManfredSteyer Sharing Libs Custom Element 1 Custom Element 2 Custom

    Element 3 Libraries: Angular, Bootstrap, … UMD Drawbacks: Complexity, no isolation ngx-build-plus
  15. @ManfredSteyer Some General Advice Shared state, navigation b/w apps Hyperlinks

    Legacy Apps or *very very* strong isolation? iframes Separate Deployment/ mix Technologies? Bootstrap several SPAs Monolith w/ Libs and Monorepo little much yes no yes no Not a good fit for public web sites
  16. @ManfredSteyer Blog > SOFTWAREarchitekt.at • A Software Architect's Approach Towards

    Using Angular (And SPAs In General) For Microservices Aka Microfrontends • A Lightweight And Solid Approach Towards Micro Frontends (Micro Service Clients) With Angular And/Or Other Frameworks • Micro Apps With Web Components Using Angular Elements