-
Notifications
You must be signed in to change notification settings - Fork 112
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
Source code type annotations #331
Comments
Wow! Great to see you're still around 👀
Definitely, yes! I agree it would help a lot with maintainability. I was working on trying to turn on
I would be happy to have whatever you're able to contribute! Feel free to open a draft PR with it, and we can work together on it too. I think the rebase will probably not be too bad, since the switch to ES modules honestly didn't change that much, just the file headers mostly. |
@toasted-nutbread I made a draft PR for my attempt to turn on Maybe it'd be good to try and merge your work into that, so that you get the type checking from vscode etc. Also, there are quite a few things it has caught that seem to be bugs or undefined behavior, or hard-to-tell-what-intent-of-author-was situations. Maybe you'd be able to fix some of those better than I could, so feel free to take a look. |
Yes, in the process of updating the codebase, there were numerous things that had to be slightly changed to ensure type safety, and several things should be fixed in the process. A bunch of these it looks like you have already encountered with that PR, but there's a lot more of that once every function has been annotated. The branch I was working on has all of the changes that are made in #332 addressed, so there is probably some redundancy there. I'll try to clean up my work a little bit and get it into a shareable state, which will likely not PR-ready for a while. Be warned that it's currently sitting at a hefty diff of about:
|
I've created #339, and as promised, it is large. I'll probably post a few additional thoughts at some point related to some things I noticed while making this update, but I'll do that later. |
Hello, as this project is now under new management, I would like to pose a question: is there interest in having full JSDoc type annotations added for this project? In the Yomichan days, I had started doing some of this, but never actually completed it. I have actually added full type annotations to a copy of the project which is based on a commit about 4 months ago. Seeing as things like #307 have occurred, which is good, it would likely take a bit more work for me to rebase it off the latest code, but I may be able to eventually create a pull request for this.
My initial goal in starting this was to improve project sustainability, as there are many complex types which are difficult to fully understand how they work together, since it's a pure JS project. This could eventually lead to the ability to do a full Typescript conversion if necessary, but that's a different story.
Let me know if you'd like to see this effort continued.
The text was updated successfully, but these errors were encountered: