Skip to content

feat(ws): Add support for custom WebSocket#58772

Merged
typescript-bot merged 13 commits intoDefinitelyTyped:masterfrom
mglyzin:custom_ws
Feb 24, 2022
Merged

feat(ws): Add support for custom WebSocket#58772
typescript-bot merged 13 commits intoDefinitelyTyped:masterfrom
mglyzin:custom_ws

Conversation

@mglyzin
Copy link
Copy Markdown
Contributor

@mglyzin mglyzin commented Feb 14, 2022

Ability to extend the original WebSocket class

This patch add type definitions for custom WebSocket class.
This feature was merged in the original library at websockets/ws#2007

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Feb 14, 2022

@mglyzin Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

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 a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 58772,
  "author": "mglyzin",
  "headCommitOid": "cccf5155aa3d61140291ecff2638e403739908c3",
  "mergeBaseOid": "45437334b53ce6497e12eaef0ed98a31024101cc",
  "lastPushDate": "2022-02-23T21:30:22.000Z",
  "lastActivityDate": "2022-02-24T21:35:43.000Z",
  "mergeOfferDate": "2022-02-24T21:27:41.000Z",
  "mergeRequestDate": "2022-02-24T21:35:43.000Z",
  "mergeRequestUser": "k-yle",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "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",
        "cwadrupldijjit"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "k-yle",
      "date": "2022-02-24T21:30:27.000Z",
      "isMaintainer": false
    },
    {
      "type": "approved",
      "reviewer": "jakebailey",
      "date": "2022-02-24T21:27:03.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "vansergen",
      "date": "2022-02-24T07:07:19.000Z",
      "isMaintainer": false
    },
    {
      "type": "approved",
      "reviewer": "jlalmes",
      "date": "2022-02-23T22:24:43.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1039195200,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Feb 14, 2022

🔔 @loyd @mlamp @TitaneBoy @reduckted @teidesu @wojtkowiak @k-yle @cwadrupldijjit — 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 typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Feb 17, 2022
ws;
// $ExpectType "foo"
ws.foo();
});
Copy link
Copy Markdown
Contributor

@vansergen vansergen Feb 17, 2022

Choose a reason for hiding this comment

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

Suggested change
});
});
webSocketServer.clients.forEach((ws) => {
// $ExpectType CustomWebSocket
ws;
// $ExpectType "foo"
ws.foo();
});

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed Other Approved This PR was reviewed and signed-off by a community member. labels Feb 17, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@mglyzin 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 added The CI failed When GH Actions fails and removed The CI failed When GH Actions fails labels Feb 17, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@mglyzin 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.

ws.foo();
});
webSocketServer.clients.forEach((ws) => {
Array.from(webSocketServer.clients).forEach((ws) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for future reference:

ERROR: 332:1   expect                     TypeScript@4.6: Can not match a node to this assertion.
ERROR: 334:1   expect                     TypeScript@4.6: Can not match a node to this assertion.

Comment on lines 331 to 335
off(event: "connection", cb: (this: Server, socket: T, request: IncomingMessage) => void): this;
off(event: "error", cb: (this: Server, error: Error) => void): this;
off(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this;
off(event: "close" | "listening", cb: (this: Server) => void): this;
off(event: string | symbol, listener: (this: Server, ...args: any[]) => void): this;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
off(event: "connection", cb: (this: Server, socket: T, request: IncomingMessage) => void): this;
off(event: "error", cb: (this: Server, error: Error) => void): this;
off(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this;
off(event: "close" | "listening", cb: (this: Server) => void): this;
off(event: string | symbol, listener: (this: Server, ...args: any[]) => void): this;
off(event: "connection", cb: (this: Server<T>, socket: T, request: IncomingMessage) => void): this;
off(event: "error", cb: (this: Server<T>, error: Error) => void): this;
off(event: "headers", cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void): this;
off(event: "close" | "listening", cb: (this: Server<T>) => void): this;
off(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;

Comment on lines 325 to 329
once(event: "connection", cb: (this: Server, socket: T, request: IncomingMessage) => void): this;
once(event: "error", cb: (this: Server, error: Error) => void): this;
once(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this;
once(event: "close" | "listening", cb: (this: Server) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
once(event: "connection", cb: (this: Server, socket: T, request: IncomingMessage) => void): this;
once(event: "error", cb: (this: Server, error: Error) => void): this;
once(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this;
once(event: "close" | "listening", cb: (this: Server) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: "connection", cb: (this: Server<T>, socket: T, request: IncomingMessage) => void): this;
once(event: "error", cb: (this: Server<T>, error: Error) => void): this;
once(event: "headers", cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void): this;
once(event: "close" | "listening", cb: (this: Server<T>) => void): this;
once(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;

Comment on lines 320 to 323
on(event: "error", cb: (this: Server, error: Error) => void): this;
on(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this;
on(event: "close" | "listening", cb: (this: Server) => void): this;
on(event: string | symbol, listener: (this: Server, ...args: any[]) => void): this;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
on(event: "error", cb: (this: Server, error: Error) => void): this;
on(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this;
on(event: "close" | "listening", cb: (this: Server) => void): this;
on(event: string | symbol, listener: (this: Server, ...args: any[]) => void): this;
on(event: "error", cb: (this: Server<T>, error: Error) => void): this;
on(event: "headers", cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void): this;
on(event: "close" | "listening", cb: (this: Server<T>) => void): this;
on(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;

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

@vansergen, @jlalmes Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Feb 18, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@jlalmes Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

Co-authored-by: Sergey Bakulin <sergey.bakulin.github@gmail.com>
@typescript-bot typescript-bot removed the Other Approved This PR was reviewed and signed-off by a community member. label Feb 18, 2022
@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Owner Approved A listed owner of this package signed off on the pull request. labels Feb 23, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@mglyzin 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!

@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Feb 23, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@vansergen, @k-yle, @jakebailey, @jlalmes Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Feb 23, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@mglyzin 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!

Co-authored-by: Sergey Bakulin <sergey.bakulin.github@gmail.com>
@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Feb 23, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@vansergen, @k-yle, @jakebailey Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Feb 23, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@k-yle, @jakebailey Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@mglyzin
Copy link
Copy Markdown
Contributor Author

mglyzin commented Feb 24, 2022

What's going on with this merge request? When it will be merged?

@jakebailey
Copy link
Copy Markdown
Member

I was waiting to see if you'd address @vansergen's outstanding comments, but they approved the PR so I'll do so as well.

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Feb 24, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@mglyzin: Everything looks good here. I am ready to merge this PR (at cccf515) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@loyd, @mlamp, @TitaneBoy, @reduckted, @teidesu, @wojtkowiak, @k-yle, @cwadrupldijjit: you can do this too.)

@typescript-bot
Copy link
Copy Markdown
Contributor

@k-yle Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Feb 24, 2022
@jakebailey
Copy link
Copy Markdown
Member

Very weird that the bot re-pinged when nothing changed and it had already pinged. Oh well...

@k-yle
Copy link
Copy Markdown
Contributor

k-yle commented Feb 24, 2022

Ready to merge

@typescript-bot typescript-bot merged commit 7b5c273 into DefinitelyTyped:master Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Maintainer Approved Other Approved This PR was reviewed and signed-off by a community member. Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants