docs(guides): fix lodash classification from peerDependency to depend…#8094
Open
jay7-tech wants to merge 1 commit intowebpack:mainfrom
Open
docs(guides): fix lodash classification from peerDependency to depend…#8094jay7-tech wants to merge 1 commit intowebpack:mainfrom
jay7-tech wants to merge 1 commit intowebpack:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes #6896.
(Incorrect advice to use peerDependencies for utility libraries).
The Authoring Libraries guide was advising developers to treat utility libraries like lodash as peerDependencies to avoid bundle bloat when externalizing them. However, a in the issue, if a library relies on lodash internally at runtime, it must be listed in dependencies.
peerDependencies are strictly for packages that a consumer must install directly in their own app to satisfy the library's environment (eg React for a UI component library). dependencies guarantees the package manager installs the utility library automatically.
This PR simply correctly updates the text to advise using dependencies instead, while keeping the explanation of how to externalize it in the webpack config to prevent duplication.
What kind of change does this PR introduce?
Fix / Documentation
Did you add tests for your changes?
NA
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
N/A
Use of AI
None.