Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pref():import lodash efficiently #1446

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

thematan
Copy link
Contributor

this is the recommended way to load only the methods needed instead of entire lodash.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

lodash is imported entirely in to the package. when most of it not needed at all.
it makes 78.3% of the bundle!

Issue Number: N/A

What is the new behavior?

imports only the relevant methods. This is the recommended way to pick methods from lodash.
This improves pull request 792, which moved to using the full lodash package,
but made inefficient imports.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

pull request improved: #792
article about importing lodash: https://www.labnol.org/code/import-lodash-211117

this is the recommended way to load only the methods needed instead of entire lodash.
@kamilmysliwiec kamilmysliwiec merged commit 5cc7553 into nestjs:master Aug 31, 2023
1 check passed
@kamilmysliwiec
Copy link
Member

lgtm

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.

3 participants