protobuf.js icon indicating copy to clipboard operation
protobuf.js copied to clipboard

fix(types): update type deps

Open thw0rted opened this issue 1 year ago • 2 comments

Remove duplicate long types

Long has shipped with its own TS types for a while now, and the package from DefinitelyTyped conflicts with the newest version. TS consumers wind up with errors when trying to work with Long values.

thw0rted avatar Jul 18 '22 15:07 thw0rted

@thw0rted Would you mind fixing the failing tests in your branch? Thank you!

alexander-fenster avatar Jul 20 '22 21:07 alexander-fenster

I think it's fixed now. I updated the test-runner script to do the whole directory at once, rather than 3 separate invocations of tsc. That should be enough to close out this PR.

I did also try to take the "minimal" definition of a Long interface out of util/common.js but vanilla JSDoc still doesn't have a way to import a type definition (https://github.com/jsdoc/jsdoc/issues/1537, https://github.com/jsdoc/jsdoc/issues/1645) so I think we're stuck with it for now.

Just as an aside, this is like the 4th issue in the last week where trying to stick with vanilla JSDoc, instead of using TypeScript's JSDoc parser, has made my life difficult. JSDoc is a dead standard, they haven't published a meaningful update since 2017, and it's really holding the whole ecosystem back. Specifically, ESM support has come a long way in 5 years, and JSDoc still assumes a CJS / global-pollution model for types... and we have no reason to expect them to rectify that situation. Not sure what PBJS can do about that, I guess, but it's something to think about.

thw0rted avatar Jul 21 '22 09:07 thw0rted