From 0d2053aa5cdb9478080c3a3149c8eba20565c1e4 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 26 Feb 2024 16:47:26 -0500 Subject: [PATCH] MM-56985 Remove babel-plugin-lodash (#26295) --- webapp/channels/.eslintrc.json | 4 ++++ webapp/channels/babel.config.js | 1 - webapp/channels/package.json | 1 - .../src/actions/status_actions.test.ts | 2 +- webapp/channels/src/actions/views/rhs.test.ts | 3 ++- .../channel_list/channel_list.tsx | 3 ++- .../team_list/team_list.tsx | 2 +- .../group_teams_and_channels_row.tsx | 2 +- .../group_details/group_users.test.tsx | 2 +- .../member_list_group.test.tsx | 2 +- .../admin_console/server_logs/logs.tsx | 2 +- .../system_roles/system_role/system_role.tsx | 3 ++- .../channel/details/channel_details.tsx | 2 +- .../channel/details/channel_moderation.tsx | 2 +- .../team/details/team_details.tsx | 2 +- .../team/details/team_profile.tsx | 2 +- .../formatting_bar/hooks.tsx | 2 +- .../cloud_trial_announcement_bar.tsx | 2 +- .../payment_announcement_bar/index.tsx | 2 +- .../src/components/app_bar/app_bar.tsx | 2 +- .../channel_invite_modal.tsx | 2 +- .../channel_members_rhs.tsx | 2 +- .../request_business_email_modal.tsx | 2 +- .../hocs/cloud/with_get_cloud_subscription.tsx | 2 +- .../index.tsx | 2 +- .../oauth_connection_audience_input.tsx | 2 +- .../channels/src/components/menu/menu_item.tsx | 2 +- .../more_direct_channels.tsx | 2 +- .../post_attachment_opengraph.test.tsx | 3 ++- .../purchase_modal/purchase_modal.tsx | 2 +- .../components/suggestion/suggestion_list.tsx | 2 +- .../global_threads/global_threads.tsx | 2 +- .../global_threads/thread_list/thread_list.tsx | 2 +- .../thread_menu/thread_menu.test.tsx | 2 +- .../src/components/timestamp/timestamp.tsx | 3 ++- .../user_group_popover/user_group_popover.tsx | 2 +- .../mattermost-redux/src/actions/threads.ts | 2 +- .../src/reducers/entities/channels.ts | 2 +- .../src/selectors/entities/channels.ts | 2 +- webapp/channels/src/reducers/views/threads.ts | 2 +- .../channels/src/selectors/admin_console.jsx | 2 +- webapp/channels/src/utils/func.ts | 4 +++- webapp/channels/src/utils/paste.tsx | 2 +- webapp/channels/src/utils/utils.tsx | 2 +- webapp/package-lock.json | 18 ------------------ 45 files changed, 52 insertions(+), 61 deletions(-) diff --git a/webapp/channels/.eslintrc.json b/webapp/channels/.eslintrc.json index 2c6d5592bb..08bd2c9c39 100644 --- a/webapp/channels/.eslintrc.json +++ b/webapp/channels/.eslintrc.json @@ -128,6 +128,10 @@ "name": "redux", "importNames": ["DeepPartial"], "message": "Use DeepPartial from '@mattermost/types/utilities instead." + }, + { + "name": "lodash", + "message": "Import individual functions from lodash/ instead." } ] } diff --git a/webapp/channels/babel.config.js b/webapp/channels/babel.config.js index 4609d1ac61..859c5342fa 100644 --- a/webapp/channels/babel.config.js +++ b/webapp/channels/babel.config.js @@ -23,7 +23,6 @@ const config = { }], ], plugins: [ - 'lodash', 'react-hot-loader/babel', 'babel-plugin-typescript-to-proptypes', [ diff --git a/webapp/channels/package.json b/webapp/channels/package.json index 7b13566da3..45155b7115 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -141,7 +141,6 @@ "@types/tinycolor2": "1.4.3", "@typescript-eslint/eslint-plugin": "5.57.1", "@typescript-eslint/parser": "5.57.1", - "babel-plugin-lodash": "3.3.4", "copy-webpack-plugin": "11.0.0", "emoji-datasource": "6.1.1", "emoji-datasource-apple": "6.1.1", diff --git a/webapp/channels/src/actions/status_actions.test.ts b/webapp/channels/src/actions/status_actions.test.ts index 8b88e5cb4e..0718ae4cb7 100644 --- a/webapp/channels/src/actions/status_actions.test.ts +++ b/webapp/channels/src/actions/status_actions.test.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {cloneDeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import type {UserProfile} from '@mattermost/types/users'; diff --git a/webapp/channels/src/actions/views/rhs.test.ts b/webapp/channels/src/actions/views/rhs.test.ts index ec8cfb48e0..762411286f 100644 --- a/webapp/channels/src/actions/views/rhs.test.ts +++ b/webapp/channels/src/actions/views/rhs.test.ts @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {cloneDeep, set} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; +import set from 'lodash/set'; import type {Dispatch} from 'redux'; import {batchActions} from 'redux-batched-actions'; import type {MockStoreEnhanced} from 'redux-mock-store'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx index a52464ed01..d23e7acf01 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce, isEqual} from 'lodash'; +import debounce from 'lodash/debounce'; +import isEqual from 'lodash/isEqual'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx index c37ddb0d7c..c374709bf4 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx index c90f340c01..9f4e0d3cce 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import classNames from 'classnames'; -import {isNil} from 'lodash'; +import isNil from 'lodash/isNil'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx index e954eb7f74..04a2d19630 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {shallow} from 'enzyme'; -import {range} from 'lodash'; +import range from 'lodash/range'; import React from 'react'; import type {UserProfile} from '@mattermost/types/users'; diff --git a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx index c2d859d7c2..7884eacc09 100644 --- a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx +++ b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {shallow} from 'enzyme'; -import {range} from 'lodash'; +import range from 'lodash/range'; import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/server_logs/logs.tsx b/webapp/channels/src/components/admin_console/server_logs/logs.tsx index 528a2419e1..789e873e46 100644 --- a/webapp/channels/src/components/admin_console/server_logs/logs.tsx +++ b/webapp/channels/src/components/admin_console/server_logs/logs.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React from 'react'; import {FormattedMessage, defineMessages} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx index c8faba7dff..9233de637c 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {uniq, difference} from 'lodash'; +import difference from 'lodash/difference'; +import uniq from 'lodash/uniq'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx index 9187012b4b..16b72482f6 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {cloneDeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx index cd405693d2..33bec226a6 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import classNames from 'classnames'; -import {isNil} from 'lodash'; +import isNil from 'lodash/isNil'; import React from 'react'; import {FormattedMessage, defineMessages} from 'react-intl'; import type {MessageDescriptor} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx index 4e6b7432f4..d1dfad2421 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {cloneDeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx index 81a99db20a..9bc47a2435 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import classNames from 'classnames'; -import {noop} from 'lodash'; +import noop from 'lodash/noop'; import React, {useEffect, useState} from 'react'; import {FormattedMessage, defineMessage, useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; diff --git a/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx b/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx index 9d423816d0..b1957eb957 100644 --- a/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx +++ b/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import type {Instance} from '@popperjs/core'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import type React from 'react'; import {useCallback, useEffect, useLayoutEffect, useState} from 'react'; diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx index 71280c92b4..d436ea5ddf 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isEmpty} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx index 5cfb6c9e06..deea975a1c 100644 --- a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx +++ b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isEmpty} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import React, {useEffect, useState} from 'react'; import {FormattedMessage} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; diff --git a/webapp/channels/src/components/app_bar/app_bar.tsx b/webapp/channels/src/components/app_bar/app_bar.tsx index efd7c01628..0820204c11 100644 --- a/webapp/channels/src/components/app_bar/app_bar.tsx +++ b/webapp/channels/src/components/app_bar/app_bar.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {partition} from 'lodash'; +import partition from 'lodash/partition'; import React from 'react'; import type {ReactNode} from 'react'; import {useSelector} from 'react-redux'; diff --git a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx index ba02832b42..e9e93d58f3 100644 --- a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx +++ b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import React from 'react'; import {Modal} from 'react-bootstrap'; import type {IntlShape} from 'react-intl'; diff --git a/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx b/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx index 1c35a66f87..bd680fd507 100644 --- a/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx +++ b/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React, {useCallback, useEffect, useState} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import {useHistory} from 'react-router-dom'; diff --git a/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx b/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx index c8e237d74e..8dd09ac6d6 100644 --- a/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx +++ b/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React, {useCallback, useEffect, useState} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch} from 'react-redux'; diff --git a/webapp/channels/src/components/common/hocs/cloud/with_get_cloud_subscription.tsx b/webapp/channels/src/components/common/hocs/cloud/with_get_cloud_subscription.tsx index 78f9de1e5b..d303c9c247 100644 --- a/webapp/channels/src/components/common/hocs/cloud/with_get_cloud_subscription.tsx +++ b/webapp/channels/src/components/common/hocs/cloud/with_get_cloud_subscription.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isEmpty} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import React from 'react'; import type {ComponentType} from 'react'; diff --git a/webapp/channels/src/components/custom_open_plugin_install_post_renderer/index.tsx b/webapp/channels/src/components/custom_open_plugin_install_post_renderer/index.tsx index 418467d1d4..383fb0c3af 100644 --- a/webapp/channels/src/components/custom_open_plugin_install_post_renderer/index.tsx +++ b/webapp/channels/src/components/custom_open_plugin_install_post_renderer/index.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {uniqWith} from 'lodash'; +import uniqWith from 'lodash/uniqWith'; import React, {useEffect, useState} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; diff --git a/webapp/channels/src/components/integrations/outgoing_oauth_connections/oauth_connection_audience_input.tsx b/webapp/channels/src/components/integrations/outgoing_oauth_connections/oauth_connection_audience_input.tsx index 418d68c2fb..7525e32c23 100644 --- a/webapp/channels/src/components/integrations/outgoing_oauth_connections/oauth_connection_audience_input.tsx +++ b/webapp/channels/src/components/integrations/outgoing_oauth_connections/oauth_connection_audience_input.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {FormattedMessage} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; diff --git a/webapp/channels/src/components/menu/menu_item.tsx b/webapp/channels/src/components/menu/menu_item.tsx index 44660d0980..a3f766f102 100644 --- a/webapp/channels/src/components/menu/menu_item.tsx +++ b/webapp/channels/src/components/menu/menu_item.tsx @@ -4,7 +4,7 @@ import MuiMenuItem from '@mui/material/MenuItem'; import type {MenuItemProps as MuiMenuItemProps} from '@mui/material/MenuItem'; import {styled} from '@mui/material/styles'; -import {cloneDeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import React, { Children, useContext, diff --git a/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx b/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx index 8c4e5c9d55..ceee0a6f4a 100644 --- a/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx +++ b/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/post_view/post_attachment_opengraph/post_attachment_opengraph.test.tsx b/webapp/channels/src/components/post_view/post_attachment_opengraph/post_attachment_opengraph.test.tsx index c8d35c9f00..621bedc858 100644 --- a/webapp/channels/src/components/post_view/post_attachment_opengraph/post_attachment_opengraph.test.tsx +++ b/webapp/channels/src/components/post_view/post_attachment_opengraph/post_attachment_opengraph.test.tsx @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import {mount} from 'enzyme'; -import {cloneDeep, set} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; +import set from 'lodash/set'; import React from 'react'; import {Provider} from 'react-redux'; diff --git a/webapp/channels/src/components/purchase_modal/purchase_modal.tsx b/webapp/channels/src/components/purchase_modal/purchase_modal.tsx index 07939c240a..ce96666e7a 100644 --- a/webapp/channels/src/components/purchase_modal/purchase_modal.tsx +++ b/webapp/channels/src/components/purchase_modal/purchase_modal.tsx @@ -7,7 +7,7 @@ import {Elements} from '@stripe/react-stripe-js'; import type {Stripe, StripeCardElementChangeEvent} from '@stripe/stripe-js'; import {loadStripe} from '@stripe/stripe-js/pure'; // https://github.com/stripe/stripe-js#importing-loadstripe-without-side-effects import classnames from 'classnames'; -import {isEmpty} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import React from 'react'; import type {ReactNode} from 'react'; import {FormattedMessage, injectIntl} from 'react-intl'; diff --git a/webapp/channels/src/components/suggestion/suggestion_list.tsx b/webapp/channels/src/components/suggestion/suggestion_list.tsx index 82a27bb2b0..2fe2667e7d 100644 --- a/webapp/channels/src/components/suggestion/suggestion_list.tsx +++ b/webapp/channels/src/components/suggestion/suggestion_list.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {cloneDeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import React from 'react'; import ReactDOM from 'react-dom'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/threading/global_threads/global_threads.tsx b/webapp/channels/src/components/threading/global_threads/global_threads.tsx index c7723e450f..6a5ba18d37 100644 --- a/webapp/channels/src/components/threading/global_threads/global_threads.tsx +++ b/webapp/channels/src/components/threading/global_threads/global_threads.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import classNames from 'classnames'; -import {isEmpty} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import React, {memo, useCallback, useEffect, useState} from 'react'; import type {ReactNode} from 'react'; import {useIntl} from 'react-intl'; diff --git a/webapp/channels/src/components/threading/global_threads/thread_list/thread_list.tsx b/webapp/channels/src/components/threading/global_threads/thread_list/thread_list.tsx index 3d7525bab3..fcad5d0552 100644 --- a/webapp/channels/src/components/threading/global_threads/thread_list/thread_list.tsx +++ b/webapp/channels/src/components/threading/global_threads/thread_list/thread_list.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isEmpty} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import React, {memo, useCallback, useEffect} from 'react'; import type {PropsWithChildren} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; diff --git a/webapp/channels/src/components/threading/global_threads/thread_menu/thread_menu.test.tsx b/webapp/channels/src/components/threading/global_threads/thread_menu/thread_menu.test.tsx index c4c6bfed2c..d0c482eb82 100644 --- a/webapp/channels/src/components/threading/global_threads/thread_menu/thread_menu.test.tsx +++ b/webapp/channels/src/components/threading/global_threads/thread_menu/thread_menu.test.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {shallow} from 'enzyme'; -import {set} from 'lodash'; +import set from 'lodash/set'; import React from 'react'; import type {ComponentProps} from 'react'; diff --git a/webapp/channels/src/components/timestamp/timestamp.tsx b/webapp/channels/src/components/timestamp/timestamp.tsx index a6b6bdc016..fbc7f6a78b 100644 --- a/webapp/channels/src/components/timestamp/timestamp.tsx +++ b/webapp/channels/src/components/timestamp/timestamp.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {capitalize as caps, isArray} from 'lodash'; +import caps from 'lodash/capitalize'; +import isArray from 'lodash/isArray'; import type {Moment} from 'moment-timezone'; import moment from 'moment-timezone'; import React, {PureComponent} from 'react'; diff --git a/webapp/channels/src/components/user_group_popover/user_group_popover.tsx b/webapp/channels/src/components/user_group_popover/user_group_popover.tsx index 45f0cd3c56..3b1efcbcad 100644 --- a/webapp/channels/src/components/user_group_popover/user_group_popover.tsx +++ b/webapp/channels/src/components/user_group_popover/user_group_popover.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import React, {useEffect, useCallback, useState, useRef} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import styled from 'styled-components'; diff --git a/webapp/channels/src/packages/mattermost-redux/src/actions/threads.ts b/webapp/channels/src/packages/mattermost-redux/src/actions/threads.ts index a3baf8076c..6a9cd7194a 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/actions/threads.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/actions/threads.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {uniq} from 'lodash'; +import uniq from 'lodash/uniq'; import {batchActions} from 'redux-batched-actions'; import type {Post} from '@mattermost/types/posts'; diff --git a/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/channels.ts b/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/channels.ts index 8ac5cb7b6a..eba1d227d2 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/channels.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/channels.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import type {AnyAction} from 'redux'; import {combineReducers} from 'redux'; diff --git a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/channels.ts b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/channels.ts index e7c993be5d..4ed755c263 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/channels.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/channels.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {max} from 'lodash'; +import max from 'lodash/max'; import type { Channel, diff --git a/webapp/channels/src/reducers/views/threads.ts b/webapp/channels/src/reducers/views/threads.ts index 7706a966c0..be897ebd0f 100644 --- a/webapp/channels/src/reducers/views/threads.ts +++ b/webapp/channels/src/reducers/views/threads.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {findKey} from 'lodash'; +import findKey from 'lodash/findKey'; import type {AnyAction} from 'redux'; import {combineReducers} from 'redux'; diff --git a/webapp/channels/src/selectors/admin_console.jsx b/webapp/channels/src/selectors/admin_console.jsx index 33e60a822e..5fc3f6ccb7 100644 --- a/webapp/channels/src/selectors/admin_console.jsx +++ b/webapp/channels/src/selectors/admin_console.jsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {cloneDeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import {ResourceToSysConsolePermissionsTable, RESOURCE_KEYS} from 'mattermost-redux/constants/permissions_sysconsole'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; diff --git a/webapp/channels/src/utils/func.ts b/webapp/channels/src/utils/func.ts index b5a02f22bd..7578e640bf 100644 --- a/webapp/channels/src/utils/func.ts +++ b/webapp/channels/src/utils/func.ts @@ -1,7 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {intersection, isPlainObject, zipObject} from 'lodash'; +import intersection from 'lodash/intersection'; +import isPlainObject from 'lodash/isPlainObject'; +import zipObject from 'lodash/zipObject'; /** * Transform a function with multiple args into one that receives a normalized args object. diff --git a/webapp/channels/src/utils/paste.tsx b/webapp/channels/src/utils/paste.tsx index 2761b09b68..747ddc3135 100644 --- a/webapp/channels/src/utils/paste.tsx +++ b/webapp/channels/src/utils/paste.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isNil} from 'lodash'; +import isNil from 'lodash/isNil'; import type {TextboxElement} from 'components/textbox'; diff --git a/webapp/channels/src/utils/utils.tsx b/webapp/channels/src/utils/utils.tsx index e9b8cf45b7..38c3a36511 100644 --- a/webapp/channels/src/utils/utils.tsx +++ b/webapp/channels/src/utils/utils.tsx @@ -5,7 +5,7 @@ import {getName} from 'country-list'; import crypto from 'crypto'; import cssVars from 'css-vars-ponyfill'; import type {Locale} from 'date-fns'; -import {isNil} from 'lodash'; +import isNil from 'lodash/isNil'; import moment from 'moment'; import React from 'react'; import type {LinkHTMLAttributes} from 'react'; diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 19b1ec622f..c4b4683299 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -187,7 +187,6 @@ "@types/tinycolor2": "1.4.3", "@typescript-eslint/eslint-plugin": "5.57.1", "@typescript-eslint/parser": "5.57.1", - "babel-plugin-lodash": "3.3.4", "copy-webpack-plugin": "11.0.0", "emoji-datasource": "6.1.1", "emoji-datasource-apple": "6.1.1", @@ -6644,18 +6643,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/babel-plugin-lodash": { - "version": "3.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.0.0-beta.49", - "@babel/types": "^7.0.0-beta.49", - "glob": "^7.1.1", - "lodash": "^4.17.10", - "require-package-name": "^2.0.1" - } - }, "node_modules/babel-plugin-macros": { "version": "2.8.0", "license": "MIT", @@ -20182,11 +20169,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-package-name": { - "version": "2.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/requires-port": { "version": "1.0.0", "dev": true,