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 upload and move to typescript #6

Open
vanatteveldt opened this issue Feb 3, 2022 · 0 comments
Open

Refactor upload and move to typescript #6

vanatteveldt opened this issue Feb 3, 2022 · 0 comments

Comments

@vanatteveldt
Copy link
Member

vanatteveldt commented Feb 3, 2022

Edit: move is mostly complete, only upload is left, but that probably needs a bit of refactor first


I think we should move to type script.

This can be done by installing typescript and renaming sources files to tsx one by one. Imports also need to be changed AFAICS, it doesn't automatically check for a tsx file if you don't specify an extension (?)

Benefits:

  • Better automatic documentation, especially of props
  • Automatic checking especially of props and callback argument types -> fewer bugs
  • Better autocomplete in editor

Process:

  • https://webpack.js.org/guides/typescript/ install typescript and ts-loader and set webpack to run tsx files through ts-loader
  • change jsx: react to jsx: react-jsx in tsconfig [https://stackoverflow.com/questions/64656055/react-refers-to-a-umd-global-but-the-current-file-is-a-module]
  • deal with lots of error messsages

Useful links:

vanatteveldt added a commit that referenced this issue Feb 7, 2022
vanatteveldt added a commit that referenced this issue Feb 7, 2022
vanatteveldt added a commit that referenced this issue Feb 7, 2022
vanatteveldt added a commit that referenced this issue Feb 7, 2022
vanatteveldt added a commit that referenced this issue Feb 7, 2022
vanatteveldt added a commit that referenced this issue Feb 8, 2022
vanatteveldt added a commit that referenced this issue Feb 8, 2022
vanatteveldt added a commit that referenced this issue Feb 8, 2022
vanatteveldt added a commit that referenced this issue Feb 8, 2022
@vanatteveldt vanatteveldt changed the title Move to typescript Refactor upload and move to typescript Feb 11, 2022
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