-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Modernize and document common-hid-packet-parser.js #4718
Conversation
JoergAtGithub
commented
Apr 7, 2022
•
edited
Loading
edited
- Applied eslint setup changes specific for common-hid-packet-parser.js
- Applied automatic pre-commit changes
- Added missing JSDOC documentation (where applicable copied from https://github.com/mixxxdj/mixxx/wiki/Hid-Packet-Parser-Js )
- Use modern ES6 class syntax
Applied eslint changes for common-hid-packet-parser.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how much work you want to put into this. A lot of things could be improved, but I don't want to force you to do too much work. So what scope did you intend for this PR? Just make the new ESLint config pass, improve docs or even modernize large parts the library?
No large changes, only cleanup and one small functional extension to initialize data. |
534aa42
to
e1df6de
Compare
2122906
to
030f286
Compare
Some types documented
030f286
to
597d1f2
Compare
b0bee5b
to
10139a1
Compare
55ca7d9
to
3950a59
Compare
Removed one duplicate line
0dc5d34
to
b890d51
Compare
I have left some comments. Not sure what will fit in the PR or should be postponed. |
609b61f
to
4ec232f
Compare
…and not valid JSDoc. -- Unfortunately I had to replace the typedef packetItemId, because the JSDoc Object. syntax for records requires type string as index. -- For type compatibility with TypeScript (and TypeScript based tools like VS Code), the keyword Object in JSDoc must be upper case. To prevent such tools reporting false positive errors, the setting of eslint-plugin-jsdoc (this case is described here: https://github.com/gajus/eslint-plugin-jsdoc/blob/master/README.md#why-not-capital-case-everything)
4ec232f
to
af39091
Compare
…l, I added it nevertheless, because VS Code doesn't print it otherwise
Added type for HIDPacket.packSizes Added missing information about endianess of pack types
…in the Mixxx codebase, and the comment that it don't work is there since the beginning of the Mixxx Git history.
@Swiftb0y I addressed now all open review comments. I would be glad, if you could confirm, that I did this in your sense. |
Yes, thank you for your effort. Unfortunately, as I pointed out, I only reviewed the first third. I don't know when or even if I'll get to the rest sometime. |
Yes, I fully understand this. Therefore I requested no re-review from you. |
first third lgtm, rest still needs review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did another review round with my limited JS knowledge.
And I did not spot obvious issues.
Given that this a PR just started for documentation purpose, it is already mature.
Thank you for all the work.
Can you confirm that this is ready for merge and has been tested with HID Hardware?
@Swiftb0y and @ywwg Did you had a chance to test this on your hardware?
If you don't have objections, I will merge this in a few days.
Thank you.
@daschuer Thank you very much for reviewing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow me another couple days to review the rest of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
little nitpicks. I highly appreciate all the effort put into this code, yet I still don't understand the library even the slightest. In the end I'd call for the deprecation of this library and would favor a smaller library based on TypedArray
s which integrates into componentsJS. Until then, I highly appreciate all the work you put spend so far. LGTM apart from my two nitpicks.
A rewrite from scratch makes sense, but before starting with this task, I would like to improve the C++/JavaScript HID API. Currently all the semantic information, which HID provides about the individual controls of a device, isn't accessible in the JS mapping code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Sorry for taking so long.
Thank you for the detailed review! |