Skip to content

Releases: openmrs/openmrs-esm-core

v5.3.0

21 Nov 15:47
52fcfc3
Compare
Choose a tag to compare

Highlights

Core 5.3.0 brings a number of new features and improvements to O3. Most notably, these are:

Improved performance

@ibacher's next iteration of performance improvements involves reducing the number of dynamic imports shipped by frontend modules. This is achieved by importing components directly in frontend module's entry points instead of dynamically importing them via function calls. This change means that Webpack's chunking algorithm ends up creating fewer chunks, and the corollary is the application loads faster as there are fewer network requests to be made. Read more about this in the migration guide here.

Improved support for pluralization and interpolation in translations

Pluralization and interpolation now have improved support in O3. @vasharma05's work on upgrading the dependencies and amending the translation keys and strings has made this possible. Developers can now use the following syntax to interpolate variables and leverage pluralization in translations:

const totalResults = searchResults.length;

return (
  // ...
  
  {t('searchResultsCount', '{{ count }} search results'), { count: totalResults }}
  
  // ...
)

With the following translations:

{
  "searchResultsCount_one": "{{count}} search result",
  "searchResultsCount_other": "{{count}} search results",
}

i18next will interpolate the {{ count }} variable and use the correct pluralization key based on the value of count.

Support for non-Gregorian calendars

v5.3.0 adds support for registering default custom calendars on a per-locale basis. This means that developers can now register a custom calendar for a locale and use it in their application. Currently, we've only added explicit support for the Ethiopian calendar, which gets rendered when the locale is set to Amharic. See @ibacher's PR for more details.

New snackbar notification component

In keeping with the latest iteration of our Notifications design guidelines, @hadijahkyampeire has added a new snackbar notification component that'll be used to display the bulk of user task-generated notifications in O3. Work is currently ongoing to leverage the new component across the application.

Yarn 4 support

We're now using Yarn v4! That means we're also migrating monorepo management concerns from using lerna to using yarn workspaces. An important corollary of this change is that we'll now require a minimum of Node 18 to run 03.

Features

  • (feat) Switch translation formatting to Intl API format by @vasharma05 in #799
  • (feat) O3-2484: The application should revert to default locale on logout by @vasharma05 in #782
  • (feat) Synchronously load most extensions and pages by @ibacher in #806
  • (feat) Adds support for non-Gregorian calendars, with special work-arounds for Amharic by @ibacher in #790
  • (feat) Smoother scrolling for locations by @ibacher in #810
  • (feat) O3-2504: Allow saving user preference for login location as user property by @vasharma05 in #793
  • (feat) O3-2533: Add a snackbar notification by @hadijahkyampeire in #809
  • (feat) Adding Arabic translations by @michaelbontyes in #787
  • (refactor) Use classNames to apply classes conditionally by @denniskigen in #807

Bug fixes

  • (fix) Fix the appearance of Carbon icon-only buttons by @denniskigen in #781
  • (fix) Offline actions component added by @icrc-jofrancisco in #784
  • (fix) O3-2506 Fix the appearance of Carbon icon-only buttons by @ibacher in #792
  • (fix) Devtools panel Switcher components shouldn't truncate their content by @denniskigen in #794
  • (fix) Adds two React-hooks, shallowEqual implementation and some small fixes by @ibacher in #797
  • (fix) O3-2526 Resolve Overlay Issue Blocking LeftNav Access on Tablet Devices by @donaldkibet in #796
  • (fix) Locale switcher should default to user's defaultLocale or the session locale by @vasharma05 in #783
  • (fix) Fix requiredVersion for SWR share by @ibacher in #802
  • (fix) PWA Manifest should respect the OpenMRS public path by @ibacher in #803
  • (fix) O3-2543 useSession not always receiving updated session object by @brandones in #804
  • (fix) Fix table header color for datatables by @denniskigen in #808
  • (fix) O3-2537: Fixing the spacing of toast notifications by @jona42-ui in #805
  • (fix) No toast should be shown if the checkbox for location preference in the location picker wasn't checked by @vasharma05 in #812
  • (fix) Remove background color from overflow menu buttons by @denniskigen in #819
  • (fix) O3-2476: isOmrsDateStrict should accept dates with negative timezone… by @mseaton in #785

Housekeeping

New contributors

Full Changelog: v5.2.0...v5.3.0

v5.2.0

05 Oct 18:41
f46cd16
Compare
Choose a tag to compare

Highlights

Core 5.2.0 brings a number of new features and improvements and a host of bug fixes. The most notable changes are:

SWR is now a shared library

Frontend modules can now leverage the SWR as a ModuleFederation shared dependency. This means that we can now leverage proper request deduplication and a shared cache for all API calls that use SWR. Additionally, this change should make it possible to mutate the cache from one module and have that mutation reflected in other modules.

Fixes to the openmrs tooling

This release fixes an issue where the openmrs tooling would fail to build frontend assets correctly. This was due to an issue with the way pure CSS files were handled by Wepback. #778 makes it so that pure CSS files are handled by the css-loader. Additionally. we've added a check to the distro reference application that should catch build failures and show an error message.

A new useDebounce hook

The framework now exports a useDebounce hook that can be used to debounce requests to the backend. Previously, we've had smatterings of similar logic in various places, with one specific downside: the custom implementations used for search inputs would lead the inputs changing from controlled to uncontrolled components. This is now handled by the hook, which provides a simple API for debouncing requests. Here's a snippet showing how to leverage the hook:

import { useDebounce } from "@openmrs/esm-framework";

function SearchComponent() {
  const [searchTerm, setSearchTerm] = useState('');
  const debouncedSearchTerm = useDebounce(searchTerm);
  const swrResult = useSWR(`/api/search?q=${debouncedSearchTerm}`)
 
 return (
   <Search
     labelText={t('search', 'Search')}
     onChange={(e) => setSearchTerm(e.target.value)}
     value={searchTerm}
   />
 )
}

export default SearchComponent;

Introduction of a locale-sensitive date picker that supports the Ethiopian calendar

The framework now provides a locale-sensitive datepicker with support for the Ethiopian calendar. For Ethiopian locales (am, am_ET, and ti_ET), this custom datepicker will be used as the default. The functionality for the datepicker is provided by the React Spectrum library. Future work will include providing support for registering default custom calendars on a per-locale basis using standard JS Intl APIs.

The service worker is now opt-in for local development

The service worker installation is now opt-in when running a local development server using yarn start. To opt into installing the service worker, you can pass a --support-offline flag to yarn start like so:

yarn start --support-offline=true

We're working to ameliorate some of the issues with our current service worker implementation, and it's entirely feasible that this flag will default to being on in the very near future.

Features

  • (feat) Make sidenav scrollable by @Jexsie in #732
  • (feat) Core support for O3-2242: Separate 'active visit' and 'current visit' by @brandones in #738
  • (feat) O3-2306: Add formatDate option to disable special 'today' handling by @brandones in #743
  • (feat) Update type LoggedInUser to list userProperties in use by @vasharma05 in #744
  • (feat) Allow useConfig() to load configuration from other modules by @ibacher in #751
  • (feat) Tweaks to the ActionableNotification component by @denniskigen in #758
  • (feat) Resolve template literals in the src prop of the logo config by @samuelmale in #749
  • (feat) Adding useDebounce to the react utils by @vasharma05 in #756
  • (feat) Use SWR as a shared library by @ibacher in #774
  • (feat) Upgrade React Spectrum and fix CSS loading error by @ibacher in #778
  • (feat) KH-372: Add Khmer translations by @kazlaw in #776
  • (feat) Introduce a locale-sensitive date-picker by @samuelmale in #746
  • (feat) O3-2410: Support using custom link as navbar logo by @mogoodrich in #767
  • (feat) O3-2407: App Menu and User Menu should hide if their panel has no con… by @mogoodrich in #768
  • (feat) O3-2409: Login: support interpolation in loginUrl and logoutUrl by @mogoodrich in #766
  • (feat) Add Spanish translations by @icrc-jofrancisco in #775
  • (feat) Patient age display should be localized by @vasharma05 in #765
  • (feat) Make the service worker opt-in for local dev by @denniskigen in #780

Bug fixes

  • (fix) Add support for hashed routes by @ibacher in #736
  • (fix) Memoize the returned callback functions from usePagination by @vasharma05 in #741
  • (fix) Resolve some errors that appear when an app has empty routes by @ibacher in #742
  • (fix) Don't process openmrs-esm-styleguide.css files the Sass loader by @ibacher in #745
  • (fix) Bug where store actions don't receive correct arguments; get rid of appState by @brandones in #747
  • (fix) Simplify createGlobalStore mock by @brandones in #748
  • (fix) Fix Sass version to < 1.65.0 by @ibacher in #752
  • (fix) Remove duplicate top-nav-info-slot by @pirupius in #753
  • (fix) Locale switcher in the primary navigation should show session locale if no default locale found by @vasharma05 in #757
  • (fix) Extension online / offline support should propagate to runtime configuration by @ibacher in #761
  • (fix) Offline patients are not being listed in the table by @icrc-jofrancisco in https:/
  • (fix) O3-2419: Test failure due to non-breaking space by @mogoodrich in #769
  • (fix) Fix ContentSwitcher style overrides by @denniskigen in #773

Housekeeping

  • (chore) Tweak pre-release job skip logic by @denniskigen in #735
  • (chore) Update ConnectedExtension and add useConnectedExtensions mock by @ibacher in #737
  • (chore) Fix some typings by @ibacher in #750
  • (chore) O3-2358: Utilize pre-filled docker images in e2e tests by @Piumal1999 in #759
  • (chore) Add OpenMRSDatePicker to global mock file by @kajambiya in #760
  • (chore) Export Datepicker as mock by @kajambiya in #764
  • (chore) Bump @carbon/react and @carbon/charts by @denniskigen in #770
  • (chore) O3-2113: Setup playwright and add login e2e test by @RandilaP in #740

Documentation

  • (docs) Update test scripts and their related documentation by @denniskigen in #754

New contributors

Thank you to all our wonderful contributors! 🎉

Full Changelog: v5.1.0...v5.2.0

v5.1.0

18 Jul 18:29
b3a3b52
Compare
Choose a tag to compare

Core 5.1.0 contains various critical fixes for issues stemming from the 5.0.0 BREAKING release. In addition, it contains a number of new features and improvements.

Highlights

Support for feature flags

This release introduces a new feature flagging system to O3. Feature toggles (often referred to as feature flags) are powerful, allowing teams to modify system behaviour without changing code. This is useful for features still in development or features not yet ready for production use. Implementers will be able to toggle features on and off from the Feature Flags tab in the O3 Implementer Tools. See @brandones' GIF below demoing feature flags in practice:

Peek 2023-07-13 14-04

Initial support for RDE

v5.1.0 introduces initial support for Retrospective Data Entry. It contains changes to the visit-utils file and the useVisit hook to allow the user to manually set the current visit. Prior to this, the concept of the current visit only referred to the latest visit with no end date. This change sets the stage for proper RDE support in the future.

Post-migration fixes

This release provides several fixes for issues related to the 5.0.0 release, including fixes to the configuration, extension, and translation systems. With these, we should be able to confidently move forward with the 5.x series of releases.

Features

  • (feat) Load scripts for non-visible modules asynchronously after starting the application by @ibacher in #710
  • (feat) KH-239: Translate login page to km by @kdaud in #716
  • (feat) Improved {locale}.json translation files for various languages by @vasharma05 in #705
  • (feat) More flexible system for setting the current visit (supports O3-1895) by @brandones in #724
  • (feat) Simplify the openmrsComponentDecorator by @ibacher in #725
  • (feat) O3-2258: Create feature flagging system by @brandones in #728
  • (feat) O3-2258: Extension system support for feature flags by @brandones in #733

Bug fixes

  • (fix) Various fixes for compatibility of new versions by @ibacher in #707
  • (fix) Extensions should have meaningful names by @ibacher in #708
  • (fix) Restore proper extension order by @ibacher in #709
  • (fix) Fix loading config from relative URLs by @ibacher in #703
  • (fix) Add a missing order property to the offline tools routes by @denniskigen in #711
  • (fix) Fix routes for offline tools frontend module by @denniskigen in #712
  • (fix) Fix offline tools dashboard link by @denniskigen in #713
  • (fix) Properly merge routes using routes.registry.json from backend by @ibacher in #714
  • (fix) Improve service-worker behaviour when running in development by @ibacher in #715
  • (fix) Render extensions based on connectivity by @denniskigen in #717
  • (fix) Fix issues with single-spa caused by naming extensions by @ibacher in #720
  • (fix) Define behaviour for translations from esm-app-shell by @ibacher in #719
  • (fix) Attempt to ensure we only have one i18next instance by @ibacher in #721
  • (fix) Importmap replacement should only override importmap.json part of importmap URL by @ibacher in #722
  • (fix) Login app should load locations with a case-insensitive db by @ibacher in #723
  • (fix) Ignore single-spa error 32 firing if a parcel has been unmounted by @ibacher in #729
  • (fix) Update a bunch of peer dependencies from 4.x to 5.x by @brandones in #730
  • (fix) Restore suspense wrapper to openmrsComponentDecorator by @ibacher in #731
  • (fix) Remove side scrolling in the Location picker in tablet and small desktop by @Jexsie in #701
  • (fix) O3-2258 trivial fixup: Add useFeatureFlag to esm-react-utils public exports by @brandones in #734

New contributors

Thank you to all our wonderful contributors! 🎉

Full Changelog: v5.0.2...v5.1.0

v5.0.2

23 Jun 12:22
0a5da41
Compare
Choose a tag to compare

What's Changed

This is a bug-fix release to fix an issue in the openmrs CLI's assemble command processing routes.json files.

Bug Fixes

  • (fix) Fix issues in the assemble script causing it to fail by @ibacher

Full Changelog: v5.0.1...v5.0.2

v5.0.1

23 Jun 01:58
c29b882
Compare
Choose a tag to compare

What's Changed

This is a bugfix release for 5.0.0.

Bugfixes

  • (fix) Webpack now processes esm-framework sanely by @ibacher in #706

Full Changelog: v5.0.0...v5.0.1

v5.0.0

22 Jun 18:14
2de5bf3
Compare
Choose a tag to compare

What's Changed

Breaking changes

Features

  • (feat) Add support for setting default language via html lang attribute by @ibacher in #695

Bug fixes

v4.5.0

07 Jun 19:06
14ab1b8
Compare
Choose a tag to compare

What's Changed

Features

Bug fixes

  • (fix) Override stacking context for tooltips by @denniskigen in #672
  • (fix) Update types for dynamic-imports by @ibacher in #676
  • (fix) Restore createUseStore mock for framework by @ibacher in #678
  • (fix) Remove unused SystemJS-related code by @denniskigen in #677
  • (fix) Toggling of UI and Config editor toggles by @Jexsie in #679
  • (fix) Tweak spacing in the location picker loading skeleton by @Denywiryk in #685
  • (fix) Fix the height of DataTables by removing a style override by @Jexsie in #684

New Contributors

Thank you to all our amazing contributors! 🎉

Full Changelog: v4.4.1...v4.5.0

v4.4.1

10 May 14:33
63ba3ef
Compare
Choose a tag to compare

What's Changed

Features

Framework

  • (feat) Add function for dynamically importing WMF modules by @ibacher in #670

Fixes

Full Changelog: v4.4.0...v4.4.1

v4.4.0

27 Apr 23:26
fdaefed
Compare
Choose a tag to compare

What's Changed

Features

Framework

  • BREAKING: Refactor usePatient to account for offline patients by @ibacher in #655
  • BREAKING: Migrate from Unistore -> Zustand by @ibacher in #632
  • (feat) O3-2058: O3 current visit should last for more than a day by @Jexsie in #666

Fixes

  • (fix) O3-2015: User can’t click on any button while the toasts are up by @Jexsie in #663
  • (fix) KH-126: Redirected to home page without selecting a location by @vasharma05 in #664
  • (fix) KH-125: User should be redirected to location picker if no location is found in session by @vasharma05 in #665
  • (fix) Support for loading relative URLs by @ibacher in #668
  • (fix) support use-cases where response is not JSON by @ibacher in #652

Full Changelog: v4.3.1...v4.4.0

v4.3.1

12 Apr 21:10
Compare
Choose a tag to compare

What's Changed

Features

offline tools

primary navigation

Bug fixes

primary navigation

Housekeeping

Reversions

  • BREAKING: Refactor usePatient to account for offline patients by @ibacher in #655
  • (revert) BREAKING: Refactor usePatient to account for offline patients by @denniskigen in #661

Full Changelog: v4.3.0...v4.3.1