Skip to content

Commit

Permalink
perf: Antd icons tree shaking (#29787)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxime Beauchemin <[email protected]>
  • Loading branch information
kgabryje and mistercrunch authored Aug 1, 2024
1 parent d143b24 commit 5936e8d
Showing 1 changed file with 86 additions and 1 deletion.
87 changes: 86 additions & 1 deletion superset-frontend/src/components/Icons/AntdEnhanced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,95 @@
* under the License.
*/

import * as AntdIcons from '@ant-design/icons/lib/icons';
// NOTE: Targeted import (as opposed to `import *`) is important here for proper tree-shaking
import {
AlignCenterOutlined,
AlignLeftOutlined,
AlignRightOutlined,
ApartmentOutlined,
BarChartOutlined,
BookOutlined,
CalendarOutlined,
CheckOutlined,
CheckSquareOutlined,
CloseOutlined,
ConsoleSqlOutlined,
CopyOutlined,
DatabaseOutlined,
DeleteFilled,
DownOutlined,
EditOutlined,
ExclamationCircleOutlined,
EyeOutlined,
EyeInvisibleOutlined,
FallOutlined,
FileImageOutlined,
FileOutlined,
FireOutlined,
FullscreenExitOutlined,
FullscreenOutlined,
FundProjectionScreenOutlined,
InfoCircleOutlined,
InsertRowBelowOutlined,
MonitorOutlined,
PlusCircleOutlined,
PlusOutlined,
ReloadOutlined,
RightOutlined,
SaveOutlined,
SearchOutlined,
SettingOutlined,
StopOutlined,
TagsOutlined,
UpOutlined,
UserOutlined,
} from '@ant-design/icons';
import { StyledIcon } from './Icon';
import IconType from './IconType';

const AntdIcons = {
AlignCenterOutlined,
AlignLeftOutlined,
AlignRightOutlined,
ApartmentOutlined,
BarChartOutlined,
BookOutlined,
CalendarOutlined,
CheckOutlined,
CheckSquareOutlined,
CloseOutlined,
ConsoleSqlOutlined,
CopyOutlined,
DatabaseOutlined,
DeleteFilled,
DownOutlined,
EditOutlined,
ExclamationCircleOutlined,
EyeOutlined,
EyeInvisibleOutlined,
FallOutlined,
FileImageOutlined,
FileOutlined,
FireOutlined,
FullscreenExitOutlined,
FullscreenOutlined,
FundProjectionScreenOutlined,
InfoCircleOutlined,
InsertRowBelowOutlined,
MonitorOutlined,
PlusCircleOutlined,
PlusOutlined,
ReloadOutlined,
RightOutlined,
SaveOutlined,
SearchOutlined,
SettingOutlined,
StopOutlined,
TagsOutlined,
UpOutlined,
UserOutlined,
};

const AntdEnhancedIcons = Object.keys(AntdIcons)
.filter(k => !k.includes('TwoTone'))
.map(k => ({
Expand Down

0 comments on commit 5936e8d

Please sign in to comment.