Skip to content

Update ws types to allow custom properties on this argument#58555

Closed
lavalleeale wants to merge 4 commits intoDefinitelyTyped:masterfrom
lavalleeale-forks:master
Closed

Update ws types to allow custom properties on this argument#58555
lavalleeale wants to merge 4 commits intoDefinitelyTyped:masterfrom
lavalleeale-forks:master

Conversation

@lavalleeale
Copy link
Copy Markdown
Contributor

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

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

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Feb 1, 2022

@lavalleeale Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

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

Status

  • ❌ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by type definition owners or DT maintainers

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": 58555,
  "author": "lavalleeale",
  "headCommitOid": "0a2be70b8282ad1af55f37880a1766d211269833",
  "mergeBaseOid": "66c5413f51d87a490a5e91944927076de67a0548",
  "lastPushDate": "2022-02-01T23:55:57.000Z",
  "lastActivityDate": "2022-02-16T19:35:34.000Z",
  "maintainerBlessed": "Waiting for Code Reviews",
  "hasMergeConflict": true,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "ws",
      "kind": "edit",
      "files": [
        {
          "path": "types/ws/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ws/ws-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "loyd",
        "mlamp",
        "TitaneBoy",
        "reduckted",
        "teidesu",
        "wojtkowiak",
        "k-yle"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1027400526,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @loyd @mlamp @TitaneBoy @reduckted @teidesu @wojtkowiak @k-yle — 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.

@typescript-bot
Copy link
Copy Markdown
Contributor

@lavalleeale The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Feb 1, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

Re-ping @loyd, @mlamp, @TitaneBoy, @reduckted, @teidesu, @wojtkowiak, @k-yle:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Feb 13, 2022
@lavalleeale
Copy link
Copy Markdown
Contributor Author

I think this should be closed in favor of #58772, unless people like this approach better?

@k-yle
Copy link
Copy Markdown
Contributor

k-yle commented Feb 15, 2022

I think this should be closed in favor of #58772, unless people like this approach better?

My understanding is that #58753 and #58772 together achieve the same thing as this PR, except that they don't rely on using this.

Let's continue the discssion in #58753

@vansergen
Copy link
Copy Markdown
Contributor

I think this should be closed in favor of #58772, unless people like this approach better?

Agree. The main goal of #58772 is to cover the websockets/ws#2007 PR. The #58753 PR covers the basic usage

const ws = new WebSocket("ws://www.host.com/path");
ws.id; // want to access `id` here

But to do that one requires to declare it

declare module "ws" {
  interface WebSocket {
    id?: string;
  }
}

One can achieve the same result with classes though (not a good way but it is a way)

import { WebSocket } from "ws";
class CustomWebSocket extends WebSocket {
  id?: number;
}
const ws = new CustomWebSocket("ws://localhost:8080");
ws.id; // have an access here

I would prefer the #58772 approach (using generics).

@typescript-bot typescript-bot added Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Feb 19, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@lavalleeale 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 typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Mar 12, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@lavalleeale 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 Mar 18th (in a week) if the issues aren't addressed.

@typescript-bot
Copy link
Copy Markdown
Contributor

@lavalleeale 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 Critical package Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants