-
Notifications
You must be signed in to change notification settings - Fork 13
Use Remeda (lodash-like lib) #2269
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
Merged
Merged
Conversation
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
david-crespo
commented
Jun 4, 2024
import { useMemo } from 'react' | ||
|
||
import { lowestBy, sortBy } from '~/util/array' | ||
import * as R from 'remeda' |
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.
It turns out this tree-shakes perfectly well, so we don't need to bother with manual
import { sortBy, firstBy } from 'remeda'
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Jun 7, 2024
…nsole) oxidecomputer/console@a228b75...13d46e8 * [13d46e8f](oxidecomputer/console@13d46e8f) oxidecomputer/console#2272 * [13ce748f](oxidecomputer/console@13ce748f) oxidecomputer/console#2269 * [ab2939bf](oxidecomputer/console@ab2939bf) oxidecomputer/console#2262 * [c9f2bba3](oxidecomputer/console@c9f2bba3) oxidecomputer/console#2252 * [9b7ea533](oxidecomputer/console@9b7ea533) oxidecomputer/console#2261 * [bf97ebc2](oxidecomputer/console@bf97ebc2) oxidecomputer/console#2259 * [a18c7a8f](oxidecomputer/console@a18c7a8f) don't need to exclude IE 11 anymore
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Jun 7, 2024
oxidecomputer/console@a228b75...69ba87b * [69ba87b7](oxidecomputer/console@69ba87b7) oxidecomputer/console#2246 * [13d46e8f](oxidecomputer/console@13d46e8f) oxidecomputer/console#2272 * [13ce748f](oxidecomputer/console@13ce748f) oxidecomputer/console#2269 * [ab2939bf](oxidecomputer/console@ab2939bf) oxidecomputer/console#2262 * [c9f2bba3](oxidecomputer/console@c9f2bba3) oxidecomputer/console#2252 * [9b7ea533](oxidecomputer/console@9b7ea533) oxidecomputer/console#2261 * [bf97ebc2](oxidecomputer/console@bf97ebc2) oxidecomputer/console#2259 * [a18c7a8f](oxidecomputer/console@a18c7a8f) don't need to exclude IE 11 anymore
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Jun 7, 2024
oxidecomputer/console@a228b75...7fa8e6d * [7fa8e6d1](oxidecomputer/console@7fa8e6d1) oxidecomputer/console#2274 * [69ba87b7](oxidecomputer/console@69ba87b7) oxidecomputer/console#2246 * [13d46e8f](oxidecomputer/console@13d46e8f) oxidecomputer/console#2272 * [13ce748f](oxidecomputer/console@13ce748f) oxidecomputer/console#2269 * [ab2939bf](oxidecomputer/console@ab2939bf) oxidecomputer/console#2262 * [c9f2bba3](oxidecomputer/console@c9f2bba3) oxidecomputer/console#2252 * [9b7ea533](oxidecomputer/console@9b7ea533) oxidecomputer/console#2261 * [bf97ebc2](oxidecomputer/console@bf97ebc2) oxidecomputer/console#2259 * [a18c7a8f](oxidecomputer/console@a18c7a8f) don't need to exclude IE 11 anymore
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Jun 7, 2024
oxidecomputer/console@a228b75...a9b325e * [a9b325e9](oxidecomputer/console@a9b325e9) forgot to revert tweak for testing * [7fa8e6d1](oxidecomputer/console@7fa8e6d1) oxidecomputer/console#2274 * [69ba87b7](oxidecomputer/console@69ba87b7) oxidecomputer/console#2246 * [13d46e8f](oxidecomputer/console@13d46e8f) oxidecomputer/console#2272 * [13ce748f](oxidecomputer/console@13ce748f) oxidecomputer/console#2269 * [ab2939bf](oxidecomputer/console@ab2939bf) oxidecomputer/console#2262 * [c9f2bba3](oxidecomputer/console@c9f2bba3) oxidecomputer/console#2252 * [9b7ea533](oxidecomputer/console@9b7ea533) oxidecomputer/console#2261 * [bf97ebc2](oxidecomputer/console@bf97ebc2) oxidecomputer/console#2259 * [a18c7a8f](oxidecomputer/console@a18c7a8f) don't need to exclude IE 11 anymore
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Jun 8, 2024
…es) (#5871) oxidecomputer/console@a228b75...a9b325e * [a9b325e9](oxidecomputer/console@a9b325e9) forgot to revert tweak for testing * [7fa8e6d1](oxidecomputer/console@7fa8e6d1) oxidecomputer/console#2274 * [69ba87b7](oxidecomputer/console@69ba87b7) oxidecomputer/console#2246 * [13d46e8f](oxidecomputer/console@13d46e8f) oxidecomputer/console#2272 * [13ce748f](oxidecomputer/console@13ce748f) oxidecomputer/console#2269 * [ab2939bf](oxidecomputer/console@ab2939bf) oxidecomputer/console#2262 * [c9f2bba3](oxidecomputer/console@c9f2bba3) oxidecomputer/console#2252 * [9b7ea533](oxidecomputer/console@9b7ea533) oxidecomputer/console#2261 * [bf97ebc2](oxidecomputer/console@bf97ebc2) oxidecomputer/console#2259 * [a18c7a8f](oxidecomputer/console@a18c7a8f) don't need to exclude IE 11 anymore
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 is kind of a palate cleanser, nothing important. I saw this lovely library https://remedajs.com/ recommended by @TkDodo, so I tried it and it's very nice. We have some little utilities around arrays and objects and Remeda has drop-in replacements for them. The advantage of using Remeda is
filter().map().filter()
chain doesn't have to loop through the list three times.This PR makes our bundle only 300 bytes bigger after gzip, and that will probably go away after we get rid of the util functions completely instead of wrapping Remeda.