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

Make React the primary framework



    • Story
    • Status: In Progress
    • TBD
    • Resolution: Unresolved
    • None
    • None
    • None
    • None


      As a user I want my screens to render as fast as possible. Right now every React (extension / page / ...) component spawns its own render tree. This is very costly and has some major disadvantages. Mainly, we need to create a lot of context for each element, which could be shared. One example is the router.

      We partially use the `react-router`, however, only to make changes to the `history` API (*remark: this is *not the `history` package), which are then triggering a change in `single-spa` router. Ideally, the router we use is already the `react-router`.

      For React we do not rely on `single-spa` anyway. So going away here is easy. For other frameworks such as Angular (which ones should we support?) we could shim the generic lifecycle of `single-spa` to create a generic React component instead. The process is rather straight forward and does not require much magic besides a well-placed Webpack alias.

      In summary:

      1. Ensure all React components render in the same React tree
      2. Perform routing via the `react-router` / `history` package
      3. Reuse as much context as possible
      4. Shim the `single-spa` lifecycle converters such as the Angular one

      Gliffy Diagrams




              florianrappl Florian Rappl
              florianrappl Florian Rappl
              0 Vote for this issue
              3 Start watching this issue