Skip to content

pref: Migrate lodash-es from namespace imports to named imports for better tree shaking #1019

Description

@Woodii1998

Background

Currently, our ESLint rules force lodash-es to use namespace imports (import * as _ from "lodash-es"), which prevents effective tree shaking and increases bundle size.

Proposed Change

Switch to named imports (import { get, map } from "lodash-es") to enable better tree shaking optimization.

Benefits

  • ✅ Reduced bundle size through tree shaking
  • ✅ Only include actually used lodash functions
  • ✅ Better build optimization with modern bundlers

Impact

  • Need to update ESLint rules (lodash-imports.js, lodash-ramda-imports.js)
  • Codebase migration from _.method() to method()
  • Potential bundle size reduction

Considerations

  • Trade-off between bundle optimization vs code consistency
  • Migration effort across the codebase

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions