Releases: openmrs/openmrs-esm-core
v5.3.0
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
- (chore) Bump i18next, react-i18next and i18next-parser and support for pluralization by @vasharma05 in #788
- (chore) O3-2502: Add docker setup to run E2E on Bamboo by @jayasanka-sack in #791
- (chore) Upgrade to Yarn V4 by @ibacher in #800
- (chore) Take advantage of Yarn's workspace versioning capabilities by @ibacher in #801
- (chore) Khmer translations for login app by @vasharma05 in #811
- (chore) Simplify setup script by @ibacher in #813
- (release) v5.3.0 by @denniskigen in #815
New contributors
- @michaelbontyes made their first contribution in #787
- @jayasanka-sack made their first contribution in #791
Full Changelog: v5.2.0...v5.3.0
v5.2.0
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
- @pirupius made their first contribution in #753
- @RandilaP made their first contribution in #740
- @Piumal1999 made their first contribution in #759
- @kajambiya made their first contribution in #760
- @mogoodrich made their first contribution in #767
- @kazlaw made their first contribution in #776
Thank you to all our wonderful contributors! 🎉
Full Changelog: v5.1.0...v5.2.0
v5.1.0
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:
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
v5.0.1
v5.0.0
What's Changed
Breaking changes
Features
Bug fixes
- (fix) O3-2152: Rtl support, fix styles by @AlexanderMizgirev in #688
- (fix) O3-2152: Fix UI bugs in forms by @AlexanderMizgirev in #689
- (fix) O3-2152: Fix UI bugs in forms, form tabs by @AlexanderMizgirev in #690
- (fix) O3-2152: Fixed incorrect positioning of headers and icons by @AlexanderMizgirev in #691
- (fix) O3-2152: Fixed incorrect positioning of dropdown title by @AlexanderMizgirev in #693
- (fix) Webpack should not watch .git directory by @ibacher in #694
- (fix) O3-2152: Fixed incorrect padding of pagination page number by @AlexanderMizgirev in #696
- (fix) Webpack should ignore
.git
andtest-results
directories by @denniskigen in #698 - (fix) Fix a rendering issue in the location picker by @jwnasambu in #700
- (fix) Fix an incorrectly-named variable by @jwnasambu in #699
v4.5.0
What's Changed
Features
- (feat) Add ability to load relative/absolute URL by @donaldkibet in #674
- (feat) Align spacing between skeletons and radio items in location picker by @Denywiryk in #675
- (feat) O3-2145: Add "rtl" support for new languages by @AlexanderMizgirev in #680
- (feat) O3-2150: Add Hebrew to openmrs-esm-core by @AlexanderMizgirev in #682
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
- @Denywiryk made their first contribution in #675
- @AlexanderMizgirev made their first contribution in #680
Thank you to all our amazing contributors! 🎉
Full Changelog: v4.4.1...v4.5.0
v4.4.1
What's Changed
Features
Framework
Fixes
- (fix) Fix toast container dimensions by @denniskigen
Full Changelog: v4.4.0...v4.4.1
v4.4.0
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
What's Changed
Features
offline tools
- (feat) Offline tools dashboard UI enhancements by @denniskigen in #658
primary navigation
- (refactor) Refactor primary navigation by @denniskigen in #617
Bug fixes
primary navigation
- (fix) No need to update location when updating locale by @ibacher in #656
- (fix) 03-1916: Changing the locale should reload the app by @hadijahkyampeire in #659
Housekeeping
- (chore) Fix markdown-link-check by @denniskigen in #660
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