-
Notifications
You must be signed in to change notification settings - Fork 214
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
Enable TypeScript support in this repo #1459
Enable TypeScript support in this repo #1459
Conversation
Thanks for the pull request, @bradenmacdonald! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1459 +/- ##
==========================================
+ Coverage 88.51% 88.69% +0.17%
==========================================
Files 310 312 +2
Lines 5347 5501 +154
Branches 1323 1365 +42
==========================================
+ Hits 4733 4879 +146
- Misses 597 605 +8
Partials 17 17 ☔ View full report in Codecov by Sentry. |
@farhaanbukhsh another PR for you - no rush :) |
@bradenmacdonald this will take some time :) |
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.
@bradenmacdonald thanks for this PR I do have a doubt there are a bunch of JS files are we going to migrate them later?
export const WIDGETS = { | ||
DISCUSSIONS: 'DISCUSSIONS', | ||
NOTIFICATIONS: 'NOTIFICATIONS', | ||
}; | ||
} as const satisfies Readonly<{ [k: string]: string }>; |
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.
export const WIDGETS: Readonly<{ [k: string]: string }> = {
DISCUSSIONS: 'DISCUSSIONS',
NOTIFICATIONS: 'NOTIFICATIONS',
};
@bradenmacdonald I just experimented with this and I found this to be more precise, what do you say?
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.
@bradenmacdonald That makes more sense I was looking it from the point of view of just reading it, inferencing it will be more helpful for sure in the way you did it.
@@ -65,6 +65,7 @@ const NotificationsWidget = () => { | |||
|
|||
// After three seconds, update notificationSeen (to hide red dot) | |||
useEffect(() => { | |||
// eslint-disable-next-line @typescript-eslint/no-implied-eval |
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.
Are we running the linter for TS and TSX? I can't find the command being updated and changes in eslintrc.
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.
Oops, you are right. Fixed with dc39854. Changing .eslintrc shouldn't be needed since it inherits from frontend-build which already configures eslint to support typescript.
@farhaanbukhsh Yeah, we can slowly convert the JS to TS. It's too complex to do it all at once. But once this PR is merged, we can convert things as we go, and all new stuff can use TS. |
@farhaanbukhsh Is this good to go now? |
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.
👍
- ✅ I tested this on devstack
- ✅ I read through the code
- ❌ I checked for accessibility issues
- ❌ Includes documentation
- ❌ I made sure any change in configuration variables is reflected in the corresponding client's
configuration-secure
repository.
As part of taking over maintainership, I want to be able to use TypeScript to improve the quality of the code in this MFE.
This PR is split into three commits:
tsconfig.json
and add types for i18n and the constants insrc/constants.ts
. Updates the CI to do type checking.new-sidebars
folder to use TypeScript, as an example of converting an entire "thing" to TypeScriptmessages.js
tomessages.ts
since none of the "messages" files require any changes to work as TypeScript.Private ref: MNG-4362