Skip to content

feat(TEC-225): replace lodash with es-toolkit#768

Closed
Copilot wants to merge 1 commit intodevfrom
copilot/tec-225-replace-lodash-with-es-toolkit-another-one
Closed

feat(TEC-225): replace lodash with es-toolkit#768
Copilot wants to merge 1 commit intodevfrom
copilot/tec-225-replace-lodash-with-es-toolkit-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Lodash is no longer actively maintained; es-toolkit is its modern replacement with a smaller bundle, better tree-shaking, and built-in TypeScript types (no @types/* needed).

Dependency changes

  • Add es-toolkit: ^1.45.1 to the pnpm workspace catalog
  • Remove all lodash.* and @types/lodash.* catalog entries and per-package deps across apps/admin, apps/website, apps/show, and libs/search-params-io

Import migration

All import X from "lodash.X" (default exports from individual packages) become named exports:

// Before
import orderBy from "lodash.orderby"
import isEqual from "lodash.isequal"
import pick from "lodash.pick"

// After
import { orderBy } from "es-toolkit/compat"
import { isEqual, pick } from "es-toolkit"

Compat layer usage (es-toolkit/compat)

Two functions use the lodash-compatible shim rather than the strict main export:

  • orderBy — the main es-toolkit signature requires an array of iteratees, an explicit orders array, and T extends object (no primitives). The codebase uses lodash's flexible form throughout (single function iteratee, optional order string, arrays of enum strings), so es-toolkit/compat is the correct drop-in.
  • merge in the Prisma select helpers — the main export is 2-arg only; these call sites use merge({}, internalSelect, params.select) to deep-merge nested Prisma select objects (a shallow spread would lose nested fields). es-toolkit/compat supports the variadic signature.
Original prompt

Issue Title: Replace lodash by es-toolkit
Issue Description: Lodash is no longer actively maintained; es-toolkit is its replacement.

Replace all usages of lodash by es-toolkit.

The utilities currently in use are:

  • Act as a senior TypeScript engineer working in a pnpm monorepo with Vite apps and shared libraries. Prioritize small, safe, production-ready changes.

Always:

  1. Read the full Linear issue, acceptance criteria, and linked context before proposing work.
  2. Ask clarifying questions when requirements, UX details, or data rules are ambiguous.
  3. Prefer the smallest scoped change that solves the issue end-to-end.
  4. Follow existing patterns in apps and libs; do not introduce new architecture unless explicitly requested.
  5. Keep strict TypeScript types; avoid any, unsafe casts, and implicit runtime assumptions.
  6. For React and Vite apps, keep components focused, avoid unnecessary re-renders, and preserve current routing/data-loading conventions.
  7. For shared libraries, maintain backward compatibility unless the issue explicitly allows breaking changes.
  8. For Prisma/data changes, call out schema impact, migration steps, rollout risk, and rollback path before implementation.
  9. For API or contract changes, list affected consumers across apps/libs and note required coordination.
  10. Do not modify unrelated files or perform broad refactors while fixing a targeted issue.
  11. Highlight security and privacy concerns explicitly (auth, permissions, secrets, PII, input validation).
  12. If uncertain, present 2 options with tradeoffs and recommend one.

For bug fixes:

  1. State likely root cause first.
  2. Provide clear reproduction and verification steps.
  3. Confirm the fix does not regress adjacent flows.

For features:

  1. Confirm expected user flow and edge cases.
  2. Identify data model/API implications early.
  3. Call out operational concerns (env vars, deploy order, migrations, cache invalidation).

When opening a PR, always list in the description:

  1. What changed
  2. Why this approach
  3. Files affected
  4. Risks and follow-ups
  5. Verification steps

Issue Comments:
Comment by User (2026-03-30T18:19:45.455Z):
This thread is for an agent session with githubcopilot.

Comment by User (2026-03-30T18:16:20.035Z):
This thread is for an agent session with githubcopilot.

Comment by User (2026-03-30T18:14:23.448Z):
This thread is for an agent session with githubcopilot.

Comment by User (2026-03-30T18:04:18.980Z):
This thread is for an agent session with githubcopilot.

Comment by User ca696911-1786-4bf3-a1ac-e2a81cedfa15 (2026-03-30T17:57:26.013Z):
@GitHubCopilot List usages of each lodash utility per package in the workspace

Comment by User (2026-03-30T17:20:26.889Z):
This thread is for an agent session with githubcopilot.

Comment by User (2026-03-25T22:40:01.684Z):
This thread is for an agent session with githubcopilot.

Comment by User (2026-03-25T22:30:30.062Z):
This thread is for an agent session with githubcopilot.

Comment by User (2026-03-25T19:19:01.009Z):
This thread is for an agent session with githubcopilot.

Copilot AI changed the title [WIP] Replace lodash with es-toolkit for utility functions feat(TEC-225): replace lodash with es-toolkit Mar 30, 2026
Copilot AI requested a review from simonrelet March 30, 2026 18:39
@simonrelet
Copy link
Copy Markdown
Member

@copilot Rebase the branch on dev

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot Rebase the branch on dev

Done, rebased onto dev in 50ddf87.

@simonrelet simonrelet force-pushed the copilot/tec-225-replace-lodash-with-es-toolkit-another-one branch from 50ddf87 to 9035dba Compare April 1, 2026 21:21
@simonrelet simonrelet closed this Apr 1, 2026
@simonrelet simonrelet deleted the copilot/tec-225-replace-lodash-with-es-toolkit-another-one branch April 1, 2026 21:53
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