Micro Frontends Architecture for OpenMRS

(Burke Mamlin) #1

Continuing the discussion from An amazing future for OpenMRS:

There are some very interesting possibilities to consider for micro frontends, where a web application is comprised of relatively independent sub-applications.

The biggest wins for OpenMRS would be:

  • The ability to weave together web application functionality into a shared front end framework
  • A potential solution for modular functionality (ability to mount & unmount parts of the application)

The biggest challenges for OpenMRS with a micro frontend solution would be:

  • Creating an application with a consistent look & feel and user experience
  • Avoiding a niche solution (i.e., an approach only OpenMRS and a handful of others are still using a year or two from now, where we suddenly “own” the framework including maintaining cross-browser support and the learning curve for new devs steepens)
  • Handling context (e.g., which patient is selected) and communication between sub-applications without creating significant requirements on sub-application development or dependencies between sub-applications
  • Performance

Exciting to see how micro frontends are coming. It would be great to ride this wave… but choosing the right wave and not having it come crashing down on us. :slight_smile:

Are there other examples of micro frontend frameworks like single-spa? Is there one that is leading the pack? What do folks think about the pros & cons of adopting a micro frontend for OpenMRS?

4 Likes
(Herbert Yiga) #2

since micro front ends help divide up the front end,i think this can be a good idea especially when the front end breaks up.i had to also drop this link here as an add on https://medium.com/@benjamin.d.johnson/exploring-micro-frontends-87a120b3f71c

(Mark Goodrich) #3

I haven’t read any of this yet, and am interested in doing so… but, I’d be reluctant to adopt any micro front-end framework, no matter how great it seems, unless it’s been widely adopted and/or seems clear to be widely adopted. (ie the “niche solution” risk @burke mentions)

Take care, Mark

1 Like
(Kaweesi Joseph) #4

micro front-end framework seem a right approach to me, although there aren’t many options to choose from, i wonder what effort would be required if we attempted to write our own simpler one for easy future maintenance! Frameworks and languages are born when people want something more than what’s out there :sunny:

1 Like
(Daniel Kayiwa) #5

FWIW, the latest ThoughtWorks Technology Radar has put Micro Frontends in the ADOPT stage. https://www.thoughtworks.com/radar/techniques/micro-frontends

2 Likes
(Gregory Schmidt) #6

Link to further conversation on this topic in another thread:

(Joel Denning) #7

Also, we’re using a new github repo https://github.com/openmrs/openmrs-rfc-frontend to discuss decisions about the future of OpenMRS frontend. Feel free to jump in and participate in the pull requests, there.

1 Like
(Daniel Kayiwa) #8

FWIW: https://www.thoughtworks.com/radar/languages-and-frameworks/single-spa

(Burke Mamlin) #9

For those who weren’t able to join the design forum on a modular frontend framework for OpenMRS, the call has been uploaded to YouTube:

1 Like
2019-05-06 Design Forum: Microfrontends: The Next Steps
(Joel Denning) #10

The microfrontends squad had our first meeting yesterday. Present were myself, @jdick, @fali (ampath), @bistenes (PIH), and @angshuonline (Bahmni). If you are part of a group that was not represented in the meeting and would like to be, feel free to post here or DM me. Here are some meeting notes:

  • We are going to start merging pull requests in https://github.com/openmrs/openmrs-rfc-frontend. Merging will happen when 3 members of the microfrontends squad approve the PR. When an RFC is merged, that means “we intend to build this.” PR #1 is the first one we’re going to discuss and then merge.
  • We are starting work on a new Java module that will serve the SPA for future OpenMRS frontend code. This project will serve the HTML file for the SPA described in https://github.com/openmrs/openmrs-rfc-frontend/pulls/1. The repo is https://github.com/openmrs/openmrs-module-spa, and I just submitted the first PR.
  • We are using the #microfrontends channel in the OpenMRS Slack workspace as a communication point for the microfrontends squad.
  • The microfrontends squad is going to meet weekly. We will record meetings and upload them to be viewed by anyone in the community.
  • Our next meeting will be demoing our distributions to each other, to gain familiarity with what is out there and what commonalities there are.
  • We plan on deploying our code early and often to a test environment, so that everyone can see what we’re doing and the progress we make.
  • Questions that we discussed that are still open: “To what level will distributions share code? Entire features? Widgets within a feature?” “Does a shared navigation make sense?” “Do we first get all of the existing distributions using the SPA, and then slowly cannibalize them? Or do we start totally from scratch?”
2 Likes
(Daniel Kayiwa) #11

Thanks @joeldenning for giving us an update. :slight_smile:

  • Are the microfrontends squad meetings publicly available for any community member to join?

  • Do you plan to share the slack communication with the rest of the community who are not on slack?

  • Do you think we should create a JIRA project for this module?

(Joel Denning) #12

Hey Daniel,

  • Meetings with lots of people silently listening as I talk are pretty uncomfortable for me and hard for me to act naturally in. With the microfrontends squad we’re trying to build some momentum and teamwork which can be tougher if there is a new group each week with lots of people jumping into the conversation. I’m working on getting used to a dozen or so lurkers in phone calls :grinning:. We are trying to be as transparent as possible in our efforts, and will be using this Talk thread to provide updates. I’m open to reconsidering opening up each of the meetings to the whole community – but the last few like that have just been pretty stressful for me. I’m leaning towards just uploading the recordings here after each meeting.
  • Yeah I would like to share slack communication with everyone – is there a way that people have done that in the past without just copy/pasting large swaths of instant messages into a thread on Talk? Slack conversations have threads within the conversation and are hard to just copy/paste.
  • I don’t think a JIRA project would be helpful for us at this stage of the project. We’re still mostly just in discussions. JIRA might become helpful at a later stage of it, though.
1 Like