Uploaded image for project: 'OpenMRS 3.x Frontend'
  1. OpenMRS 3.x Frontend
  2. O3-909

Introduce dynamically shared dependencies

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • TBD
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      As a user I don't want to spend bandwidth on parts that are duplicated. As an architect I don't want to share more dependencies explicitly than need to be shared. These two goals should be valued high and at the moment we share way too many and reuse way too little.

      • Example (1): rxjs etc. should not be shared as they should not be used at all.
      • Example (2): The common lib in patient chart should not be bundled per micro frontend, but should be shared implicitly if possible.

      Since we rely on Webpack as our default bundler we could reuse the chunks using module federation. In this model the import map would exclusively be used for micro frontends (as it is now) and the dependency sharing would exclusively be done via module federation. This would give the best of both worlds.

      In summary:

      1. Share the current dependencies / chunks from the app shell via module federation
      2. Use SystemJS / import map exclusively for micro frontends
      3. Share currently bundled dependencies / chunks between the micro frontends (e.g., patient common lib, `carbon-components-react` etc.)

      Gliffy Diagrams

        Attachments

          Activity

            People

              florianrappl Florian Rappl
              florianrappl Florian Rappl
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: