Skip to content

Commit d4dd3aa

Browse files
Inneiclaudecanisminor1990
authored
♻️ refactor: migrate from lodash-es to es-toolkit (#58)
* ♻️ refactor: migrate from lodash-es to es-toolkit Replace lodash-es with es-toolkit for better performance and smaller bundle size. es-toolkit is 2-3x faster and up to 97% smaller than lodash. - Replace lodash-es throttle with es-toolkit/compat throttle - Replace lodash-es flatten with es-toolkit/compat flatten - Remove @types/lodash-es dev dependency (es-toolkit has built-in types) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🐛 fix: Fix dumi build * 🔧 chore: Chore clean * 🔧 chore: Chore clean --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: canisminor1990 <i@canisminor.cc>
1 parent 772d4ef commit d4dd3aa

File tree

9 files changed

+13
-15
lines changed

9 files changed

+13
-15
lines changed

.dumirc.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ export default defineConfig({
6868
define: {
6969
'process.env': process.env,
7070
},
71-
// exportStatic: {},
7271
extraBabelPlugins: ['antd-style'],
7372
favicons: ['https://lobehub.com/favicon.ico'],
7473
jsMinifier: 'swc',
7574
locales: [{ id: 'en-US', name: 'English' }],
76-
mako: isWin || isProduction ? false : {},
75+
mfsu: isWin ? false : {},
7776
npmClient: 'pnpm',
7877
publicPath: '/',
7978
resolve: {

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ bun.lockb
5858
react/**
5959
server/**
6060
core/**
61-
react.d.ts
62-
server.d.ts
61+
./react.js
62+
./react.d.ts
63+
./server.js
64+
./server.d.ts

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
},
7474
"dependencies": {
7575
"antd-style": "^3.7.1",
76-
"lodash-es": "^4.17.22",
76+
"es-toolkit": "^1.32.0",
7777
"lucide-react": "^0.469.0",
7878
"markdown-to-txt": "^2.0.1",
7979
"openai": "^6.15.0",
@@ -90,8 +90,7 @@
9090
"@commitlint/cli": "^19.8.1",
9191
"@lobehub/i18n-cli": "^1.25.1",
9292
"@lobehub/lint": "^1.26.3",
93-
"@lobehub/ui": "3.3.5",
94-
"@types/lodash-es": "^4.17.12",
93+
"@lobehub/ui": "^4.0.0",
9594
"@types/node": "^25.0.3",
9695
"@types/react": "^19.2.7",
9796
"@types/react-dom": "^19.2.3",
@@ -105,7 +104,7 @@
105104
"concurrently": "^9.2.1",
106105
"dpdm": "^3.14.0",
107106
"dumi": "^2.4.21",
108-
"dumi-theme-lobehub": "3.0.1",
107+
"dumi-theme-lobehub": "4.0.0",
109108
"eslint": "^8.57.1",
110109
"father": "^4.6.11",
111110
"husky": "^9.1.7",
@@ -124,7 +123,7 @@
124123
"vitest": "~1.2.2"
125124
},
126125
"peerDependencies": {
127-
"@lobehub/ui": "3.3.5",
126+
"@lobehub/ui": "^4.0.0",
128127
"antd": "^6.1.1",
129128
"react": "^19.0.0",
130129
"react-dom": "^19.0.0"

react.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

server.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/core/EdgeSpeechTTS/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SelectProps } from 'antd';
2-
import { flatten } from 'lodash-es';
2+
import { flatten } from 'es-toolkit/compat';
33

44
import voiceList from '@/core/data/voiceList';
55

src/core/MicrosoftSpeechTTS/voiceList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SelectProps } from 'antd';
2-
import { flatten } from 'lodash-es';
2+
import { flatten } from 'es-toolkit/compat';
33

44
import voiceList from '@/core/data/voiceList';
55

src/core/SpeechSynthesisTTS/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SelectProps } from 'antd';
2-
import { flatten } from 'lodash-es';
2+
import { flatten } from 'es-toolkit/compat';
33

44
import { SpeechSynthesis } from '@/core/const/polyfill';
55
import voiceLocale from '@/core/data/locales';

src/react/hooks/useAudioVisualizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { throttle } from 'lodash-es';
1+
import { throttle } from 'es-toolkit/compat';
22
import { RefObject, useCallback, useEffect, useRef, useState } from 'react';
33

44
export const useAudioVisualizer = (

0 commit comments

Comments
 (0)