Skip to content

chore: remove lodash#3741

Merged
waleedlatif1 merged 1 commit intosimstudioai:stagingfrom
adithyaakrishna:chore/remove-lodash
Mar 24, 2026
Merged

chore: remove lodash#3741
waleedlatif1 merged 1 commit intosimstudioai:stagingfrom
adithyaakrishna:chore/remove-lodash

Conversation

@adithyaakrishna
Copy link
Contributor

Summary

Remove lodash from the project, replacing usages with native JS equivalents.

Type of Change

  • Other: Dependency cleanup

Testing

Verified the app builds and runs without lodash using es-toolkit

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@cursor
Copy link

cursor bot commented Mar 24, 2026

PR Summary

Medium Risk
Mostly a dependency swap, but it touches deep-equality checks (isEqual) used for zustand selectors and schema-change detection, where subtle behavior differences could affect re-rendering or change detection.

Overview
Removes lodash usage in the workflow editor and MCP tooling by switching deep-equality and object-omit helpers to es-toolkit (e.g., isEqual, omit).

Updates apps/sim/package.json to add es-toolkit and drop lodash/@types/lodash, and adjusts callsites accordingly (notably changing omit to the array-of-keys signature).

Written by Cursor Bugbot for commit 8ab2b49. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Mar 24, 2026

@adithyaakrishna is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR removes lodash (and its types package) as a dependency and replaces all usages with es-toolkit, a modern, tree-shakeable, and significantly smaller alternative. All nine affected files only used isEqual or omit, both of which have drop-in equivalents in es-toolkit.

  • isEqual is swapped from a default import (import isEqual from 'lodash/isEqual') to a named import (import { isEqual } from 'es-toolkit') across seven component/hook files — functionally equivalent for all object types in use.
  • omit in tool-validation.ts is migrated correctly: es-toolkit's omit requires the keys to be passed as an array, so omit(obj, 'description') becomes omit(obj, ['description']), which is handled properly.
  • es-toolkit is pinned to 1.45.1 (exact version, consistent with how several other packages are pinned in this project).
  • The bun.lock regeneration also pulled in minor/patch bumps for a number of unrelated packages (@ai-sdk/*, @aws-sdk/client-s3, @aws-sdk/client-sesv2, etc.). These are incidental to the lodash removal — worth a quick scan to confirm they don't introduce regressions, but they are all patch-level updates within their declared semver ranges.

Confidence Score: 5/5

  • Safe to merge — all lodash usages replaced correctly with functionally equivalent es-toolkit calls and no logic changes introduced.
  • The migration is mechanical and correct: isEqual is API-compatible between the two libraries for all object shapes used here, and the omit array-key API change in tool-validation.ts is handled properly. A full grep confirms no residual lodash imports remain in the codebase. The only minor note is that the lockfile regeneration brought in unrelated dependency bumps, but these are all within already-declared semver ranges.
  • No files require special attention. The bun.lock churn is worth a quick look for incidental version bumps but poses no blocking concern.

Important Files Changed

Filename Overview
apps/sim/lib/mcp/tool-validation.ts Correctly migrates both isEqual and omit from lodash to es-toolkit; the omit call updated to use array syntax as required by es-toolkit's API.
apps/sim/package.json Removes lodash and @types/lodash dependencies and adds es-toolkit@1.45.1 (exact pin, consistent with other pins in the file).
bun.lock Lockfile regenerated to reflect lodash removal and es-toolkit addition; includes incidental version bumps for several unrelated packages (multiple @ai-sdk/* and @aws-sdk/*) as a side effect of regeneration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["lodash (removed)"] -->|was used in| B[isEqual - 7 files]
    A -->|was used in| C[omit - tool-validation.ts]

    B -->|replaced by| D["es-toolkit · isEqual"]
    C -->|replaced by| E["es-toolkit · omit\nomit(obj, ['key'])"]

    D --> F[combobox.tsx]
    D --> G[dropdown.tsx]
    D --> H[messages-input.tsx]
    D --> I[use-depends-on-gate.ts]
    D --> J[use-sub-block-value.ts]
    D --> K[sub-block.tsx]
    D --> L[editor.tsx]
    D --> M[workflow-block.tsx]
    E --> N[tool-validation.ts]
Loading

Reviews (1): Last reviewed commit: "chore: remove lodash" | Re-trigger Greptile

@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 24, 2026 5:09pm

Request Review

@waleedlatif1 waleedlatif1 merged commit 8d93c85 into simstudioai:staging Mar 24, 2026
12 checks passed
Sg312 pushed a commit that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants