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

(chore) Optimize lodash imports #1278

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { useMemo, useState } from 'react';
import { Button, Column, FlexGrid, Row, TextInput, Toggle } from '@carbon/react';
import { useTranslation } from 'react-i18next';
import cloneDeep from 'lodash-es/cloneDeep';
import isEmpty from 'lodash-es/isEmpty';
import { cloneDeep, isEmpty } from 'lodash-es';
import type { Config } from '@openmrs/esm-framework/src/internal';
import {
ChevronDownIcon,
Expand All @@ -18,8 +17,7 @@ import {
} from '@openmrs/esm-framework/src/internal';
import { ConfigTree } from './interactive-editor/config-tree.component';
import { Description } from './interactive-editor/description.component';
import type { ImplementerToolsStore } from '../store';
import { implementerToolsStore } from '../store';
import { implementerToolsStore, type ImplementerToolsStore } from '../store';
import styles from './configuration.styles.scss';

const JsonEditor = React.lazy(() => import('./json-editor/json-editor.component'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import EditableValue from './editable-value.component';
import { isEqual } from 'lodash-es';
import { implementerToolsStore } from '../../store';
import isEqual from 'lodash-es/isEqual';
import { Subtree } from './layout/subtree.component';
import EditableValue from './editable-value.component';

export interface ConfigSubtreeProps {
config: Record<string, any>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { pickBy } from 'lodash-es';
import { ExtensionSlotsConfigTree } from './extension-slots-config-tree';
import { ConfigSubtree } from './config-subtree.component';
import pickBy from 'lodash-es/pickBy';
import { TreeContainer } from './layout/tree-container.component';

export interface ConfigTreeForModuleProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import React, { useState, useEffect, useRef } from 'react';
import isEqual from 'lodash-es/isEqual';
import unset from 'lodash-es/unset';
import cloneDeep from 'lodash-es/cloneDeep';
import styles from './editable-value.styles.scss';
import { useTranslation } from 'react-i18next';
import { isEqual, cloneDeep, unset } from 'lodash-es';
import { Button } from '@carbon/react';
import type { ConfigValue, Validator, Type, Config } from '@openmrs/esm-framework/src/internal';
import { EditIcon, ResetIcon } from '@openmrs/esm-framework';
import { clearConfigErrors, temporaryConfigStore } from '@openmrs/esm-framework/src/internal';
import type { CustomValueType } from './value-editor';
import { ValueEditor } from './value-editor';
import type { ImplementerToolsStore } from '../../store';
import { implementerToolsStore } from '../../store';
import {
clearConfigErrors,
temporaryConfigStore,
type ConfigValue,
type Config,
type Validator,
type Type,
} from '@openmrs/esm-framework/src/internal';
import { implementerToolsStore, type ImplementerToolsStore } from '../../store';
import { DisplayValue } from './display-value';
import { useTranslation } from 'react-i18next';
import { ValueEditor, type CustomValueType } from './value-editor';
import styles from './editable-value.styles.scss';

export interface EditableValueProps {
path: Array<string>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useMemo, useState } from 'react';
import { capitalize } from 'lodash-es';
import { useTranslation } from 'react-i18next';
import {
Button,
DataTable,
Expand All @@ -18,24 +20,22 @@ import {
TableSelectRow,
} from '@carbon/react';
import { Renew } from '@carbon/react/icons';
import type { DynamicOfflineDataSyncState } from '@openmrs/esm-framework';
import {
age,
isDesktop,
showModal,
deleteSynchronizationItem,
getDynamicOfflineDataEntries,
getFullSynchronizationItems,
isDesktop,
removeDynamicOfflineData,
showModal,
syncDynamicOfflineData,
getDynamicOfflineDataEntries,
useLayoutType,
type DynamicOfflineDataSyncState,
} from '@openmrs/esm-framework';
import { useTranslation } from 'react-i18next';
import capitalize from 'lodash-es/capitalize';
import { useOfflinePatientsWithEntries, useOfflineRegisteredPatients } from '../hooks/offline-patient-data-hooks';
import EmptyState from './empty-state.component';
import LastUpdatedTableCell from './last-updated-table-cell.component';
import PatientNameTableCell from './patient-name-table-cell.component';
import { useOfflinePatientsWithEntries, useOfflineRegisteredPatients } from '../hooks/offline-patient-data-hooks';
import styles from './offline-patient-table.scss';

export interface OfflinePatientTableProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ExtensionSlot, useExtensionSlotMeta } from '@openmrs/esm-framework';
import React from 'react';
import { trimEnd } from 'lodash-es';
import { useLocation, useParams } from 'react-router-dom';
import { ExtensionSlot, useExtensionSlotMeta } from '@openmrs/esm-framework';
import type { OfflineToolsPageConfig } from '../types';
import trimEnd from 'lodash-es/trimEnd';
import { useLocation, useMatch, useParams } from 'react-router-dom';

export interface OfflineToolsPageParams {
page: string;
Expand Down
1 change: 0 additions & 1 deletion packages/apps/esm-primary-navigation-app/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
},
transformIgnorePatterns: [],
moduleNameMapper: {
'lodash-es/(.*)': 'lodash/$1',
'lodash-es': 'lodash',
'@openmrs/esm-framework': '@openmrs/esm-framework/mock.tsx',
'\\.(s?css)$': 'identity-obj-proxy',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, SwitcherItem } from '@carbon/react';
import capitalize from 'lodash-es/capitalize';
import { capitalize } from 'lodash-es';
import { TranslateIcon, showModal, useSession } from '@openmrs/esm-framework';
import styles from './change-language-link.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
RadioButton,
RadioButtonGroup,
} from '@carbon/react';
import capitalize from 'lodash-es/capitalize';
import { capitalize } from 'lodash-es';
import { useConnectivity, useSession } from '@openmrs/esm-framework';
import { postUserPropertiesOffline, postUserPropertiesOnline } from './change-language.resource';
import styles from './change-language.scss';
Expand Down
Loading