-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Optimize upcoming events list grouping #16499
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
base: dev
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for ethereumorg failed.
|
@claude review |
Claude finished @minimalsm's task —— View job Code Review Complete ✅Great optimization! This PR successfully removes the lodash dependency and improves type safety. Here's my detailed review: ✅ Excellent ChangesBundle Size Optimization
TypeScript Improvements
Implementation Quality
🔍 Minor ObservationsCode Style (very minor)
// Current (works fine):
const key = `${formatYearMonth}`
// Could be simplified to:
const key = formatYearMonth Type Consistency
📊 Performance ImpactThis change provides clear benefits:
🧪 VerificationThe changes maintain:
SummaryThis is a solid optimization that achieves its goal of reducing bundle size while improving type safety. The native reducer implementation is clean, well-typed, and functionally equivalent to the lodash version. Approved for merge 🚀 |
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.
Looks good over all, but makes me think if it'd be worth just creating light-weight lodash-equivalent utility helpers that we could reuse for these purposes. cc: @pettinarip I feel like we made an attempt to do something like this in a previous migration but decided against it, curious if you have any thoguhts here
const key = `${formatYearMonth}` | ||
|
||
if (!acc[key]) { | ||
acc[key] = [] | ||
} | ||
|
||
acc[key].push(event) | ||
return acc |
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.
Agree with comment..
`${}`
^ Redundant pattern, but we then don't need to assign to const key
either
const key = `${formatYearMonth}` | |
if (!acc[key]) { | |
acc[key] = [] | |
} | |
acc[key].push(event) | |
return acc | |
if (!acc[formatYearMonth]) { | |
acc[formatYearMonth] = [] | |
} | |
acc[formatYearMonth].push(event) | |
return acc |
or, just name formatYearMonth
key
instead
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f017c879e08322921e3964eaca2079