refactor: update lodash imports to specific functions for reduce import costs#463
Merged
azu merged 2 commits intohonkit:masterfrom May 4, 2025
Merged
refactor: update lodash imports to specific functions for reduce import costs#463azu merged 2 commits intohonkit:masterfrom
azu merged 2 commits intohonkit:masterfrom
Conversation
There was a problem hiding this comment.
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
Member
|
lgtm |
Member
|
It doesn't seem to have any particular impact on the benchmark. |
Merged
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.
update lodash imports to specific functions for reduce import costs
remove unused lodash from package