-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
What do you not like about DefinitelyTyped as a user and contributor? #44030
Comments
There is no REPL for Type Definition writingMaking a good .d.ts file is kinda of a unique skill, the many ways in which your types are consumed can mean it's hard to know ahead of time what the right setup for a .d.ts file looks like. It'd be good to have an environment where I could easily work with a set of projects that have different import options in order to test that the exports from my lib indeed work like expected. Tags: |
Link
|
More docs/guides on generating types for existing projectsMany authors of existing projects are afraid of the burden of having to maintain typescript types on top of what they already have to maintain. I don't think there is actually much of a burden anymore as you can quite easily generate type definitions from JSDoc of an existing project without migrating it to typescript. However IMO there's not enough official documentation on this, and not enough emphasis on it when introducing existing authors to typescript. This is what leads to them assuming it must be a huge job they won't have time for or a new skill they need to learn. There should be a push to make DT smaller by sharing the knowledge of how to generate types in source repos, basically. |
|
Update of
|
Issue and PR titles have too wide variety since there's no template for the issue titles.I'm not sure if GitHub allows issue/PR titles templates it, but having them unified would be nice. For example, On the other hand, above example might miss something like Tags: |
Make automatically generated types for Google APIs first-class citizens on DTI auto-generate types for Google APIs, and there's no way to properly sync them to DT. I used to create PRs from one account and approve them from another, using GitHub API (DefinitelyTyped/dt-mergebot#98). That was a beautiful piece of automation but was considered bad (DefinitelyTyped/DefinitelyTyped#49235). Now I publish generated types to npm (example) and reference them in the corresponding DT package (example). This still has a challenge of syncing new and obsolete APIs (Maxim-Mazurok/google-api-typings-generator#401) which currently is manual and results in huge PRs (DefinitelyTyped/DefinitelyTyped#52618). Also, it's bad for versioning (DT package version stays the same), but this can be managed through lock-file, so I guess it's fine. But could be better :) I have some ideas on how to solve this if anyone is interested. Please, find my contacts at https://maxim.mazurok.com Tags: |
Queue for PRsI know you mentioned that the boards are one but it's either bugged or I don't understand how it works. |
Solo owner package support to avoid backbenchingThere is a lot of folks and/or organization using DT power to publish content (both for the benefit of the community and, obviously, the published project). see @Maxim-Mazurok comment for one of those scenarios. There is a lot of those, say a single person working on TS types for interesting JS topics and publishing through DT or organization, that adopted JS, but maintain or publish .d.ts files through DT. Because those are large ('huuuge' in old american), usually non one helps those solo projects until eventually DT maintainer arrives. This impacts consumption of changes of those packages (DT package can be for a Google api or for well known UI projects, say open sourced IBM effort, NPM native code already published literally weeks ago). We could have Thx! Tags: |
Lack of maintainer assistance on critical packages / false negative CI checks from other packagesI usually have a good experience with the types I own. Create a PR, get someone to review, done! Nearly all my negative experience comes from the interaction around this PR. I tried to improve the It took 3 weeks to get a maintainer review, which I addressed within a day. In the following 6 months (!) I never got another review despite asking for it, but multiple pings from @typescript-bot because: As you may infer from my comments in the PR, I got frustrated and gave up on it (although I still think the change is good). In the end I'd hope for a bit more drive and team support behind the "core" typings. Tags: |
CLI tool to consume
|
Using GitHub’s discussions featureI feel like enabling GitHub’s Discussions feature would be beneficial, with this issue being a decent candidate for migration. Tags: |
Encourage contributors to send typedefs to library repo firstWhile plenty of library authors want little to do with TypeScript, even more simply don't know how to ship or maintain good TypeScript bindings. For the latter category, it would be much more useful if someone contributes a TS typedef to the core repo instead of to DefinitelyTyped. In a way, DefinitelyTyped is a bit of a cop-out, a plan B. A necessary plan B, but a plan B nevertheless. For example, I feel like it's weird that the How can I contribute guide appears to actively discourage communicating with the author of the open source package at hand. Or, well, not actively discourage, but it's simply not even presented as an option. Isn't that weird? Wouldn't the home repo be the best place for the typedefs to live? I think it should be a goal of DefinitelyTyped to one day not be necessary anymore. Sure, it'll never happen, because TS will never have 100% penetration, but it should be the direction. But right now, it's more like DefinitelyTyped is poised to be an ever-expanding mountain of half-maintained typedefs that continuously run the risk of lagging behind their JS packages. It's better than no typedefs, but way worse than what it should be. Therefore, I think the TS/DT teams could do more to help library authors and/or contributors ship types directly. Eg:
Tags: |
Notifications on minor/major releasesIt would be great if the DT bot would watch the npm index for minor/major releases of packages that have typings on DT and automatically notify the maintainers on updates. I don't really have a good idea on how to notify the maintainers, an obvious choice would be to create issue tickets but that would pollute the issue backlog even more. Maybe such automatically created tickets should be then closed automatically after some time if no one contributes and they should definitely be closed automatically after someone updates the typings in question. There should also be possibilities for typings packages maintainers to be able to close such tickets without making pull requests in cases the library updates don't introduce API changes (which happens quite often, major releases often are made when compatibility with older Node versions is broken, for example). Tags: |
|
Composing prettier configurationCompletely overlooked this huuuge (3xu) PITA: the DT disallows composing This would allow to compose:
/cc @fedemp @pkuczynski Tags: |
Hey folks - we had the meeting and here's our general notes and the list of outcomes at the bottom for TLDRing. I'll keep this issue open for a week or so and then close and lock it out 👍🏻 - thanks for the feedback! Improvements to DT Publishing
Improvements to DT Infra
DT Admins
Docs
Misc
Action Items
|
Hello, @orta, thank you for your feedback regarding "Make it possible for me to ship Google's types". There are ~200 packages/APIs right now, so it's potentially 200 PRs per week. And there's no guarantee that they'll be reviewed and merged within one week. Actually, there's a pretty solid chance that they'll be stuck there for months :) One hour cadence was chosen because these types are used with the front-end JS APIs that are only available in CDN-style, without version binding. People add Regarding security, I have branch protection rules in the repo, I have tests and linting set up as well. I have dependabot updating dependencies weekly (currently on pause because dependabot/dependabot-core#3132). So, my typings are more secure. Also, my users depend on https://apis.google.com/js/api.js, which can be a security issue if it gets hacked and the script is replaced with something malicious. One way they can mitigate this - is by manually copy-pasting content of this script to some local file, and doing review of the compiled JS code (something like this Maxim-Mazurok/gapi), which realistically no-one does and it's not recommended. I was hoping that generated types will become first-class citizens. |
Yeah, I know any dependency is a security risk but the point is that the potential contents of the npm package are different - someone cannot ship a preinstall script in an The point is that DT has a security model which allows people to trust arbitrary Realistically, I think you'd be better off talking to google and getting these types auto-generated and deployed on their own npm Given your response, I don't think there's a reasonable answer here that doesn't hammer DT's infra again, or mean these changes are waiting on a DT reviewer every week for multiple package changes on a weekly cadence. I thought we were going to be looking at a much smaller amount of changes from those types, but I think what we have today is the best in the set of trade-offs which still allows for them to exist on @types but also be as up-to-date as you want. So, basically how it is now is probably how it will stay. |
Yeah, I understand. Perhaps, we can create DT bot that would pull and re-publish another NPM package with stripped preinstall script? Or, this can be the responsibility of some enterprise NPM, such as ProGet.
Yes, that's definitely in the roadmap. I want to test it in the wild and add more tests before bothering folks at Google. By the way, if anyone knows someone at Google who might be interested - please, let them or me know (max@mazurok.com).
I don't know how VS Code extensions work, but one thing to keep in mind is that there's no NPM package to go with front-end Google APIs. It's not installed from NPM, so we can't ship types with the code. Code is shipped from CDN.
Yeah, all solutions that I can think of, require pretty big rework on the DT side, there's no easy fix here. One more potential solution is to create some sort of API or environment to run generation scripts or consume their results. Another option is to create a DT API endpoint, where I can send updated index.d.ts. I'll be still generating types on my side, and then send the result to DT API, which may or may not be automatically published to the repo, but definitely should be published to That's probably too much work for DT to support just one "package"... But perhaps, if automatic generation will be easier - more people will do it? In any case, I'll be happy to help with this.
Otherwise, I'm ok with leaving it as it is for now. |
What do you not like about DefinitelyTyped as a user and contributor?
Hey folks, we, the TypeScript team at Microsoft, are interested in understanding pain points for people using and contributing to DefinitelyTyped.
About this time last year, we drastically changed the workflow for contributors to DefinitelyTyped (one of the most active repos on GitHub) to allow for self-serving Pull Requests. Since then, we've been refining that process and improving the automation to cover more cases and consolidated all of the DefinitelyTyped tooling into one monorepo and re-vamped the search. Now that these systems have matured, we're thinking about what the right things to look at next, and would love input from the folks who are writing definitions daily.
I've explicitly given an opening for users of
@types
to provide feedback here too, given that it's quite likely any requests as a user of DT will affect contributors too.We've used a format for this before which worked well in #31983 which is for people to reply to this issue with a single idea per comment.
We've got a meeting booked on the 20th to go through feedback and see what's we can do 👍🏻
Please do: reply with 1 comment per issue. Add tags if you'd like to help with search for others and ease-of classification. If you have a link to an existing issue, that would be super useful too.
If you see that someone has already pitched your idea, please use the emoji reactions to +1 it, we will be deleting duplicates and off-topic replies. If you want to add more to a topic, see if it has an attached issue and leave more feedback there. If there isn't, come chat in the DefinitelyTyped chatroom in the TypeScript Community Discord.
Please do not use this thread for discussions about the TypeScript language itself, and as with all issues please conform to the code of conduct. We all want to see improvements.
Template - feel free to copy & paste
For example
One of mine:
There is no REPL for Type Definitions
I would like to use the Playground to work with .d.ts files to be able to share problems with others
Tags:
playground
The text was updated successfully, but these errors were encountered: