-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Migrate to Typescript #31
base: master
Are you sure you want to change the base?
Conversation
Hi @JumpLink, thank you for creating this PR. Migrating to Typescript was not in the roadmap in the short/mid-term. I will need to review these changes thoroughly (it is a big change) and that will take time. |
@alvaromontoro yes I understand. I thought it would make more sense (and not really more effort) to port the project itself to Typescript instead of writing separate types for @types. Thanks to the typescript precompiler, it was also easy to build the package for ESM and CJS, so I did that as well. To stay backwards compatible I left the webpack build in, so this bundle can still be used if you don't want to use npm or any bundler in your own project. So the result is:
Possibly the types can be further improved and thanks to Babble the APIs for old browsers can also be omitted in the future. For this I also had to use the I would be happy if the PR would be merged and I already have another idea for a future separate PR. |
Sorry, it's taking me so long. At the moment, I don't have the bandwidth to take care of such a big review :( |
@alvaromontoro Yes I understand that, don't stress yourself. Since the codebase is manageable I would just look at and test the result instead of review the PR's diff directly. At the moment I'm busy with other projects myself but in the future I have some more features in mind that I would like to submit. For example, Firefox seems to map some controllers differently than Chrome on Linux. I haven't tested if this is also the case on other operating systems, but we could add the possibility to make the mapping of the buttons configurable ( maybe depending on the browser /os) and in this way align the controller mapping of Firefox. Do you have a kind of roudmap so that I can assess which features you have already planned for yourself in the future? However, I would then want to submit such a PR based on this PR. Therefore, I would be happy if the review is completed by then. |
@alvaromontoro What is the status on this? It's been 1 year already. |
@alvaromontoro If you are not sure about how this update will play out, you could accept the changes on a separator branch (e.g.
Note: Another big advantage of TypeScript is that you can deliver the doc directly into the declaration files ( |
@JumpLink By the way, it might help the review if you remove the |
@JumpLink Ok I couldn't resist to make my own esm version https://www.npmjs.com/package/esm-gamecontroller.js If you are interested in making some changes, let's continue the work there! Have a good one. |
@vdegenne thank you for this! |
serve
script to run the examples locally