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

JS->TS: Port project from JavaScript to TypeScript #2

Open
9 of 11 tasks
britalmeida opened this issue Jul 30, 2023 · 2 comments
Open
9 of 11 tasks

JS->TS: Port project from JavaScript to TypeScript #2

britalmeida opened this issue Jul 30, 2023 · 2 comments

Comments

@britalmeida
Copy link
Owner

britalmeida commented Jul 30, 2023

The renderer and watchtower were initially developed in JS, but this led to constant problems and time wasted in debugging mistakes with poor error reporting.
TypeScript should help with typing safer code and having better tools and static code analysis instead of things going 'undefined' sometimes :) Although it's work to convert the full project, it should be a worthy investment considering the amount of sadness that went into trivial mistakes.

  • Add TS to the pipeline.
  • Add type hints to the code progressively.
  • Fix errors found by the static analysis.
    • Address spurious?? issue that array of strings is reported as string|null because of array iteration (shading.js)
    • ExampleManyImages: error passing in uiConfig object
  • All code in TS
    • Is Index.js still needed?
  • Enable the most pedantic set of errors, no 'any', strict null checks etc.
  • Imports are working correctly (example problem in ExampleManyImages?)
  • All IDEs and settings enabled. No errors left :)
    • Sometimes warnings spam when running yarn install. (ESBuild?)
@britalmeida
Copy link
Owner Author

britalmeida commented Jul 30, 2023

Option that caused

spurious?? issue that array of strings is reported as string|null because of array iteration (shading.js)

is disabled pending a reply in microsoft/TypeScript#55206

@britalmeida
Copy link
Owner Author

Sometimes warnings spam when running yarn install. (ESBuild?)

Seemingly an ESBuild problem which would get solved by upgrading to yarn 3:
evanw/esbuild#789

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

No branches or pull requests

1 participant