-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: migrate to TypeScript and ESM #1250
Comments
Migration to ESM is planned. Migration to TypeScript is a controversial question. I'm not a big fan of TypeScript. In some internal cases, it could cause some problems. Anyway, I think this needs to be thought about. However, adding TypeScript definitions is required and planned since the usage of |
Considering the positive effects, I think it might be worth it 😄 |
Also, has #1221 been abandoned? You haven't replied for a long time 😓 |
@DreamOfIce It's not abandoned. Sorry. After some events and burnout, I decided to take a little vacation with my family, so I spent less time than usual on the project. I'll take care of this PR soon. |
I have converted all type declarations to typescript in #1221 and checked them against the source code and the official TypeScript declaration file. |
@DreamOfIce Perhaps TS types can be provided via JSDoc as a first step instead of attempting to maintain declaration files separately. This will allow for generation of declaration files and also provide types in supported tooling even without that step. Additionally, it will make it easier to refactor to TS in the future (if that's desired) because the types will be colocated in comments with the implementation code. |
But we have maintained a type declaration (non-standard TS syntax) for the docs. And converted to standard typescript by me in #1221. BTW, it is a good idea to add some comments using JSDoc |
TypeScript
I think it might be possible to make this change in v4, and here are some reasons why:
I think this change would reduce your maintenance burden in the long run
ESM
Maybe we can write the code in ESM and then use a tool like esbuild to bundle the esm into cjs and iife while compiling the TypeScript
The text was updated successfully, but these errors were encountered: