X Tutup
Skip to content

refactor: update lodash imports to specific functions for reduce import costs#463

Merged
azu merged 2 commits intohonkit:masterfrom
noritaka1166:refactor-lodash
May 4, 2025
Merged

refactor: update lodash imports to specific functions for reduce import costs#463
azu merged 2 commits intohonkit:masterfrom
noritaka1166:refactor-lodash

Conversation

@noritaka1166
Copy link
Contributor

update lodash imports to specific functions for reduce import costs

remove unused lodash from package

@azu azu requested a review from Copilot May 4, 2025 06:05
@azu azu added the Type: Refactoring A code change that neither fixes a bug nor adds a feature label May 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the codebase to import only specific lodash functions (e.g. extend, map, reduce, identity, bindAll, functionsIn, each) instead of the entire lodash library to reduce import costs, and it also removes the unused lodash package.

  • Updated lodash imports to specific functions in various files.
  • Replaced all uses of the "_" variable with direct function calls.
  • Removed the redundant lodash package dependency.

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/@honkit/markdown-legacy/lib/toHTML.js Replaced full lodash import with lodash/extend and updated extend usage.
packages/@honkit/markdown-legacy/lib/page.js Updated lodash map usage with the specific lodash/map import.
packages/@honkit/html/src/totext.ts Updated multiple lodash functions (extend, bindAll, functionsIn, each).
packages/@honkit/html/src/index.ts Changed _.identity to identity via specific lodash/identity import.
packages/@honkit/html/src/dom.ts Replaced full lodash import with lodash/reduce for the reduce function.
Files not reviewed (2)
  • packages/@honkit/asciidoc/package.json: Language not supported
  • pnpm-lock.yaml: Language not supported

@azu azu merged commit 5a4c377 into honkit:master May 4, 2025
13 checks passed
@azu
Copy link
Member

azu commented May 4, 2025

lgtm
Ideally, I'd like to remove the dependency on lodash.

@azu
Copy link
Member

azu commented May 4, 2025

It doesn't seem to have any particular impact on the benchmark.
https://honkit.github.io/honkit/dev/bench/

@noritaka1166 noritaka1166 deleted the refactor-lodash branch May 23, 2025 01:21
@github-actions github-actions bot mentioned this pull request Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactoring A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup