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

convert all require() statements to import statements #410

Open
zepumph opened this issue Nov 14, 2024 · 2 comments
Open

convert all require() statements to import statements #410

zepumph opened this issue Nov 14, 2024 · 2 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Nov 14, 2024

While working on #403, it became clear that a large amount of overhead to convert one file to typescript will be converting each spot where that module is used to an import statement, or use require(...).default. This is less than ideal. So we would like to experiment with converting all require statements over to imports.

This also boosts typescript support since require() often provides the import as an "any" type.

@zepumph
Copy link
Member Author

zepumph commented Nov 15, 2024

I got to a commit point, but I don't want to push at 5pm. I will discuss with @samreid tomorrow morning.

Next steps:

  • Push my local commit from chipper/
  • Apply same pattern to perennial
  • Address TODO about telling people to convert their js files to ts since they use imports. Not ideal.
  • Continue with Convert execute.js to typescript #403

@zepumph
Copy link
Member Author

zepumph commented Nov 15, 2024

  • Get rid of usages of __dirname in perennial using the pattern from chipper.

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

No branches or pull requests

1 participant