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

Refracto: update more code to ts #7148

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

AugustinMauroy
Copy link
Contributor

@AugustinMauroy AugustinMauroy commented Oct 26, 2024

Description

Refracto to have more file in ts:
it's allow to have type-check and it's "securise" our code

Note

There are still files written in javascript, either they are used in the next.config.js so they remain in js for the form but if SWC transpiles the ts.
And there are also node scripts, but you'd need to have a loader or be in node 22.
So for the moment I'd rather do nothing for those.

Validation

  • All test should pass
  • Website should display correctly (use Vercel preview)

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • NA I've covered new added functionality with unit tests if necessary.

@AugustinMauroy AugustinMauroy requested a review from a team as a code owner October 26, 2024 15:49
Copy link

vercel bot commented Oct 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Oct 26, 2024 3:49pm

@AugustinMauroy AugustinMauroy requested a review from a team October 26, 2024 15:50
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

FYI many of these files are intentionally done in plain JS -- so that they do not need to be transpiled by TypeScript.

There is no virtual benefit (necessarily) for having them in TypeScript. What's the motivation behind this change?

@AugustinMauroy
Copy link
Contributor Author

FYI many of these files are intentionally done in plain JS -- so that they do not need to be transpiled by TypeScript.

There is no virtual benefit (necessarily) for having them in TypeScript. What's the motivation behind this change?

For me, it's ‘important’ to have them in typescript, for example next.dynamic, which is responsible for the entire content of the site. Because typescript offers type-checking which allows us to check that our code is correct and is supposed to help with the review.
We shouldn't all write in typescript in ‘wow that's typescript’ mode but see it more as a tool to limit errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants