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

Proposal: Migrate to TypeScript #853

Open
chidexebere opened this issue Apr 17, 2023 · 2 comments
Open

Proposal: Migrate to TypeScript #853

chidexebere opened this issue Apr 17, 2023 · 2 comments
Labels
priority/low Nice to have

Comments

@chidexebere
Copy link

Reasons

I have gone through a reasonable amount of the codebase and I have seen that there is a need to improve the development experience and code quality. TypeScript is better suited for building and managing large-scale applications with multiple teams.

  • It checks the code for errors and warnings before you run it.
  • It static typing feature will reduce the number of errors at build time; hence better developer experience.
  • There will be no need for prop-types, type checking feature will take care of this.
  • It makes code easier to read, maintain, and debug, and can also help reduce the risk of security vulnerabilities.
  • It provides extra tooling and features like interfaces, classes, namespaces, generics, etc.

Proposal

  • Migration can be done in parts since existing JavaScript code will still run in TypeScript.
  • TypeScript code must not be strictly typed as the migration starts. Changes can be made as it progresses. For example, tests can still be left as JavaScript code.
@hellais
Copy link
Member

hellais commented Apr 19, 2023

Ah yes this does indeed sound like a very good idea. As a matter of fact for newer projects we have started building them in typescript from the beginning.

If you would like to take a stab at starting the migration to typescript that would be fantastic!

@chidexebere
Copy link
Author

I wanted to share my plan for the migration.

  1. Set up TypeScript: Install TypeScript and Create a tsconfig.json file to configure TypeScript.
  2. Rename the .js files to .tsx. I will start with the components folder and move to others.
  3. Update dependencies: Some third-party libraries have TypeScript typings available. I will Install these typings (e.g., @types/package-name). If typings are not available, I may need to create custom type definitions or leverage TypeScript's any type for those libraries.
  4. Type annotations and interfaces: Gradually add type annotations to the codebase using interfaces or type aliases.
  5. Compile and test: Run tests to ensure the migration hasn't introduced any regressions or bugs.
  6. Refactor and optimize.
  7. Iterate and repeat from step 2 as I move from one folder to another. Push code with migration done per folder.

@jbonisteel jbonisteel added the priority/low Nice to have label Jan 8, 2024
@hellais hellais added this to Roadmap Jan 7, 2025
@hellais hellais removed this from Roadmap Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/low Nice to have
Projects
None yet
Development

No branches or pull requests

3 participants