Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local esm-patient-common-lib in E2E tests #1855

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jayasanka-sack
Copy link
Member

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Screenshots

Related Issue

Other

@jayasanka-sack jayasanka-sack force-pushed the ft-send-orders-on-creating-enconter branch from aa6916e to d27a72e Compare May 30, 2024 08:24
@jayasanka-sack jayasanka-sack force-pushed the ft-send-orders-on-creating-enconter branch from d27a72e to dd27578 Compare May 30, 2024 08:25
@jayasanka-sack
Copy link
Member Author

@brandones @ibacher @denniskigen @vasharma05 Any idea on how to include esm-patient-common-lib?

I'm trying to find a way to avoid situations like this: #1727 (comment)

@jayasanka-sack jayasanka-sack changed the title DRAFT: Add common-lib to e2e Use local esm-patient-common-lib in E2E tests May 30, 2024
@@ -5,11 +5,13 @@ script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# create a temporary working directory
working_dir=$(mktemp -d "${TMPDIR:-/tmp/}openmrs-e2e-frontends.XXXXXXXXXX")
# get a list of all the apps in this workspace
apps=$(yarn workspaces list --json | jq -r 'if ((.location == ".") or (.location | test("form-engine-app")) or (.location | test("-app") | not)) then halt else .name end')
apps=$(yarn workspaces list --json | jq -r 'select((.location != ".") and (.location | test("form-engine-app") | not) and (.location | test("-app"))) | .name')
Copy link
Member Author

@jayasanka-sack jayasanka-sack May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this line. Just simplified it to work on mac.

@brandones
Copy link
Contributor

I worry this problem might actually be caused by non-determinism in webpack module federation resolution. This is an old problem. The gist is that each app has its own copy of esm-patient-common-lib, and the first app to load will have its copy loaded, and all other apps will just use that copy. So if the app you're working on loads first, you're good, but if some other app loads first, then your app will try to use the old version of esm-patient-common-lib and it will break. I'm not sure whether this is causing the problem or not.

Here's the issue I made for it a long time ago. Actually it looks like I had a good idea about how to solve it, but we never implemented it. Messing with that stuff is challenging work.

@ibacher
Copy link
Member

ibacher commented May 31, 2024

This might actually be easier to solve with module federation 2.0, since there's now a sane way to add plugins to the runtime, e.g., the resolveShare hook looks like it'd do the job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants