gulpjs / plugin-error

Error handling for vinyl plugins. Just an abstraction of what's in gulp-util with minor reformatting.
MIT License
19 stars 13 forks source link

Document library with type definitions #5

Closed demurgos closed 6 years ago

demurgos commented 6 years ago

Hi, It would be great if this project bundled its Typescript type definitions to document its API. I am bringing this up because of the recent deprecation of gulp-util. This library is one of the recommended replacements and there are no types at the moment. By providing types directly, I hope to prevent duplicated effort in other codebases. It would be be an improvement in documentation and distribution by packaging the types next to the Javascript implementation.

phated commented 6 years ago

I prefer DefinitelyTyped

demurgos commented 6 years ago

Hi, I wrote type definitions for gulp-util previously and I am currently extracting and updating the parts relevant to plugin-error. I would really prefer to send the PR to this repo. Even if I already listed most of my arguments above, I would like to emphasis that DefinitelyTyped offers a very subpar experience to simply having the types with the repo, both from a user and maintainer point of view. Gulp plays really well with various transpilers and has good support for Typescript through ts-node, it would be nice to extend this good experience to core plugins.

I really admire all the work you put into Gulp and am very grateful. Still, could you explain your reason? I guess that it's simply that it feels as "yet another thing to maintain"? If so, I'd just note that this library is stable, there were no changes in 2 years so it should be enough to write the types once and then there's no risk of major API/types changes. Even if I personally like Typescript, I wouldn't push it on larger components such as gulp or vinyl because of the maintenance burden, but when an occasion arises to add types progressively to smaller components it may be a good thing to try it.

Following the gulp-util deprecation/gulp4-alpha.3 release, I am opening and fixing many gulp plugins. They often have some transitive dependencies that also need to be updated and each of them has their own repos/maintainers/code styles/tests so it's a very time-consuming task. This is good from a stability point of view, but having to additionally deal with DefintelyTyped just feels like some unneeded complications if you view types as documentation. It's "yet another thing to update" when there are already dozens of plugins to patch.

Could I at least send a PR?

phated commented 6 years ago

Sure :) sorry, on my phone right now.

phated commented 6 years ago

Also, thank you for all your help. It's very appreciated.