-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: changed from lodash to es-toolkit #18162
Open
guidari
wants to merge
11
commits into
carbon-design-system:main
Choose a base branch
from
guidari:17731-lodash
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7807edf
fix: changed from lodash to lodash-es
guidari db3fcc8
fix: fixed import
guidari af3966c
fix: removed console log
guidari bc63e12
test: added transform to the jest.e2e.config.js as well
guidari 07aa8b2
fix: fixed examples folders to add type module
guidari 4bc019c
fix: roll back example folder
guidari 0eaa706
Merge branch 'main' into 17731-lodash
guidari 7ccbffc
Merge branch 'main' into 17731-lodash
guidari 029bd94
fix: removed omit from lodash to use pure JS
guidari a76ec07
fix: added es-toolkit in throttle method in Slider
guidari 240cb7c
feat: added es-toolkit for debounce as well
guidari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2025,14 +2025,12 @@ __metadata: | |
css-loader: "npm:^7.0.0" | ||
downshift: "npm:9.0.8" | ||
enquirer: "npm:^2.3.6" | ||
es-toolkit: "npm:^1.27.0" | ||
fast-glob: "npm:^3.2.7" | ||
flatpickr: "npm:4.6.13" | ||
fs-extra: "npm:^11.0.0" | ||
html-webpack-plugin: "npm:^5.5.0" | ||
invariant: "npm:^2.2.3" | ||
lodash.debounce: "npm:^4.0.8" | ||
lodash.omit: "npm:^4.5.0" | ||
lodash.throttle: "npm:^4.1.1" | ||
mini-css-extract-plugin: "npm:^2.4.5" | ||
postcss: "npm:^8.4.5" | ||
postcss-loader: "npm:^8.0.0" | ||
|
@@ -12520,6 +12518,18 @@ __metadata: | |
languageName: node | ||
linkType: hard | ||
|
||
"es-toolkit@npm:^1.27.0": | ||
version: 1.27.0 | ||
resolution: "es-toolkit@npm:1.27.0" | ||
dependenciesMeta: | ||
"@trivago/[email protected]": | ||
unplugged: true | ||
[email protected]: | ||
unplugged: true | ||
checksum: 10/637fb282c17614143aa185f20b44a7b113157b103a92e20d7c483da24170710cf01a5f93285737e33364b03f773765bc4276ccbbfc65702387173c34ec7a259b | ||
languageName: node | ||
linkType: hard | ||
|
||
"es6-denodeify@npm:^0.1.0": | ||
version: 0.1.5 | ||
resolution: "es6-denodeify@npm:0.1.5" | ||
|
@@ -18748,13 +18758,6 @@ __metadata: | |
languageName: node | ||
linkType: hard | ||
|
||
"lodash.omit@npm:^4.5.0": | ||
version: 4.5.0 | ||
resolution: "lodash.omit@npm:4.5.0" | ||
checksum: 10/f5c67cd1df11f1275662060febb629a4d4e7b547c4bea66454508b5e6096162c2af882aab1ff8cb5dcf2b328f22252416de6ca9c1334588f6310edfac525e511 | ||
languageName: node | ||
linkType: hard | ||
|
||
"lodash.snakecase@npm:^4.1.1": | ||
version: 4.1.1 | ||
resolution: "lodash.snakecase@npm:4.1.1" | ||
|
@@ -18797,13 +18800,6 @@ __metadata: | |
languageName: node | ||
linkType: hard | ||
|
||
"lodash.throttle@npm:^4.1.1": | ||
version: 4.1.1 | ||
resolution: "lodash.throttle@npm:4.1.1" | ||
checksum: 10/9be9fb2ffd686c20543167883305542f4564062a5f712a40e8c6f2f0d9fd8254a6e9d801c2470b1b24e0cdf2ae83c1277b55aa0fb4799a2db6daf545f53820e1 | ||
languageName: node | ||
linkType: hard | ||
|
||
"lodash.truncate@npm:^4.4.2": | ||
version: 4.4.2 | ||
resolution: "lodash.truncate@npm:4.4.2" | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Gui, Thanks for the changes, its Awesome!
I tried to read about throttle from es-toolkit and found that it will accept only 2 parameters like
throttle(func, wait)
while for lodash it's likethrottle(func, wait, options)
In this file
Slider.tsx
we were using throttle from lodash asWhich means the function
this._onDrag
is executed immediately when the event is triggered , but it will not be executed again at the end of the throttling interval.Can you please make sure to change the code as well as per es-toolkit to achieve the same functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Preeti!
I tested with lodash and es-toolkit and the behaviour is the same. We are using the
es-toolkit/compat
that has full compatibility with lodash, so we don't have to change the code. Alles-toolkit
functions have a "compat" version to ensure we don’t need to change anything in our code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, the link is saying it supports
leading
andtrailing
options as well. Thanks!