Skip to content
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

refactor(website): convert website to TypeScript #5328

Merged
merged 10 commits into from
Aug 11, 2021

Conversation

Josh-Cena
Copy link
Collaborator

@Josh-Cena Josh-Cena commented Aug 10, 2021

Motivation

Originally from #5233 (comment). Dogfood TS support on the official Docusaurus website, while also enforcing type checks for other contributors.

Have you read the Contributing Guidelines on pull requests?

Yep

Test Plan

Build passes; pages like:

are working as intended

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 10, 2021
@netlify
Copy link

netlify bot commented Aug 10, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: c211bef

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61126c00390ac10007324620

😎 Browse the preview: https://deploy-preview-5328--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Aug 10, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 49
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5328--docusaurus-2.netlify.app/

@netlify
Copy link

netlify bot commented Aug 10, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 801c694

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61138a849b5dc70007919153

😎 Browse the preview: https://deploy-preview-5328--docusaurus-2.netlify.app

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!
That looks good overall, would just replace some types by React.ComponentProps :)

@@ -60,7 +66,7 @@ const COLOR_SHADES = {

const DEFAULT_PRIMARY_COLOR = '3578e5';

function ColorGenerator({children, minHeight, url}) {
function ColorGenerator() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, this is weird that nothing catched those unused props?

Copy link
Collaborator Author

@Josh-Cena Josh-Cena Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because we have set 'no-unused-vars': OFF, in ESLint config 😅 When converted to TS this is caught by typescript compiler itself

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see, @typescript-eslint/no-unused-vars would catch it

Copy link
Collaborator Author

@Josh-Cena Josh-Cena Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately still not for the website 🤦‍♂️

website/

I was wondering why we had this. Should we re-enable ESLint in the website?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a mistake

we should likely have a dedicated eslint config for our own website (maybe using the one of the FB template or similarr?)

website/src/components/showcase/ShowcaseCheckbox/index.tsx Outdated Show resolved Hide resolved
website/src/components/showcase/ShowcaseCheckbox/index.tsx Outdated Show resolved Hide resolved
website/src/components/showcase/ShowcaseSelect/index.tsx Outdated Show resolved Hide resolved
website/src/pages/index.tsx Outdated Show resolved Hide resolved
website/src/pages/showcase/index.tsx Outdated Show resolved Hide resolved
website/src/theme/ReactLiveScope/components.tsx Outdated Show resolved Hide resolved
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
@slorber
Copy link
Collaborator

slorber commented Aug 11, 2021

LGTM thanks 👍 good catch for the edit URL 😅

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Aug 11, 2021
@slorber slorber merged commit 6c21061 into facebook:master Aug 11, 2021
@Josh-Cena Josh-Cena deleted the website-ts branch August 11, 2021 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants