refactor: remove lodash dependency - #273
Merged
Merged
Conversation
|
PR checklist
|
joris974
force-pushed
the
remove-lodash
branch
from
August 25, 2026 16:54
3b465c1 to
aad70b7
Compare
joris974
marked this pull request as ready for review
August 25, 2026 16:58
joris974
requested review from
cdmren and
dverdaguer
and removed request for
a team and
dverdaguer
August 25, 2026 16:58
5 tasks
Every usage was a trivial single-array-function import (map, reduce, find, times, forEach, identity) with a direct native equivalent. Replaces them with Array.prototype methods and inline arrow functions, and drops lodash and @types/lodash from package.json. Note: lodash still appears in the dependency tree transitively via @freckle/non-empty, so this only removes parser-js's own direct usage.
joris974
force-pushed
the
remove-lodash
branch
from
August 25, 2026 18:16
aad70b7 to
d0f6153
Compare
cdmren
approved these changes
Aug 25, 2026
cdmren
left a comment
Contributor
There was a problem hiding this comment.
Skimmed, seems straightforward
joris974
enabled auto-merge
August 25, 2026 21:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One less dependency
Summary
map,reduce,find,times,forEach,identity) called on plain arrays — no deep-clone/deep-equal/debounce or other "hard" lodash behavior anywhere.Array.prototypeequivalent (or an inline arrow function), acrosssrc/formatting.ts,src/path.ts,src/index.ts,src/index.test.ts, andsrc/test-helper.ts.lodashand@types/lodashfrompackage.json/pnpm-lock.yaml.dist/viapnpm buildpercheck-git-clean.shconvention.This follows up on #270/#271, which patched lodash's import style to survive ESM resolution under Vitest — this removes the dependency outright instead.
Note:
lodashstill shows up in the resolved dependency tree, since@freckle/maybeand@freckle/non-emptyboth depend on it directly. This PR only removes parser-js's own direct dependency and usage.Rebased onto v4.0.0 main. #275 (native
Dateinstead ofMoment) landed first, so this branch was rebased on top of it. Conflicts were inpackage.json,pnpm-lock.yaml,src/index.ts(the import block, where lodash sat next to the newdate-fnsimport), anddist/index.js.src/index.test.tsmerged cleanly. Test count is 82 rather than 76 because #275 added six.Test plan
pnpm install— lockfile updates cleanly,lodash/@types/lodashentries removedpnpm build— typechecks cleanpnpm test— all 82 tests passprettier --check 'src/**/*.ts'— clean🤖 Generated with Claude Code