-
Notifications
You must be signed in to change notification settings - Fork 4
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
Lodash tree shaking #1852
Merged
Merged
Lodash tree shaking #1852
Conversation
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
Instead of import { debounce } from 'lodash'; use import debounce from 'lodash/debounce'; This helps with tree shaking. In particular I ran into issues with this when trying to update Remix apps to use Vite. An alternative would be to use 'lodash-es' instead, which is esm modules.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #1852 +/- ##
=======================================
Coverage 92.61% 92.61%
=======================================
Files 148 148
Lines 2856 2856
Branches 776 776
=======================================
Hits 2645 2645
Misses 195 195
Partials 16 16 ☔ View full report in Codecov by Sentry. |
size-limit report 📦
|
booc0mtaco
approved these changes
Feb 23, 2024
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.
Good catch. Looks like we don't have many outliers.
Merged
booc0mtaco
added a commit
that referenced
this pull request
Mar 4, 2024
## [13.12.0](v13.11.0...v13.12.0) (2024-03-04) [Storybook](https://61313967cde49b003ae2a860-telsscxlak.chromatic.com/?path=/docs/getting-started--docs) ### Features * export ClickableStyleProps ([#1860](#1860)) ([0d1b49e](0d1b49e)) * **Select:** add support for required in overline ([#1855](#1855)) ([6e44566](6e44566)) ### Bug Fixes * lodash tree shaking ([#1852](#1852)) ([f55f9cb](f55f9cb)) * **Select:** add max height for Select.Options ([#1858](#1858)) ([24ed8bc](24ed8bc))
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.
This PR updates our usage of Lodash so that we replace named imports
with deep ones
This should help tree shaking work better. I don't think this is a problem in our existing Remix apps (tree shaking works properly), but I'm running into an issue when trying to use ESM modules in Remix apps.
Alternatives:
lodash-es
instead (which is esm). Downside of that is we'd need to have our existing Remix apps pre-bundle lodash so that it's cjs.