chore(web): migrate lodash-es to es-toolkit compat (#30126)

This commit is contained in:
yyh
2025-12-25 09:44:57 +08:00
committed by GitHub
parent fdaeec7f7d
commit 3cbbb06dc4
202 changed files with 222 additions and 230 deletions

View File

@@ -1,6 +1,6 @@
import type { FC } from 'react'
import type { ApiBasedExtension } from '@/models/common'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'

View File

@@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import type { DataSourceNotion as TDataSourceNotion } from '@/models/common'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import * as React from 'react'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'

View File

@@ -3,7 +3,7 @@ import type { FC } from 'react'
import {
RiDeleteBinLine,
} from '@remixicon/react'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { cn } from '@/utils/classnames'

View File

@@ -1,4 +1,4 @@
import type { DebouncedFunc } from 'lodash-es'
import type { DebouncedFunc } from 'es-toolkit/compat'
import type { ValidateCallback, ValidatedStatusState, ValidateValue } from './declarations'
import { useDebounceFn } from 'ahooks'
import { useState } from 'react'

View File

@@ -1,6 +1,6 @@
'use client'
import { RiCloseLine } from '@remixicon/react'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useContext } from 'use-context-selector'

View File

@@ -2,7 +2,7 @@
import type { InvitationResult } from '@/models/common'
import { RiCloseLine, RiErrorWarningFill } from '@remixicon/react'
import { useBoolean } from 'ahooks'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import { useCallback, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { ReactMultiEmail } from 'react-multi-email'

View File

@@ -2,7 +2,7 @@ import type { InvitationResult } from '@/models/common'
import { XMarkIcon } from '@heroicons/react/24/outline'
import { CheckCircleIcon } from '@heroicons/react/24/solid'
import { RiQuestionLine } from '@remixicon/react'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'

View File

@@ -1,5 +1,5 @@
import { RiCloseLine } from '@remixicon/react'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import * as React from 'react'
import { useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'

View File

@@ -1,6 +1,6 @@
import type { ReactNode } from 'react'
import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import { Fragment, useCallback, useEffect } from 'react'
import { cn } from '@/utils/classnames'

View File

@@ -5,8 +5,8 @@ import {
RiRobot2Fill,
RiRobot2Line,
} from '@remixicon/react'
import { flatten } from 'es-toolkit/compat'
import { produce } from 'immer'
import { flatten } from 'lodash-es'
import { useParams } from 'next/navigation'
import { useCallback, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'

View File

@@ -2,7 +2,7 @@
import type { AppDetailResponse } from '@/models/app'
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
import { ChevronDownIcon, PlusIcon } from '@heroicons/react/24/solid'
import { noop } from 'lodash-es'
import { noop } from 'es-toolkit/compat'
import { useRouter } from 'next/navigation'
import { Fragment, useState } from 'react'
import { useTranslation } from 'react-i18next'

View File

@@ -6,7 +6,7 @@ import {
RiBook2Fill,
RiBook2Line,
} from '@remixicon/react'
import { flatten } from 'lodash-es'
import { flatten } from 'es-toolkit/compat'
import { useParams, useRouter } from 'next/navigation'
import { useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'

View File

@@ -6,7 +6,7 @@ import {
RiArrowDownSLine,
RiArrowRightSLine,
} from '@remixicon/react'
import { debounce } from 'lodash-es'
import { debounce } from 'es-toolkit/compat'
import { useRouter } from 'next/navigation'
import { Fragment, useCallback } from 'react'
import { useTranslation } from 'react-i18next'