-
Notifications
You must be signed in to change notification settings - Fork 83
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
Switch to TypeScript #99
Comments
I'm not opposed to adding TypeScript support, I've just never used it and – nothing against TypeScript – but I don't have the time or desire to learn it right now. What's involved in adding support? I'm mostly just not sure how I can support it without understanding it. 🤷♂️ Ideas very much welcome. |
Adding support involves creating d.ts files that have same names with js files and declare the types in them. For instance, you need to create app.d.ts for app.js in same directory (you can place them in separate folder though). These links should give you brief information about d.ts:
Also you can take a look at @types/react-howler/index.d.ts |
Thanks for the resources @iakindev. Unfortunately this just isn't something I'm going to be able to help much with... I'd happily accept a PR (especially if the TS definitions can be kept apart from the actual source to avoid source churn) but I would need community help with validation of the PR because like I said, I don't have the time or interest to learn this to a level where I'd be comfortable giving it the myself. If a PR were submitted and was given the stamp of approval by members of the community, I think it'd be easy enough to keep it up to date in the future. As has been discussed before and most already know, this package is pretty "feature mature" in the sense that it's just a convenient React wrapper around Howler. I don't see major things changing so I'd hope that TS support would be easy enough to maintain for future changes. |
hey, so I'm using typescript and I've used react howler before so if you're still looking for a PR I'd be happy to start working on one! |
Hey @pn320, thanks for the comment. My views are pretty much the same as they were in my last comment. I'm using this package in production in a web app that has quite a bit of use and I'm personally not looking to add new features or create more maintenance to this package. |
So, it is no secret that this package lacks TypeScript support. Yeah @types/react-howler exists but most of the time it's out of sync.
Also with this switch we can directly cast react-howler's props to howler and use the types from @types/howler for props (also proper auto-complete support is huge bonus). So every time howler gets updated all we need to do is update howler and @types/howler.
The text was updated successfully, but these errors were encountered: