Skip to content

refactor(apps): Replace lodash with es-toolkit #7918

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jungpaeng
Copy link

Replace lodash with es-toolkit for better performance and smaller bundle size

Summary

This PR replaces lodash dependencies with es-toolkit to improve performance and reduce bundle size in apps.

Changes

  • Replaced lodash.template with es-toolkit/compat equivalents:
    • template function: Reduced from 10,654 bytes to 2,634 bytes

Performance Improvements

  • Bundle size reduction: Significant decrease in build size due to smaller function implementations
  • Runtime performance: ~4x faster performance in most scenarios according to benchmarks
  • Zero breaking changes: Build output diff shows identical results except for the migration itself

Why es-toolkit?

  1. Active maintenance: Unlike lodash, es-toolkit is actively maintained and optimized
  2. 100% compatibility: es-toolkit/compat passes all lodash test suites and maintains identical interfaces
  3. Industry adoption: Already used by major projects like Storybook and Recharts
  4. Modern optimization: Built with modern JavaScript performance optimizations

Testing

  • es-toolkit/compat ensures 100% API compatibility with lodash
  • No breaking changes for consumers

Future Plans

This is part of our ongoing performance improvement initiative. We recommend migrating from the unmaintained lodash to the modern, performant es-toolkit.

Copy link

vercel bot commented Jul 30, 2025

@jungpaeng is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant