dgreene1 / react-accessible-treeview

A react component that implements the treeview pattern as described by the WAI-ARIA Authoring Practices.
https://dgreene1.github.io/react-accessible-treeview
MIT License
277 stars 37 forks source link

No Typescript types #23

Closed dgreene1 closed 2 years ago

dgreene1 commented 2 years ago

Hi @lissitz. I noticed that there are no typescript types for this library in DefinitelyTyped and the library itself does not export any type information.

I'm one of those people who loves converting JS libraries to TypeScript.

Would you be interested in either:

  1. A PR that provides types from within the library but keeps the library?
  2. Or, a PR that converts the library to Typescript?

Option 2 is significantly easier for me and is more accurate from consumers since it doesn't allow the type definitions to drift away from the runtime types since they would be derived from the same source.

lissitz commented 2 years ago

Hi @dgreene1, feel free to open a PR that rewrites the library in TypeScript. I'm open to PRs for fixes/improvements, although I'm not currently interested in further development of the library on my own time.

dgreene1 commented 2 years ago

Thank you for the info @lissitz. Just in case our company (who is doing major accessibility work) agrees to allocating people’s time, I want to check to see if you’d be willing to accept me being added as a maintainer so I can assist/control the publishing/releases so that a11y and security patches can be released in a timely manner?

You could keep the library in your namespace/org since that’s a pain. This would be just an offer to have a 2nd maintainer who might have budget during work hours (still waiting to hear back from our engineering budget people at the company).

lissitz commented 2 years ago

Yes, I'm open to eventually adding you as a maintainer 🙂.

dgreene1 commented 2 years ago

@lissitz our company has allocated funding for us to do the rewrite in the next couple of weeks. We have a question though: Do you want to preserve the runtime validation that prop-types was accomplishing? Or is the compile time validation of TypeScript enough?

It’s possible to have both, but removing runtime validation would decrease the bundle size and would remove the runtime lag that comes with checking the input.

If you say “both please” we will be using either https://github.com/gcanti/prop-types-ts or https://github.com/colinhacks/zod. I prefer zod since it has a smaller footprint than prop-types-ts. But my preference would be to use Typescript alone without any runtime validation.