feat(web): migrate from es-toolkit/compat to native es-toolkit (#30244)#80
Conversation
…enius#30244) Migrate 172 files from es-toolkit/compat to native es-toolkit. Migrated: - noop → es-toolkit/function - cloneDeep, omit, clone, pick → es-toolkit/object - uniq, intersection → es-toolkit/array - capitalize, camelCase, kebabCase, escape → es-toolkit/string - isEqual → es-toolkit/predicate Kept in compat (API differences): - uniqueId, isEmpty - get, merge, flow, curry, debounce - different APIs - uniqBy, groupBy, intersectionBy - property string support - flatten - undefined handling Benefits: 2-3x faster, smaller bundle Part of langgenius#30243 Fixes langgenius#30244
Greptile SummaryThis PR migrates 160+ files from Key Changes:
Issues Found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant PR as Pull Request
participant Files as 160+ Files
participant Imports as Import Statements
participant Modules as es-toolkit Modules
Dev->>PR: Migrate from es-toolkit/compat to native
PR->>Files: Update all files
Files->>Imports: Replace compat imports
Imports->>Modules: noop → es-toolkit/function
Imports->>Modules: isEqual → es-toolkit/predicate
Imports->>Modules: cloneDeep → es-toolkit/object
Imports->>Modules: clone → es-toolkit/object
Imports->>Modules: uniq → es-toolkit/array
Imports->>Modules: isArray → es-toolkit/predicate
Imports->>Modules: escape → es-toolkit/string
Imports->>Modules: capitalize → es-toolkit/string
Imports->>Modules: omit → es-toolkit/object
Imports->>Modules: get → es-toolkit/object
Imports->>Modules: pick → es-toolkit/object
Note over Imports,Modules: Keep in compat: merge, flatten, xorBy, unionBy, uniqBy, debounce
Imports-->>Modules: ⚠️ debounce incorrectly → function/object
Note right of Modules: Should be es-toolkit/compat
PR->>Dev: Remove lodash dependency
|
| SearchParamsFromCollection, | ||
| } from './types' | ||
| import { debounce, noop } from 'es-toolkit/compat' | ||
| import { debounce } from 'es-toolkit/object' |
There was a problem hiding this comment.
syntax: debounce should be imported from es-toolkit/compat, not es-toolkit/object. The compat module provides the full lodash-compatible API with .cancel() and .flush() methods.
Suggested change
| import { debounce } from 'es-toolkit/object' | |
| import { debounce } from 'es-toolkit/compat' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/plugins/marketplace/context.tsx
Line: 14:14
Comment:
**syntax:** `debounce` should be imported from `es-toolkit/compat`, not `es-toolkit/object`. The compat module provides the full lodash-compatible API with `.cancel()` and `.flush()` methods.
```suggestion
import { debounce } from 'es-toolkit/compat'
```
How can I resolve this? If you propose a fix, please make it concise.|
|
||
| import { RiCloseLine, RiEqualizer2Line } from '@remixicon/react' | ||
| import { debounce, noop } from 'es-toolkit/compat' | ||
| import { debounce } from 'es-toolkit/function' |
There was a problem hiding this comment.
syntax: debounce should be imported from es-toolkit/compat, not es-toolkit/function. The compat module provides the full lodash-compatible API with .cancel() and .flush() methods.
Suggested change
| import { debounce } from 'es-toolkit/function' | |
| import { debounce } from 'es-toolkit/compat' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/workflow/panel/debug-and-preview/index.tsx
Line: 4:4
Comment:
**syntax:** `debounce` should be imported from `es-toolkit/compat`, not `es-toolkit/function`. The compat module provides the full lodash-compatible API with `.cancel()` and `.flush()` methods.
```suggestion
import { debounce } from 'es-toolkit/compat'
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR from qodo-benchmark#273