Pro Yearly is on sale from $80 to $50! »

Microfrontends

 Microfrontends

agentconf (Dornbirn, Austria)

event: https://www.agent.sh/

E6c61f085d7aceaf97b7bd00e9195514?s=128

SQUER Solutions

February 22, 2019
Tweet

Transcript

  1. @duffleit micro frontends a strive for fully verticalized systems _

    @duffleit Dornbirn, agent.sh photo by Komail Naqvi
  2. @duffleit micro frontends just another buzzword @duffleit Dornbirn, agent.sh photo

    by Komail Naqvi
  3. @duffleit micro frontends voi, leiwand @duffleit Dornbirn, agent.sh photo by

    Komail Naqvi
  4. @duffleit David Leitner ▪ Technical Consultant for Senacor Technologies ▪

    Lecturer for post diploma courses at UAS Technikum Vienna ▪ I do a couple of things around the tech- community I‘m writing code
  5. @duffleit A definition of micro frontends The idea of micro

    frontends is to extend the concepts of micro services to the frontend world.
  6. @duffleit Sam Newman: ▪ small and focused on one thing

    ▪ … to be autonomous ▪ That‘s it WHY we do them? Microservices * UBERHDTV - https://imgur.com/gallery/nup4lfX CVDD HDD/EDD *
  7. @duffleit why autonomous? ✅Independent deployments ✅Small interface surface ✅Technology agnostic

    ✅Based on standards ✅Autonomous operations ✅Parallel Development
  8. @duffleit „Microservices are stated as a contrast system to monoliths.“

    Where they came from
  9. @duffleit the application the database Ball of Mud Brian Foote

    Joseph Yoder
  10. @duffleit database layer the database business layer frontend layer

  11. @duffleit database layer the database business layer frontend layer Change

    #rippleEffect
  12. @duffleit payment the database products user shipping

  13. @duffleit DB DB DB DB DB DB DB DB DB

  14. @duffleit DB DB DB DB DB DB DB DB DB

    Independent deployments Autonomous operations Technology agnostic Based on standards Parallel Development Small interface surface
  15. @duffleit

  16. @duffleit But wait, … our microservices have actual human users.

    - Stefan Tilkov
  17. @duffleit

  18. @duffleit the frontend

  19. @duffleit The frontend is … not an implementation detail, it

    is a critical part of a microservice architecture.
  20. @duffleit frontend platform backend platform Independent deployments Autonomous operations Technology

    agnostic Based on standards Parallel Development Small interface surface a frontend monolith was born a micro frontend TO THE RESCUE Independent deployments Autonomous operations Technology agnostic Based on standards Parallel Development Small interface surface
  21. @duffleit So Many Micro Frontends, so WOW

  22. @duffleit #1: Hyperlink Integration

  23. @duffleit Flavour #1: Hyperlink Integration frontend platform backend platform Catalogue

    Ordering Payment Shipping hyperlink hyperlink hyperlink
  24. @duffleit Flavour #1: Breaking service boundaries frontend platform backend platform

    Products Ordering Payment Shipping Dash board
  25. @duffleit Flavour #1: Backend for Frontend frontend platform backend platform

    Products Ordering Payment Shipping Dash board BFF BFF BFF BFF BFF samnewman.io/patterns/architectural/bff/
  26. @duffleit Flavour #1: Hyperlink Integration Independent deployments Autonomous operations Technology

    agnostic Parallel Development
  27. @duffleit customers expect one company to have one website

  28. @duffleit Flavour #1: Reusage Problem frontend platform backend platform Catalogue

    Ordering Payment Shipping hyperlink hyperlink hyperlink Navigation Navigation Navigation
  29. @duffleit Flavour #1: Hyperlink Integration Independent deployments Autonomous operations Technology

    agnostic Parallel Development A consistent UI/UX Smooth user interaction Fast loading
  30. @duffleit #2: Build Time Integration

  31. @duffleit Flavour #2: Build Time Integration

  32. @duffleit Flavour #2: Build Time Integration BUNDLED FRONTED UI-Shared-Stuff (e.g.

    SPA-Framework, Components, Routing) Mono Repo
  33. @duffleit MonoRepo Simplifies dependency management. Allows extensive code sharing and

    reuse. package.json Shared resources (assets, components…) repository
  34. @duffleit Flavour #2: Build Time Integration Independent deployments Autonomous operations

    Technology agnostic Parallel Development A consistent UI/UX Smooth user interaction Fast loading* BUNDLED FRONTED UI-Shared-Stuff (e.g. SPA-Framework, Components)
  35. @duffleit #3: Transclusion

  36. @duffleit Flavour #3: Transclusion BUNDLED FRONTED UI-Shared-Stuff (e.g. SPA-Framework, Components)

    The bundling is done by the webserver.
  37. @duffleit Flavour #3: Server Side Includes or Edge Side Includes

    <html> <body> <!--#include virtual="/products" --> <!--#include virtual="/payments" --> <!--#include virtual="/dashboard" --> <!--#include virtual="/shipping" --> </body> </html>
  38. @duffleit Flavour #3: Transclusion Independent deployments Autonomous operations Technology agnostic

    Parallel Development A consistent UI/UX Smooth user interaction Fast loading BUNDLED FRONTED UI-Shared-Stuff (e.g. SPA-Framework, Components)
  39. @duffleit #4: App Shell Integration

  40. @duffleit Flavour #4: App Shell Integration APP SHELL Header Footer

    The aggregation is done on the client.
  41. @duffleit Flavour #4: App Shell Integration Independent deployments Autonomous operations

    Technology agnostic Parallel Development A consistent UI/UX Smooth user interaction Fast loading APP SHELL Header Footer
  42. @duffleit #5: Metaframework

  43. @duffleit Flavour #5: Metaframework Route-based modularisation is handled by a

    Metaframework Metaframework /catalogue /checkout
  44. @duffleit /catalogue /checkout APP SHELL Header Footer A matter of

    modularisation Hyperlink Integration App Shell Integration Metaframework
  45. @duffleit Flavour #5: Metaframework Route-based modularisation is handled by a

    Metaframework Metaframework /catalogue /checkout
  46. @duffleit • they are implemented with iframes. • or start

    using web components now. Flavour #5: Technology agnostic
  47. @duffleit Flavour #5: Metaframework Metaframework /catalogue /checkout Independent deployments Autonomous

    operations Technology agnostic Parallel Development A consistent UI/UX Smooth user interaction Fast loading
  48. @duffleit „a consistent UI“ 1) CDN – for static files

    2) CMS – for static content 3) A Component Library
  49. @duffleit „a component library in code“ SPA-C SPA-B SPA-A component

    library Time Effort 2019 2020 2021 component library component library a promise that you will save time in the future by reusage. you introduce a dependency between your projects. copy & own
  50. @duffleit >> A little copying is better than a little

    dependency. Rob Pike
  51. @duffleit „a component library“ If you really need a component

    library, then build it framework agnostic. If Angular can be ignored JSX + CSS Modules worked good for us. And, of course web components.
  52. @duffleit Web Components in 2019 Think they do What they

    really do Say they do what people… * If you have real world project experience with a web-component based component library which is running in production, let’s chat afterwards – I pay the beer.
  53. @duffleit a design system > component library png component Even

    if something has to look equal, it does not have to be technically the same. Source of truth Technical Representation
  54. @duffleit Flavour #5: Metaframework Metaframework /catalogue /checkout Independent deployments Autonomous

    operations Technology agnostic Parallel Development A consistent UI/UX Smooth user interaction Fast loading
  55. @duffleit https://codeburst.io/building-efficient-components-6ee2bdaea542 the metaframework will be the framework

  56. @duffleit Hyperlink Integration Build Time Integration Transclusion App Shell Integration

    Metaframework the agony of choice
  57. @duffleit every consultant. always. it depends

  58. @duffleit A general decision advice Your application is big?* The

    need for smooth user interaction Build Time Integration Hyperlink Integration Strongly Independent UI/Domain Parts Complex modularisation needed Transclusion App Shell Integration Meta- Framework * an application is big enough to justify using micro frontends, if slight UI/UX differences between the two most unrelated subpages are acceptable. Yes No
  59. @duffleit Compose your perfect MIX Landing Shop Ordering hyperlink hyperlink

    APP SHELL Header Footer <!–- SSIs --> <!--#include … --> <!--#include … -->
  60. @duffleit Key-Takeaways „Think twice if a frontend monolith does not

    fit your needs and start with a monolith first approach.“
  61. @duffleit Key-Takeaways „the 8 facilities of distributed computing are called

    facilities for a reason“
  62. @duffleit Key-Takeaways „Consider the frontend as part of your microservice

    architecture – and solve UI specific problems with UI specific solutions.“
  63. @duffleit Use the right tool for the right job. @duffleit

  64. @duffleit David Leitner ▪ Non-Hype-Train-Activist ▪ I’m writing code