-
Notifications
You must be signed in to change notification settings - Fork 2.3k
chore(deps): upgrade date-fns to v4.1.0 (attempt no. 2) #5332
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
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
+ 111
- 105
69% TypeScript
13% JavaScript
7% JSON
6% TSX (tests)
5% TypeScript (tests)
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 #5332 +/- ##
==========================================
- Coverage 96.92% 96.87% -0.06%
==========================================
Files 30 30
Lines 3416 3358 -58
Branches 1427 1431 +4
==========================================
- Hits 3311 3253 -58
+ Misses 105 103 -2
- Partials 0 2 +2 ☔ View full report in Codecov by Sentry. |
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.
"react-dom": "ReactDOM", | ||
clsx: "clsx", | ||
"date-fns": "dateFns", | ||
"@floating-ui/react": "FloatingUIReact", |
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.
These seem new, are these required?
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.
They make the UMD build work in non-bundler environments. So not strictly necessary in the context of this PR but overall I think they should be kept
Description
Linked issue: #5177, #5128, #5326
Problem
This PR is a second attempt after #5326 to 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 (this time for real, I triple checked).Changes
date-fns
version in package.jsonbrowser
field entirely and added more modernexports
fielddate-fns
directly, also in tests for consistencyTo reviewers
So it turns out that the main cause of the docs page failing after all was the
browser
field in package.json. It was pointing to the UMD build, which just wouldn't work withdate-fns
after the update. It pointsbrowser
to an ESM file exporting all the other ESM files with individual functions. ESM and UMD are not compatible with each other (oh well), so there was just no way it would work.What I did is I simply removed the
browser
field. I honestly think it was just used incorrectly until now. We could keep it (pointing to the ESM build) but ifbrowser
field is missing bundlers usemodule
field anyway, and some (namelyesbuild
) have additional behavior where they can usemain
instead if imported withrequire
. From what I've checked most frontend libraries nowadays tend to omit this field, but if you REALLY want to keep it, I can - just need to change it to the ESM build.I kept the changes from previous PR, namely using only main
date-fns
export as an import source. This is part of the "fixing UMD bundle" effort which I decided to do as soon as I found out... it doesn't work at all. Or I guess it could work but it would require an enormous amount of effort. After extending theglobals
field in Rollup config it's now doable to use it with only CDN-imported dependencies.I also added the
exports
field which I initially thought was relevant to this. It is not, however I think it's still valuable to keep it. If you'd prefer to do it in a separate PR (I will open one tomorrow re/ docs site), I can do that, too.I think that's all.
Contribution checklist