-
Notifications
You must be signed in to change notification settings - Fork 323
[fix] switch off lodash, appease dependabot #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brandonkachen
wants to merge
11
commits into
main
Choose a base branch
from
remove-lodash-comments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Replaced all lodash functions with native JavaScript equivalents:
- compact/flattenDeep → custom buildArray with manual flattening
- isEqual → JSON.stringify comparison
- cloneDeep → JSON.parse(JSON.stringify())
- shuffle → Fisher-Yates algorithm
- uniq → Array.from(new Set())
- sortBy → native .sort() with comparator
- sumBy → .reduce() with accumulator
- mapValues → Object.fromEntries() + .map()
- union → Array.from(new Set([...arr1, ...arr2]))
- partition → custom implementation with type guards
- has → 'key' in obj checks
- isError → instanceof Error
- range → Array.from({ length }, (_, i) => i)
Removed lodash and @types/lodash from all package.json files.
All tests passing for modified packages.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…le to reduce duplication and standardize usage across backend, sdk, and tooling code. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Created common/src/util/lodash-replacements.ts as a shared module
containing all lodash replacement functions (cloneDeep, isEqual,
shuffle, range, sumBy, mapValues, union, partition).
Updated 13 files to import from shared module instead of duplicating:
- common/src/util/{array,object,string,messages}.ts
- backend/src/{run-agent-step,run-programmatic-step}.ts
- backend/src/tools/{stream-parser,tool-executor}.ts
- packages/agent-runtime/src/util/{messages,simplify-tool-results}.ts
- packages/agent-runtime/src/tools/handlers/tool/write-file.ts
- packages/agent-runtime/src/find-files/request-files-prompt.ts
- sdk/src/{run,run-state}.ts
- evals/git-evals/run-git-evals.ts
- scripts/analyze-edit-blocks.ts
Removed ~150 lines of duplicated code.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…ss codebase Centralizes array dedup using a new uniq() function to replace scattered Set-based patterns and prepare groundwork for removing lodash replacements. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
- Merged origin/main into remove-lodash-comments branch with no conflicts - Added native debounce function to common/src/util/lodash-replacements.ts - Replaced lodash/debounce imports in web hooks with shared utility - All typechecks pass successfully
…ate-ci-env.js Node.js in CI cannot load .ts files directly. Replaced the import from lodash-replacements.ts with an inline native uniq implementation.
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.
No description provided.