Skip to content
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

fix: drop incorrect types for webtorrent org packages #70064

Closed
wants to merge 1 commit into from

Conversation

ThaUnknown
Copy link
Contributor

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

These types for webtorrent's packages have been outdated for ages, and for the most part aren't needed because we use JSDoc where it's important.

These types are causing an insane amt of issues for us, both for development, and for maintaining, since VSCode incorrectly inherits DT's types, and people keep making issues complaining that a function works incorrectly, because these types are wrong and are telling them incorrect things.

#69947

@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 16, 2024

@ThaUnknown Thank you for submitting this PR!

This is a live comment that I will keep updated.

This PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this?

4 packages in this PR (and infra files)

Code Reviews

Because this PR edits multiple packages, it can be merged once it's reviewed by a DT maintainer.

You can test the changes of this PR in the Playground.

Status

  • ❌ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 A DT maintainer needs to approve changes that affect DT infrastructure (notNeededPackages.json)

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This PR has been inactive for 31 days — it is considered abandoned, and therefore closed!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 70064,
  "author": "ThaUnknown",
  "headCommitOid": "138483507c2f200b2d849c6a5fdfd767a79c6f2c",
  "mergeBaseOid": "b4ae44884a5a4a56d6059d81f1567d3f6983dbe8",
  "lastPushDate": "2024-07-16T08:30:58.000Z",
  "lastActivityDate": "2024-11-20T03:44:11.000Z",
  "hasMergeConflict": true,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": null,
      "kind": "edit",
      "files": [
        {
          "path": "notNeededPackages.json",
          "kind": "infrastructure"
        }
      ],
      "owners": [],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical",
      "isSafeInfrastructureEdit": false
    },
    {
      "name": "bittorrent-protocol",
      "kind": "delete",
      "files": [
        {
          "path": "types/bittorrent-protocol/.eslintrc.json",
          "kind": "package-meta",
          "suspect": "edited"
        },
        {
          "path": "types/bittorrent-protocol/.npmignore",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/bittorrent-protocol/bittorrent-protocol-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/bittorrent-protocol/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/bittorrent-protocol/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/bittorrent-protocol/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "feross",
        "tlaziuk",
        "h1b9b"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "create-torrent",
      "kind": "delete",
      "files": [
        {
          "path": "types/create-torrent/.npmignore",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/create-torrent/create-torrent-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/create-torrent/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/create-torrent/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/create-torrent/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "jesec"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "parse-torrent",
      "kind": "delete",
      "files": [
        {
          "path": "types/parse-torrent/.npmignore",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/parse-torrent/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/parse-torrent/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/parse-torrent/parse-torrent-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/parse-torrent/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "niieani",
        "tlaziuk"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "webtorrent",
      "kind": "delete",
      "files": [
        {
          "path": "types/webtorrent/.npmignore",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/webtorrent/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/webtorrent/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/webtorrent/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/webtorrent/webtorrent-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "niieani",
        "tlaziuk",
        "gjuchault",
        "cheeseandcereal"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "changereq",
      "reviewer": "jesec",
      "date": "2024-10-20T08:55:04.000Z"
    },
    {
      "type": "changereq",
      "reviewer": "jakebailey",
      "date": "2024-07-16T16:02:48.000Z"
    }
  ],
  "mainBotCommentID": 2230325063,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

🔔 @feross @tlaziuk @h1b9b @jesec @niieani @gjuchault @cheeseandcereal — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These packages do not contain types; this is definitely not the right fix: #69947 (comment)

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Jul 16, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@ThaUnknown
Copy link
Contributor Author

ThaUnknown commented Jul 16, 2024

@jakebailey what is the correct way of proceeding then, that doesn't require me to waste weeks of my free time?

  • making DT types accurate is unrealistic because of the sheer amt of work it requires
  • overriding these invalid types in our package with any breaks type inference and intellisense
  • generating from JSDoc leads to similarly incorrect types as tsc isn't omnipotent and can't detect dynamic key access and probably other things

I'd preferably want to not have types from DT apply after specific versions:

since thats roughly where the old types are still accurate enough, and simply let the already defined jsdoc in the package and type inference take over, but I don't know if typescript even allows that

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Aug 8, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Aug 15th (in a week) if the issues aren't addressed.

@ThaUnknown
Copy link
Contributor Author

bump

@typescript-bot typescript-bot removed the Abandoned This PR had no activity for a long time, and is considered abandoned label Aug 8, 2024
@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Sep 1, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Sep 7th (in a week) if the issues aren't addressed.

@ThaUnknown
Copy link
Contributor Author

bump

@typescript-bot typescript-bot removed the Abandoned This PR had no activity for a long time, and is considered abandoned label Sep 1, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Oct 1st (in a week) if the issues aren't addressed.

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Sep 24, 2024
@ThaUnknown
Copy link
Contributor Author

bump

@typescript-bot typescript-bot removed the Abandoned This PR had no activity for a long time, and is considered abandoned label Sep 24, 2024
@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Oct 17, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Oct 24th (in a week) if the issues aren't addressed.

@ThaUnknown
Copy link
Contributor Author

bump

@typescript-bot typescript-bot removed the Abandoned This PR had no activity for a long time, and is considered abandoned label Oct 17, 2024
Copy link
Contributor

@jesec jesec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reject.

The same set of changes has been reverted in #70059.

Also +1 on #69947 (comment) , #69947 (comment) .

Please reply to those comments and avoid spamming new pull requests and trying to force it through without additional merit.

@ThaUnknown
Copy link
Contributor Author

lord this is by far the most annoying repository i've ever experienced, package provides jsdoc where it's applicable, and all these people whining that there are no types, aren't fixing the types, WHICH ARE COMPLETLY INCORRECT, I do NOT understand how some1 can merge broken and incorrect types, and then the repository maintainers can't remove them, even tho they are malicious, anyways since i'm the package maintainer so since this repo is so against me being able to remove the incorrect types, i'll just force resolve it to any

@ThaUnknown
Copy link
Contributor Author

also @jesec those comments were replied to, so idk what you're saying

@jakebailey
Copy link
Member

I'm really not sure what to do here at this point. It's just a fact that for TypeScript users to use a library, that library needs .d.ts files. They have to live here or in your packages.

You don't seem to want to maintain types in your packages, so for TS users to use your packages, the types must be here. But you don't want the types that are here because they're out of date. Deleting them will break all TS users, but sort of improve things for JS users because tsserver does a limited analysis of JS code in node_modules for untyped libraries.

"Removing" can only be one of two things:

  • Delete the packages from DT, let the old ones live on npm as-is. You don't want this option because you don't like the types that are here.
  • Mark the packages as notNeeded. This basically means DT will never hold types for these packages again, and the only way any TS user will ever be able to use your library again will be for you to update your package.

There are no other options. Packages cannot be unpublished.

Which one of these is the right option?

Maybe the solution really is just for DT to wipe our hands of these packages and you just declare everything as any over in your repo. I don't like this option because it removes any ability for third parties to improve things, but it is your package.

I see you sent webtorrent/webtorrent#2876, if this is the direction you want to take, then that's totally up to you. You can just do this to all of your packages, publish them with a d.ts files, and we'll merge this PR with updated version numbers.

@ThaUnknown
Copy link
Contributor Author

ThaUnknown commented Oct 21, 2024

yes, that PR was created because DT tied my hands, it wouldn't exist if I could simply control the types over the packages I maintain, the fact that package maintainers don't have permissions to their own types is a bit wild to me

to me marking the packages as not needed is the best way to do it, but DT clearly doesn't agree until I have my own types, which is why that PR exists, I'd rather not merge it, because it then also breaks JS on top of breaking TS, which is even worse, but its better than having completely incorrect and absurd types

@jakebailey
Copy link
Member

it wouldn't exist if I could simply control the types over the packages I maintain, the fact that package maintainers don't have permissions to their own types is a bit wild to me

What you you mean? You can totally be an owner on the DT packages and send PRs to DT.

@ThaUnknown
Copy link
Contributor Author

ThaUnknown commented Oct 21, 2024

it wouldn't exist if I could simply control the types over the packages I maintain, the fact that package maintainers don't have permissions to their own types is a bit wild to me

What you you mean? You can totally be an owner on the DT packages and send PRs to DT.

clearly not, because I cannot remove these incorrect types, instead i need to jump 14 hoops, while being spammed by issues of "hey this function isnt working according to the outdated type documentation"

@jakebailey
Copy link
Member

jakebailey commented Oct 21, 2024

Removing the types and breaking all TS users is a totally different scenario to just updating the types so that they're correct. Adding/removing packages from DT is something that has to be monitored.

There are a non-zero number of packages which are on DT and have types updated by their maintainers or community members; if you sent a PR that updated the types here, it would absolutely be reviewed and accepted.

DT is supposed to be wikipedia for types, but even wikipedia doesn't just let anyone delete pages.

@ThaUnknown
Copy link
Contributor Author

yes, but wikipedia moderates incorrect entries, this doesnt, maybe by breaking it for users which auto-update all packages instead of locking versions, some1 will spent the month or so of their life creating these types

@jakebailey
Copy link
Member

The options here are:

  • You put .d.ts files (of any quality, I don't care!) into your packages making them typed, we merge this PR after those are published so your packages are pointed to in the deprecated shims in @types on npm. Your users (TS and JS users both) file issues about the quality / accuracy of your types to your repo and you fix them (or don't).
  • You update the types here to be accurate. TS and JS users are happy.
  • You don't personally update the types here, but point anyone on your repo to the DT repo to make contributions to fix this, and close their issues as not your problem.

Which of these do you want to do to resolve the problem?

I do not see any other option. We simply cannot merge this PR as-is without other d.ts files present as that will make your packages unimportable in any TypeScript file.

@typescript-bot typescript-bot added the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label Oct 24, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown Unfortunately, this pull request currently has a merge conflict 😥. Please update your PR branch to be up-to-date with respect to master. Have a nice day!

@typescript-bot
Copy link
Contributor

@ThaUnknown I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Nov 20th (in a week) if the issues aren't addressed.

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Nov 14, 2024
@jakebailey
Copy link
Member

I'll re-up this one more time; I'm really wanting to get this handled, but we really need to know which of the previously noted options will work best.

@typescript-bot typescript-bot removed the Abandoned This PR had no activity for a long time, and is considered abandoned label Nov 20, 2024
@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Dec 13, 2024
@typescript-bot
Copy link
Contributor

@ThaUnknown I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Dec 20th (in a week) if the issues aren't addressed.

@typescript-bot
Copy link
Contributor

@ThaUnknown To keep things tidy, we have to close PRs that aren't mergeable and don't have activity in the last month. No worries, though — please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned This PR had no activity for a long time, and is considered abandoned Check Config Changes a module config files Edits Infrastructure Edits multiple packages Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. Revision needed This PR needs code changes before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants