Menu

Post image 1
Post image 2
1 / 2
0

Replacing Lodash with Native ES2026: groupBy, fromAsync, toReversed, and 5 More

DEV Community·RAXXO Studios·19 days ago
#T4SJ0rOr
Reading 0:00
15s threshold

Lodash adds about 70KB minified, ES2026 covers most utility uses with zero dependencies Object.groupBy and Map.groupBy replace _.groupBy and ship in every modern runtime Array.fromAsync, toReversed, toSorted, and toSpliced cover async iteration and immutable transforms structuredClone, Object.hasOwn, Array#findLast, Promise.withResolvers, and Iterator.from finish the swap Lodash still wins for deep equality, debounce, throttle, and iteratee shorthand I pulled Lodash out of a Next.js project last month and saved 71KB on the client bundle. The replacements were already shipping in V8, Bun, and Node 22. I just had not noticed. This is not a "Lodash is dead" piece. Lodash still does a few things native JS does not, and I will be honest about which ones. But for most teams the dependency is doing 5 percent of the work it used to do. Here is the side by side. Object.groupBy and Map.groupBy The one everyone reaches for. Group an array by a key, get back an object of arrays.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More