-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
chore(deps): upgrade date-fns to v4.1.0 #5326
Conversation
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.
✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!
What to expect from this code review:
- Comments posted to any areas of potential concern or improvement.
- Detailed feedback or actions needed to resolve issues that are found.
- Turnaround times vary, but we aim to be swift.
@paolostyle you can click here to see the review status or cancel the code review job.
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.
PullRequest Breakdown
Reviewable lines of change
+ 92
- 101
76% TypeScript
10% JavaScript
7% TSX (tests)
6% TypeScript (tests)
1% JSON
Generated lines of change
+ 5
- 5
Type of change
Feature - These changes are adding a new feature or improvement to existing code.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5326 +/- ##
==========================================
- Coverage 96.92% 96.87% -0.06%
==========================================
Files 30 30
Lines 3416 3358 -58
Branches 1414 1431 +17
==========================================
- Hits 3311 3253 -58
+ Misses 105 103 -2
- Partials 0 2 +2 ☔ View full report in Codecov by Sentry. |
@paolostyle Let's give this a try. Thanks for pushing this along. The added context in the description will be helpful for future references. If you're up with helping to upgrade outdated logic feel (such as the build system) free to open a PR. |
OK, it seems we're not fully functional: https://reactdatepicker.com/ |
Okay I must've messed up something during my local development as it indeed does not work after I did a clean set up, more specifically the UMD build used by the docs page does not work. I will revisit this and get back to you. That being said I wonder if the UMD build is even needed nowadays. ESM "just works" which I verified by replacing |
Description
Linked issue: #5177, #5128
Problem
This PR update
date-fns
to the latest version, v4.1.0. Dependabot update breaks the docs website (which is a separate topic in itself, the build system over there is extremely outdated - happy to help with that), my changes fix these issues so the website is still functional.Changes
date-fns
directly, also in tests for consistencyTo reviewers
This might seem like a bad decision, after all previous contributors were using direct date-fns exports to reduce the bundle size! This isn't actually correct after v4.1.0. Since v4,
date-fns
is marked astype: "module"
, so really any somewhat up-to-date bundle will handle tree shaking correctly (in fact this might've been the case even earlier as date-fns was providing ESM exports back in v3, too). I have a hard time imagining that people stuck on super old bundlers that don't work with ESM are keeping this library up to date.On another note, if this was an issue, someone would likely report it already, because there was a direct
date-fns
import insrc/calendar.tsx
for a while now, so for CJS builds this would've had an impact already anyway.As a small positive side effect, the final bundle size is slightly smaller for every produced target.
After this is merged I believe both linked issues can be closed; one is the dependabot's PR, the other contains a subset of my changes.
Contribution checklist