-
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
[typescript-migration] calendar.jsx and index.jsx #4766
[typescript-migration] calendar.jsx and index.jsx #4766
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.
@yuki0410-dev anything needed to complete this? |
@martijnrusschen |
434c39f
to
3bc7937
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4766 +/- ##
==========================================
+ Coverage 96.35% 98.36% +2.01%
==========================================
Files 8 6 -2
Lines 959 61 -898
Branches 435 19 -416
==========================================
- Hits 924 60 -864
+ Misses 35 1 -34 ☔ View full report in Codecov by Sentry. |
3bc7937
to
cc88150
Compare
I noticed a lot of changes that replaced |
@mirus-ua |
@mirus-ua |
Conditional types work well only with |
@mirus-ua |
843472f
to
42d699c
Compare
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.
@yuki0410-dev 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
+ 947
- 1,213
87% TSX
10% TypeScript
2% JavaScript (tests)
1% JSON
<1% Other
Type of change
Feature - These changes are adding a new feature or improvement to existing code.
1 Message | |
---|---|
Due to its size, this pull request will be reviewed by PullRequest staff before being sent to the reviewer network, and the team will reach out if there are any concerns. After this pull request is sent to the network, please be aware that it will likely have a longer turnaround time and require multiple passes from our reviewers. |
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.
Very nice work tackling this typescript conversion! I left some feedback throughout for you to consider. Most of it is simplification suggestions but I also left some comments around potential regressions.
Reviewed with ❤️ by PullRequest
{ dateFormat, locale }: { dateFormat: string | string[]; locale?: Locale } = { | ||
dateFormat: "yyyy-MM-dd", | ||
}, | ||
date: Date | null | undefined, |
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.
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.
IMHO, we should use prop?: Type
over prop: Type | undefined
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.
Left a few comments, but going back and looking at the commits one by one, it may be that these changes are more a question for the existing design than your changes.
The separation of commits, as you did, is a helpful tool for reviewers which could be improved a bit by increasing specifics. Eg, rather than "fix linting rules", I generally prefer, "Updated linting rules to include tsx files."
Reviewed with ❤️ by PullRequest
42d699c
to
429a0cb
Compare
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.
@mirus-ua can you review this PR as well? |
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.
First of all, thank you for the big chunk of work and that you wrote a lot of explicit return types it'll help in the future to make changes in a safe way.
I have a few points:
prop: Type | null | undefined
can be simplified toprop?: Type | null
- I don't understand the reason why we replace
HTMLDivElemnt
withHTMLElement
that quite generic and may cause problems for the extension in the future VoidFunction
as props looks like it should be replaced with proper typed function with arguments
Edit:
The good idea is to document all changes that even slightly can be called as breaking
{ dateFormat, locale }: { dateFormat: string | string[]; locale?: Locale } = { | ||
dateFormat: "yyyy-MM-dd", | ||
}, | ||
date: Date | null | undefined, |
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.
IMHO, we should use prop?: Type
over prop: Type | undefined
429a0cb
to
473c405
Compare
c9a5a62
to
b2b9b8d
Compare
@mirus-ua
Changed the HTMLElement type to a concrete type whenever possible.
We do not think it is necessary to add arguments at this time that are not being used at this time. |
I use Also, as for the |
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.
b2b9b8d
to
6333420
Compare
6333420
to
6fe84be
Compare
But the optional operator implicitly adds
If you say that all these functions don't receive any parameters then OK |
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.
@yuki0410-dev @mirus-ua is this PR ready to merge? |
I don't see any major issues. |
name: Migrate calendar.jsx and index.jsx
Description
Linked issue: #4700
Changes
calendar.jsx
andindex.jsx
was migrated to tsContribution checklist