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

(BREAKING) Retire concept of ConnectedExtension #1154

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

ibacher
Copy link
Member

@ibacher ibacher commented Sep 18, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. Ensure your PR title includes a conventional commit label (such as feat, fix, or chore, among others). See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.

Summary

esm-core tracks extensions in various forms (there are others; these are the relevant ones here):

  • ExtensionDefinition: An extension as defined in an apps routes.json
  • ExtensionRegistration: An extension registered with the extension system
  • AssignedExtension: An extension instance, representing an extension in a specific slot
  • ConnectedExtension: An "assigned" extension that is also available due to either the presence of a feature flag or the browsers online status and the extensions definition.

This PR collapses the distinction between AssignedExtension and ConnectedExtension, that is, an extension is only assigned to a slot now if:

  • It is attached to the slot
  • The current user has all require privileges to load the extension
  • If the extension is behind a feature flag, the feature flag is active
  • If the browser is online, the extension is configured to load online and if the browser is offline the extension is configured to load while offline

This is accomplished by making the "output extension store" dependent on the featureFlag store, the browser's online status, and the current session store. These dependencies are now centralized as part of the internal getAssignedExtensionsFromSlotData() and the relevant public APIs have been updated to supply the necessary data.

Prior to this change, assigned extensions were not recalculated globally, but instead, each instance of an ExtensionSlot would call useConnectedExtensions(), which would load the current feature flags and online status and use these to filter the AssignedExtensions.

There are two reasons for this change:

  1. It should be more efficient to calculate the extensions that should be rendered, since the session store, current feature flags, and browser online status only needs to be loaded once rather than once-per-useConnectedExtensions() instance.
  2. This makes the extension system easier to consume correctly outside of React, because all relevant changes are purely part of the global extension store and not layered on top of that.

This PR removes all of the ConnectedExtension internals, however, the useConnectedExtensions() hook (now an alias for useAssignedExtensions()) remains so as to not break too much code.

I've also taken this opportunity to completely remove the support for the wrap property from the React Extension object.

Screenshots

Related Issue

Other

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Size Change: +189 kB (+3.18%)

Total Size: 6.11 MB

Filename Size Change
packages/apps/esm-devtools-app/dist/889.js 372 kB +47.1 kB (+14.49%) ⚠️
packages/apps/esm-help-menu-app/dist/889.js 372 kB +47.1 kB (+14.49%) ⚠️
packages/apps/esm-implementer-tools-app/dist/889.js 372 kB +47.1 kB (+14.49%) ⚠️
packages/apps/esm-login-app/dist/889.js 372 kB +47.1 kB (+14.49%) ⚠️
packages/apps/esm-offline-tools-app/dist/889.js 372 kB +47.1 kB (+14.49%) ⚠️
packages/apps/esm-primary-navigation-app/dist/889.js 372 kB +47.1 kB (+14.49%) ⚠️
packages/framework/esm-styleguide/dist/openmrs-esm-styleguide.js 192 kB +46.9 kB (+32.28%) 🚨
packages/shell/esm-app-shell/dist/716b4e6132de5382.js 0 B -64.1 kB (removed) 🏆
packages/shell/esm-app-shell/dist/fca48f278eb0a77d.js 0 B -41.3 kB (removed) 🏆
packages/shell/esm-app-shell/dist/openmrs.847440047e257776.js 0 B -21.6 kB (removed) 🏆
ℹ️ View Unchanged
Filename Size Change
packages/apps/esm-devtools-app/dist/593.js 149 kB 0 B
packages/apps/esm-devtools-app/dist/642.js 21.1 kB 0 B
packages/apps/esm-devtools-app/dist/657.js 7.02 kB 0 B
packages/apps/esm-devtools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-devtools-app/dist/762.js 4.1 kB 0 B
packages/apps/esm-devtools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-devtools-app/dist/875.js 11.6 kB 0 B
packages/apps/esm-devtools-app/dist/988.js 326 B 0 B
packages/apps/esm-devtools-app/dist/main.js 3.23 kB 0 B
packages/apps/esm-devtools-app/dist/openmrs-esm-devtools-app.js 3.28 kB 0 B
packages/apps/esm-help-menu-app/dist/167.js 1.07 kB 0 B
packages/apps/esm-help-menu-app/dist/248.js 7.08 kB +11 B (+0.16%)
packages/apps/esm-help-menu-app/dist/611.js 2.45 kB 0 B
packages/apps/esm-help-menu-app/dist/642.js 21.1 kB 0 B
packages/apps/esm-help-menu-app/dist/657.js 7.02 kB 0 B
packages/apps/esm-help-menu-app/dist/662.js 147 kB 0 B
packages/apps/esm-help-menu-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-help-menu-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-help-menu-app/dist/958.js 3.74 kB 0 B
packages/apps/esm-help-menu-app/dist/main.js 8.56 kB 0 B
packages/apps/esm-help-menu-app/dist/openmrs-esm-help-menu-app.js 3.23 kB 0 B
packages/apps/esm-implementer-tools-app/dist/152.js 585 B 0 B
packages/apps/esm-implementer-tools-app/dist/236.js 583 B 0 B
packages/apps/esm-implementer-tools-app/dist/240.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/271.js 744 B 0 B
packages/apps/esm-implementer-tools-app/dist/272.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/289.js 14.2 kB 0 B
packages/apps/esm-implementer-tools-app/dist/319.js 675 B 0 B
packages/apps/esm-implementer-tools-app/dist/336.js 137 kB 0 B
packages/apps/esm-implementer-tools-app/dist/36.js 2.49 kB 0 B
packages/apps/esm-implementer-tools-app/dist/378.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/426.js 27.8 kB 0 B
packages/apps/esm-implementer-tools-app/dist/441.js 4.38 kB 0 B
packages/apps/esm-implementer-tools-app/dist/448.js 4.66 kB 0 B
packages/apps/esm-implementer-tools-app/dist/460.js 775 B 0 B
packages/apps/esm-implementer-tools-app/dist/491.js 134 kB 0 B
packages/apps/esm-implementer-tools-app/dist/539.js 583 B 0 B
packages/apps/esm-implementer-tools-app/dist/574.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/587.js 2.93 kB 0 B
packages/apps/esm-implementer-tools-app/dist/625.js 585 B 0 B
packages/apps/esm-implementer-tools-app/dist/642.js 21.1 kB 0 B
packages/apps/esm-implementer-tools-app/dist/644.js 739 B 0 B
packages/apps/esm-implementer-tools-app/dist/657.js 7.03 kB 0 B
packages/apps/esm-implementer-tools-app/dist/667.js 121 kB 0 B
packages/apps/esm-implementer-tools-app/dist/673.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/705.js 585 B 0 B
packages/apps/esm-implementer-tools-app/dist/711.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/727.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-implementer-tools-app/dist/737.js 584 B 0 B
packages/apps/esm-implementer-tools-app/dist/757.js 692 B 0 B
packages/apps/esm-implementer-tools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-implementer-tools-app/dist/807.js 583 B 0 B
packages/apps/esm-implementer-tools-app/dist/833.js 714 B 0 B
packages/apps/esm-implementer-tools-app/dist/845.js 6.43 kB 0 B
packages/apps/esm-implementer-tools-app/dist/859.js 3.09 kB 0 B
packages/apps/esm-implementer-tools-app/dist/873.js 3.67 kB 0 B
packages/apps/esm-implementer-tools-app/dist/899.js 581 B 0 B
packages/apps/esm-implementer-tools-app/dist/main.js 20.9 kB 0 B
packages/apps/esm-implementer-tools-app/dist/openmrs-esm-implementer-tools-app.js 3.4 kB 0 B
packages/apps/esm-login-app/dist/202.js 2.57 kB 0 B
packages/apps/esm-login-app/dist/236.js 710 B 0 B
packages/apps/esm-login-app/dist/240.js 785 B 0 B
packages/apps/esm-login-app/dist/271.js 874 B 0 B
packages/apps/esm-login-app/dist/272.js 696 B 0 B
packages/apps/esm-login-app/dist/319.js 799 B 0 B
packages/apps/esm-login-app/dist/336.js 767 B 0 B
packages/apps/esm-login-app/dist/378.js 687 B 0 B
packages/apps/esm-login-app/dist/415.js 26.7 kB 0 B
packages/apps/esm-login-app/dist/460.js 867 B 0 B
packages/apps/esm-login-app/dist/539.js 717 B 0 B
packages/apps/esm-login-app/dist/574.js 687 B 0 B
packages/apps/esm-login-app/dist/593.js 149 kB 0 B
packages/apps/esm-login-app/dist/625.js 688 B 0 B
packages/apps/esm-login-app/dist/63.js 16.5 kB 0 B
packages/apps/esm-login-app/dist/642.js 21.1 kB 0 B
packages/apps/esm-login-app/dist/644.js 873 B 0 B
packages/apps/esm-login-app/dist/657.js 7.02 kB 0 B
packages/apps/esm-login-app/dist/673.js 726 B 0 B
packages/apps/esm-login-app/dist/676.js 2.23 kB 0 B
packages/apps/esm-login-app/dist/7.js 3.03 kB 0 B
packages/apps/esm-login-app/dist/705.js 687 B 0 B
packages/apps/esm-login-app/dist/711.js 687 B 0 B
packages/apps/esm-login-app/dist/727.js 687 B 0 B
packages/apps/esm-login-app/dist/735.js 2.62 kB 0 B
packages/apps/esm-login-app/dist/737.js 687 B 0 B
packages/apps/esm-login-app/dist/755.js 3.36 kB 0 B
packages/apps/esm-login-app/dist/757.js 847 B 0 B
packages/apps/esm-login-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-login-app/dist/80.js 30.6 kB 0 B
packages/apps/esm-login-app/dist/807.js 1 kB 0 B
packages/apps/esm-login-app/dist/833.js 815 B 0 B
packages/apps/esm-login-app/dist/859.js 3.08 kB 0 B
packages/apps/esm-login-app/dist/899.js 684 B 0 B
packages/apps/esm-login-app/dist/93.js 2.04 kB 0 B
packages/apps/esm-login-app/dist/main.js 59 kB 0 B
packages/apps/esm-login-app/dist/openmrs-esm-login-app.js 3.46 kB 0 B
packages/apps/esm-offline-tools-app/dist/236.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/240.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/271.js 1.19 kB 0 B
packages/apps/esm-offline-tools-app/dist/272.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/319.js 1.13 kB 0 B
packages/apps/esm-offline-tools-app/dist/336.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/378.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/460.js 1.3 kB 0 B
packages/apps/esm-offline-tools-app/dist/539.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/574.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/601.js 142 kB 0 B
packages/apps/esm-offline-tools-app/dist/625.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/63.js 16.5 kB 0 B
packages/apps/esm-offline-tools-app/dist/642.js 21.1 kB 0 B
packages/apps/esm-offline-tools-app/dist/644.js 1.19 kB 0 B
packages/apps/esm-offline-tools-app/dist/645.js 91.5 kB 0 B
packages/apps/esm-offline-tools-app/dist/657.js 7.02 kB 0 B
packages/apps/esm-offline-tools-app/dist/673.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/703.js 6.32 kB 0 B
packages/apps/esm-offline-tools-app/dist/705.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/711.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/727.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-offline-tools-app/dist/737.js 1.03 kB 0 B
packages/apps/esm-offline-tools-app/dist/757.js 1.19 kB 0 B
packages/apps/esm-offline-tools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-offline-tools-app/dist/807.js 1.1 kB 0 B
packages/apps/esm-offline-tools-app/dist/833.js 1.21 kB 0 B
packages/apps/esm-offline-tools-app/dist/859.js 3.09 kB 0 B
packages/apps/esm-offline-tools-app/dist/899.js 1.02 kB 0 B
packages/apps/esm-offline-tools-app/dist/947.js 8.66 kB 0 B
packages/apps/esm-offline-tools-app/dist/main.js 107 kB 0 B
packages/apps/esm-offline-tools-app/dist/openmrs-esm-offline-tools-app.js 3.39 kB 0 B
packages/apps/esm-primary-navigation-app/dist/236.js 230 B 0 B
packages/apps/esm-primary-navigation-app/dist/240.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/271.js 270 B 0 B
packages/apps/esm-primary-navigation-app/dist/272.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/319.js 232 B 0 B
packages/apps/esm-primary-navigation-app/dist/336.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/378.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/460.js 266 B 0 B
packages/apps/esm-primary-navigation-app/dist/482.js 15.2 kB 0 B
packages/apps/esm-primary-navigation-app/dist/513.js 146 kB 0 B
packages/apps/esm-primary-navigation-app/dist/539.js 230 B 0 B
packages/apps/esm-primary-navigation-app/dist/574.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/577.js 7.64 kB 0 B
packages/apps/esm-primary-navigation-app/dist/619.js 6.45 kB 0 B
packages/apps/esm-primary-navigation-app/dist/625.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/63.js 16.5 kB 0 B
packages/apps/esm-primary-navigation-app/dist/644.js 270 B 0 B
packages/apps/esm-primary-navigation-app/dist/657.js 7.03 kB 0 B
packages/apps/esm-primary-navigation-app/dist/673.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/705.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/711.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/727.js 231 B 0 B
packages/apps/esm-primary-navigation-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-primary-navigation-app/dist/737.js 230 B 0 B
packages/apps/esm-primary-navigation-app/dist/757.js 237 B 0 B
packages/apps/esm-primary-navigation-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-primary-navigation-app/dist/807.js 291 B 0 B
packages/apps/esm-primary-navigation-app/dist/833.js 258 B 0 B
packages/apps/esm-primary-navigation-app/dist/888.js 24.6 kB +2 B (+0.01%)
packages/apps/esm-primary-navigation-app/dist/899.js 228 B 0 B
packages/apps/esm-primary-navigation-app/dist/933.js 3.63 kB 0 B
packages/apps/esm-primary-navigation-app/dist/main.js 30.1 kB +1 B (0%)
packages/apps/esm-primary-navigation-app/dist/openmrs-esm-primary-navigation-app.js 3.38 kB 0 B
packages/framework/esm-api/dist/openmrs-esm-api.js 16.8 kB +547 B (+3.37%)
packages/framework/esm-config/dist/openmrs-esm-module-config.js 8.41 kB 0 B
packages/framework/esm-context/dist/openmrs-esm-context.js 1.16 kB 0 B
packages/framework/esm-dynamic-loading/dist/openmrs-esm-dynamic-loading.js 2.89 kB 0 B
packages/framework/esm-error-handling/dist/openmrs-esm-error-handling.js 891 B 0 B
packages/framework/esm-expression-evaluator/dist/openmrs-esm-expression-evaluator.js 8.98 kB 0 B
packages/framework/esm-extensions/dist/openmrs-esm-extensions.js 25.3 kB +478 B (+1.93%)
packages/framework/esm-feature-flags/dist/openmrs-esm-feature-flags.js 1.66 kB 0 B
packages/framework/esm-framework/dist/278.openmrs-esm-framework.js 14.5 kB 0 B
packages/framework/esm-framework/dist/530.openmrs-esm-framework.js 2.93 kB 0 B
packages/framework/esm-framework/dist/588.openmrs-esm-framework.js 2.15 kB 0 B
packages/framework/esm-framework/dist/619.openmrs-esm-framework.js 6.49 kB 0 B
packages/framework/esm-framework/dist/645.openmrs-esm-framework.js 9.3 kB 0 B
packages/framework/esm-framework/dist/735.openmrs-esm-framework.js 2.65 kB 0 B
packages/framework/esm-framework/dist/746.openmrs-esm-framework.js 6.14 kB 0 B
packages/framework/esm-framework/dist/788.openmrs-esm-framework.js 42.9 kB 0 B
packages/framework/esm-framework/dist/openmrs-esm-framework.js 456 kB +850 B (+0.19%)
packages/framework/esm-globals/dist/openmrs-esm-globals.js 791 B 0 B
packages/framework/esm-navigation/dist/openmrs-esm-navigation.js 9.34 kB 0 B
packages/framework/esm-offline/dist/openmrs-esm-offline.js 34.4 kB 0 B
packages/framework/esm-react-utils/dist/openmrs-esm-react-utils.js 21.9 kB -9 B (-0.04%)
packages/framework/esm-routes/dist/openmrs-esm-utils.js 4.67 kB 0 B
packages/framework/esm-state/dist/openmrs-esm-state.js 1.59 kB +663 B (+71.6%) 🆘
packages/framework/esm-translations/dist/openmrs-esm-core-translations.js 1.87 kB 0 B
packages/framework/esm-utils/dist/openmrs-esm-utils.js 45.5 kB 0 B
packages/shell/esm-app-shell/dist/02af6181aebfc3a3.js 172 kB 0 B
packages/shell/esm-app-shell/dist/03d8de141de1014a.js 41.3 kB 0 B
packages/shell/esm-app-shell/dist/0a2998dc20d2f16e.js 1 kB 0 B
packages/shell/esm-app-shell/dist/0cca73cc48929cf3.js 0 B -6.96 kB (removed) 🏆
packages/shell/esm-app-shell/dist/0f34790b627dbc8a.js 999 B 0 B
packages/shell/esm-app-shell/dist/1ddd13fb6bce4eec.js 999 B 0 B
packages/shell/esm-app-shell/dist/22f1ae6333aaf130.js 1 kB 0 B
packages/shell/esm-app-shell/dist/2d603d974bbe1cd2.js 1 kB 0 B
packages/shell/esm-app-shell/dist/34d099d181ce29d4.js 3.76 kB 0 B
packages/shell/esm-app-shell/dist/38d4b8fb75f8850c.js 18.3 kB 0 B
packages/shell/esm-app-shell/dist/3b01402cd7292844.js 2.85 kB 0 B
packages/shell/esm-app-shell/dist/4487ab6d4de230fb.js 1.02 kB 0 B
packages/shell/esm-app-shell/dist/47eb8c10a90fce5e.js 0 B -5.77 kB (removed) 🏆
packages/shell/esm-app-shell/dist/4c87dd6c38beff17.js 1.29 kB 0 B
packages/shell/esm-app-shell/dist/572e81f004cc10c5.js 15.1 kB 0 B
packages/shell/esm-app-shell/dist/591c7ae1d1802a08.js 1.29 kB 0 B
packages/shell/esm-app-shell/dist/62a41f41cd81ca3d.js 999 B 0 B
packages/shell/esm-app-shell/dist/6f47008d9c93c1cb.js 3.33 kB 0 B
packages/shell/esm-app-shell/dist/71ab27e0b8d1949e.js 2.58 kB 0 B
packages/shell/esm-app-shell/dist/7b204450699b0daf.js 2.6 kB 0 B
packages/shell/esm-app-shell/dist/7e0f8ed3cf80f0c9.js 1 kB 0 B
packages/shell/esm-app-shell/dist/8401908d89dfddc9.js 999 B 0 B
packages/shell/esm-app-shell/dist/863caa19678eb01d.js 1.27 kB 0 B
packages/shell/esm-app-shell/dist/8e0d11f862dfbba6.js 626 B 0 B
packages/shell/esm-app-shell/dist/8edec91e406a4eaf.js 1.59 kB 0 B
packages/shell/esm-app-shell/dist/91b55dee51c34a39.js 1 kB 0 B
packages/shell/esm-app-shell/dist/932785417ef383b8.js 6.99 kB 0 B
packages/shell/esm-app-shell/dist/9ee9680edb91f5bc.js 1.18 kB 0 B
packages/shell/esm-app-shell/dist/a05840be5ec988e7.js 1 kB 0 B
packages/shell/esm-app-shell/dist/a7792d6252d85b20.js 43 kB 0 B
packages/shell/esm-app-shell/dist/a7efa2596cd2be4f.js 168 kB 0 B
packages/shell/esm-app-shell/dist/b407f548b6fadfa3.js 3.08 kB 0 B
packages/shell/esm-app-shell/dist/b586ec19d4d04d1d.js 999 B 0 B
packages/shell/esm-app-shell/dist/b87a5878f8961d1a.js 2.23 kB 0 B
packages/shell/esm-app-shell/dist/b88532bde74b513a.js 9.41 kB 0 B
packages/shell/esm-app-shell/dist/bb04bb60f8aa150f.js 3.04 kB 0 B
packages/shell/esm-app-shell/dist/bf2915da457ede35.js 1.04 kB 0 B
packages/shell/esm-app-shell/dist/bfcb9bae63b830fd.js 999 B 0 B
packages/shell/esm-app-shell/dist/cc0d293bb9b870d9.js 3.38 kB 0 B
packages/shell/esm-app-shell/dist/d3a90e50edb54206.js 1 kB 0 B
packages/shell/esm-app-shell/dist/d80464c66e5d20d7.js 3.23 kB 0 B
packages/shell/esm-app-shell/dist/dc0af409f472ca13.js 5.77 kB 0 B
packages/shell/esm-app-shell/dist/ddbc37fe99987599.js 0 B -3.76 kB (removed) 🏆
packages/shell/esm-app-shell/dist/e09b68a48d3b87dd.js 1 kB 0 B
packages/shell/esm-app-shell/dist/e419a658f4742c3e.js 9.36 kB 0 B
packages/shell/esm-app-shell/dist/f5c65190072bb3f7.js 626 B 0 B
packages/shell/esm-app-shell/dist/f6d2b6a9a46387dd.js 999 B 0 B
packages/shell/esm-app-shell/dist/fcb385df17a82210.js 6.77 kB 0 B
packages/shell/esm-app-shell/dist/fe5c6c14981dd0d8.js 6.97 kB 0 B
packages/shell/esm-app-shell/dist/fedbe5fffc1705bd.js 64 kB 0 B
packages/shell/esm-app-shell/dist/openmrs.d660708562745f92.js 21.6 kB 0 B
packages/shell/esm-app-shell/dist/service-worker.js 46.6 kB +4 B (+0.01%)
packages/tooling/openmrs/dist/cli.js 2.96 kB 0 B
packages/tooling/openmrs/dist/commands/assemble.js 3.31 kB 0 B
packages/tooling/openmrs/dist/commands/build.js 1.34 kB 0 B
packages/tooling/openmrs/dist/commands/debug.js 543 B 0 B
packages/tooling/openmrs/dist/commands/develop.js 2.71 kB 0 B
packages/tooling/openmrs/dist/commands/index.js 437 B 0 B
packages/tooling/openmrs/dist/commands/start.js 850 B 0 B
packages/tooling/openmrs/dist/index.js 517 B 0 B
packages/tooling/openmrs/dist/runner.js 640 B 0 B
packages/tooling/openmrs/dist/utils/config.js 726 B 0 B
packages/tooling/openmrs/dist/utils/debugger.js 575 B 0 B
packages/tooling/openmrs/dist/utils/dependencies.js 643 B 0 B
packages/tooling/openmrs/dist/utils/helpers.js 397 B 0 B
packages/tooling/openmrs/dist/utils/importmap.js 3.07 kB 0 B
packages/tooling/openmrs/dist/utils/index.js 443 B 0 B
packages/tooling/openmrs/dist/utils/logger.js 368 B 0 B
packages/tooling/openmrs/dist/utils/npmConfig.js 831 B 0 B
packages/tooling/openmrs/dist/utils/untar.js 725 B 0 B
packages/tooling/openmrs/dist/utils/variables.js 192 B 0 B
packages/tooling/openmrs/dist/utils/webpack.js 278 B 0 B
packages/tooling/webpack-config/dist/index.js 3.61 kB 0 B

compressed-size-action

@@ -1,5 +1,5 @@
import React from 'react';
import { act, render, screen, waitFor } from '@testing-library/react';
import { act, render, prettyDOM, screen, waitFor } from '@testing-library/react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import { act, render, prettyDOM, screen, waitFor } from '@testing-library/react';
import { act, render, screen, waitFor } from '@testing-library/react';

Unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was using it for troubleshooting and forgot to remove it.

if (openWorkspace.title == getWorkspaceTitle(openWorkspace, openWorkspace.additionalProps)) {
openWorkspace.title = getWorkspaceTitle(openWorkspace, newWorkspace.additionalProps);
if (openWorkspace.title === getWorkspaceTitle(openWorkspace, openWorkspace.additionalProps)) {
openWorkspace.title = getWorkspaceTitle(newWorkspace, newWorkspace.additionalProps);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch

Copy link
Collaborator

@brandones brandones left a comment

Choose a reason for hiding this comment

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

Excellent change, thank you @ibacher . A couple suggestions but generally LGTM.

@ibacher ibacher force-pushed the breaking/retire-connected-extensions branch from 4651685 to 097b0f6 Compare October 2, 2024 20:28
Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @ibacher.

@ibacher ibacher merged commit f828848 into main Oct 7, 2024
13 of 14 checks passed
@ibacher ibacher deleted the breaking/retire-connected-extensions branch October 7, 2024 18:56
denniskigen added a commit to openmrs/openmrs-esm-patient-chart that referenced this pull request Oct 8, 2024
…ponent

This fix addresses a potential runtime error in the VisitSummary component when a visit has no extensions. The error occurs due to recent changes in the [useConnectedExtensions](openmrs/openmrs-esm-core#1154) hook, which possibly now loads extensions asynchronously.

The [current implementation](https://github.com/openmrs/openmrs-esm-patient-chart/blob/3b13b5b5d7ce39dbe54508a2041ececb28f2d33e/packages/esm-patient-chart-app/src/visit/visits-widget/past-visits-components/visit-summary.component.tsx#L157) assumes extensions are always available when rendering. If extensions are not yet loaded when the component renders, it throws an error.

I've remedied this by adding optional chaining to the extensions mapping.
This ensures the component gracefully handles cases where extensions are undefined or not yet loaded.
Samstar10 pushed a commit to Samstar10/openmrs-esm-core that referenced this pull request Oct 29, 2024
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