You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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!
Set up TypeScript: Install TypeScript and Create a tsconfig.json file to configure TypeScript.
Rename the .js files to .tsx. I will start with the components folder and move to others.
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.
Type annotations and interfaces: Gradually add type annotations to the codebase using interfaces or type aliases.
Compile and test: Run tests to ensure the migration hasn't introduced any regressions or bugs.
Refactor and optimize.
Iterate and repeat from step 2 as I move from one folder to another. Push code with migration done per folder.
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.
prop-types
, type checking feature will take care of this.Proposal
The text was updated successfully, but these errors were encountered: