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

TypeScript: missing, wrong and refactoring types #2072

Closed
18 tasks done
wellwelwel opened this issue Jun 18, 2023 · 1 comment
Closed
18 tasks done

TypeScript: missing, wrong and refactoring types #2072

wellwelwel opened this issue Jun 18, 2023 · 1 comment

Comments

@wellwelwel
Copy link
Collaborator

wellwelwel commented Jun 18, 2023

Please, don't use this area to indicate new Issues, give preference to opening a new Issue.

Known Issues

Pool

  • Missing Connection URI overload in mysql import, like createPool('uri')
  • Confusing maxIdle option description

Pool Cluster

It doesn't have any tests yet ⚠️

  • Missing Connection URI overload, like poolCluster.add('conn', 'uri')
  • Missing config option url in add method
  • end, of and add methods can't be in a PoolCluster connection
  • of type can't be a PoolCluster
  • Pool Cluster is missing in promise.d.ts

Constants

  • Missing export for Types (it's necessary to fix both JS and TS)

Notes


🔬 About TypeScript Tests

The tests are based on TypeScript compilation and not executes the compiled code.

Reason: Given that the main codebase and its entire maintenance are carried out in JavaScript, creating tests in TypeScript could potentially hinder development in its primary language. It allows the development of the main driver and its types in parallel.
See: #1957 and #1995 (comment).


ℹ️ About refactoring

The PR #2067 solves all the following refactoring, but it has become too long and hard to review. Then, I plan to split it into smaller tasks and submit them again.

The idea behind the refactoring revolves around:

  • Organizing and patterning the code for better readability and maintenance
  • Improving the performance of the code editor when compiling the types in its display
  • Increasing compatibility across multiple TypeScript configurations (tsconfig)

1) Small refactoring

  • Include all *.ts files into tsconfig.json (except for tests)
  • Resolve TS eslint errors
  • Remove unused TS tests
  • Remove @types/mocha, @types/chai, mocha and chai dependencies
  • Then, include every *.ts file to lint script (including the tests)

2) Large refactoring

  • Pattern all modules importing and exporting
  • Join spread out types
  • Create a reusable way for query and execute overloads

3) Optional refactoring

  • Increasing compatibility with moduleResolution: nodenext
  • Remove strictFunctionTypes: false from tsconfig.json

🕐 Open Issues that have possibly already been resolved
@wellwelwel

This comment was marked as resolved.

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