Content
View differences
Updated by Alexander Coles 12 days ago
## Scope
Bucket E of [#65621](https://community.openproject.org/work_packages/65621). Helpers with no clean native equivalent — switch from the global `_` to explicit tree-shakeable `lodash-es` named imports (add `lodash-es` to `frontend/package.json`). **Lowest risk** (mechanical import swap), good first PR.
## Call sites (~46)
`sortBy` 8 · `escape` 6 · `merge` 5 · `keyBy` 4 · `debounce` 3 · `groupBy` 2 · `pickBy` 2 · `range` 2 · `take` 2 · `truncate` 2 · `defaults` 2 · `camelCase` 1 · `chunk` 1 · `escapeRegExp` 1 · `omitBy` 1 · `set` 1 · `upperFirst` 1 · plus existing named imports (`debounce`, `omit`, `filter`, `compact`, `uniqueId`).
## Strategy
`import { merge, sortBy, ... } from 'lodash-es'` per file; drop the `_.` prefix. Establishes the `lodash-es` convention buckets C/D reuse. Some (`range`, `chunk`, `take`, `groupBy`) have native equivalents — defer those to native only if trivial, otherwise keep `lodash-es`.
## Branch
`code-maintenance/OP-19546-migrate-lodash-es` off `dev`.
Bucket E of [#65621](https://community.openproject.org/work_packages/65621). Helpers with no clean native equivalent — switch from the global `_` to explicit tree-shakeable `lodash-es` named imports (add `lodash-es` to `frontend/package.json`). **Lowest risk** (mechanical import swap), good first PR.
## Call sites (~46)
`sortBy` 8 · `escape` 6 · `merge` 5 · `keyBy` 4 · `debounce` 3 · `groupBy` 2 · `pickBy` 2 · `range` 2 · `take` 2 · `truncate` 2 · `defaults` 2 · `camelCase` 1 · `chunk` 1 · `escapeRegExp` 1 · `omitBy` 1 · `set` 1 · `upperFirst` 1 · plus existing named imports (`debounce`, `omit`, `filter`, `compact`, `uniqueId`).
## Strategy
`import { merge, sortBy, ... } from 'lodash-es'` per file; drop the `_.` prefix. Establishes the `lodash-es` convention buckets C/D reuse. Some (`range`, `chunk`, `take`, `groupBy`) have native equivalents — defer those to native only if trivial, otherwise keep `lodash-es`.
## Branch
`code-maintenance/OP-19546-migrate-lodash-es` off `dev`.