Skip to content

build: remove unused lodash.debounce dependency - #26

Open
HeversonSilva-gif wants to merge 1 commit into
ido-pluto:mainfrom
HeversonSilva-gif:remove-unused-lodash-debounce
Open

build: remove unused lodash.debounce dependency#26
HeversonSilva-gif wants to merge 1 commit into
ido-pluto:mainfrom
HeversonSilva-gif:remove-unused-lodash-debounce

Conversation

@HeversonSilva-gif

Copy link
Copy Markdown

Description of change

lodash.debounce is declared in dependencies and @types/lodash.debounce in
devDependencies, but neither is imported anywhere in the project. Debouncing here is
done by BytesWriteDebounce in
src/download/download-engine/streams/download-engine-write-stream/utils/BytesWriteDebounce.ts,
which is written from scratch on top of abortableSleep and does not use lodash.

Every install of ipull therefore resolves and downloads a package it never loads.

Verified at 6954781:

  • git grep -E "(from|require\(|import\()\s*['\"]lodash\.debounce" returns nothing, and
    searching the whole of src/ and test/ for any string starting with lodash also
    returns nothing. The only matches in the repository are the two manifest entries and
    their package-lock.json records.
  • npm run build (tsc --build) before the change: exit 0. After: exit 0. This is the
    check that matters most here, since a missing module referenced anywhere in the sources
    would fail the build once the package is uninstalled.
  • npm run lint before: 4 problems, 0 errors, 4 warnings, exit 0. After: identical.
  • npm install reports removed 3 packageslodash.debounce,
    @types/lodash.debounce, and @types/lodash, which came in only as a dependency of the
    latter.

Node 20.20.0, npm 10.8.2, on Windows.

What I could not verify: npm run test. The suite downloads from
https://quick-lint-js.com and expects a server on localhost:3000, and it did not
finish in my environment. I did not want to tick that box without a run behind it. The
build and lint runs above are on both sides, and no test file references lodash either.

Pull-Request Checklist

  • Code is up-to-date with the main branch
  • npm run format to apply eslint formatting — N/A, no source file changed
  • npm run test passes with this change — not run, see the note above
  • This pull request links relevant issues as Fixes #0000 — N/A, no open issue
  • There are new or updated unit tests validating the change — N/A, no behaviour change
  • Documentation has been updated to reflect this change — N/A, no API change
  • The new commits follow conventions explained in
    CONTRIBUTING.md

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