Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Import Maps and Modern Hydration: The Future of...

Import Maps and Modern Hydration: The Future of Micro Frontends?

Manfred Steyer

April 26, 2023
Tweet

More Decks by Manfred Steyer

Other Decks in Programming

Transcript

  1. @ManfredSteyer Benefits of Micro Frontends Peltonen, Mezzalira, and Taibi: Motivations,

    benefits, and issues for adopting Micro-Frontends: A Multivocal Literature Review
  2. @ManfredSteyer #1 Module Federation 101 #2 Import Maps #3 Module

    Federation on Import Maps #4 Hydration for Micro Frontends
  3. @ManfredSteyer Shell (Host) Microfrontend (Remote) // Maps Urls in //

    webpack config remotes: { mfe1: "http://..." } // Expose files in // webpack config exposes: { './Cmp': './my.cmp.ts' } import('mfe1/Cmp')
  4. @ManfredSteyer <script type="module"> import { format, parseISO } from 'date-fns';

    const date = parseISO('2022-08-15'); const weekday = format(date, 'EEE'); console.log(`It's a ${weekday}.`); </script>
  5. @ManfredSteyer <script type="module"> import { format, parseISO } from 'date-fns';

    const date = parseISO('2022-08-15'); const weekday = format(date, 'EEE'); console.log(`It's a ${weekday}.`); </script>
  6. @ManfredSteyer <script type="importmap"> { "imports": { […] }, "scopes": {

    "http://this-app/module.mjs": { "date-fns": "./libs/this-date-fns.js" }, "http://that-app/module.mjs": { "date-fns": "./libs/that-date-fns.js" } } } </script>
  7. @ManfredSteyer Meta Data • Providing at compile time • Loading

    at runtime Bundling • Remotes • Shared packages • Angular compiler Import Map • Generate using meta data • Scopes for version mismatches
  8. @ManfredSteyer Module Federation: Mental Model rocks! Import Maps: Provide low

    level building blocks Native Federation: Insurance Hydration via ProxyComp.