Skip to content

Updated Node.js dgram.send() signature with recent changes in Node.js API#25664

Merged
2 commits merged intoDefinitelyTyped:masterfrom
nebrius:nodejs-dgram-send
May 10, 2018
Merged

Updated Node.js dgram.send() signature with recent changes in Node.js API#25664
2 commits merged intoDefinitelyTyped:masterfrom
nebrius:nodejs-dgram-send

Conversation

@nebrius
Copy link
Copy Markdown
Contributor

@nebrius nebrius commented May 9, 2018

Please fill in this template.

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented May 10, 2018

@nebrius Thank you for submitting this PR!

🔔 @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @ajafff - 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.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels May 10, 2018
Comment thread types/node/v8/index.d.ts Outdated
export class Socket extends events.EventEmitter {
send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: Buffer | String | Uint8Array | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
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.

I think it should be string instead String here.
According to docs address is optional.

Comment thread types/node/v8/index.d.ts Outdated
send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: Buffer | String | Uint8Array | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: Buffer | String | Uint8Array | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
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.

docs tell If msg is an array, offset and length must not be specified. therefore I think | any[] should be removed here.

Copy link
Copy Markdown
Contributor

@Flarna Flarna left a comment

Choose a reason for hiding this comment

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

Please apply the change also to Node 10.

@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Awaiting reviewer feedback labels May 10, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

@nebrius 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 or comments. Thank you!

@nebrius
Copy link
Copy Markdown
Contributor Author

nebrius commented May 10, 2018

Please apply the change also to Node 10.

Whoops, my local branch was just barely out of date enough to not have the v10 docs yet, will fix. Everything else makes sense too.

@nebrius
Copy link
Copy Markdown
Contributor Author

nebrius commented May 10, 2018

@Flarna
Copy link
Copy Markdown
Contributor

Flarna commented May 10, 2018

@nebrius
Copy link
Copy Markdown
Contributor Author

nebrius commented May 10, 2018

Ohhhh, thanks, I didn't pick up that the root index.d.ts was the most recent version.

@nebrius nebrius force-pushed the nodejs-dgram-send branch from 83720f7 to 2168b3f Compare May 10, 2018 21:00
@nebrius
Copy link
Copy Markdown
Contributor Author

nebrius commented May 10, 2018

All comments should be addressed. Note: I also marked the address parameter optional to conform to the docs.

@typescript-bot typescript-bot added The Travis CI build failed Revision needed This PR needs code changes before it can be merged. labels May 10, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

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

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

@nebrius
Copy link
Copy Markdown
Contributor Author

nebrius commented May 10, 2018

Travis failure seems to be spurious?

screen shot 2018-05-10 at 14 28 42

@Flarna
Copy link
Copy Markdown
Contributor

Flarna commented May 10, 2018

I agree that CI failure is unrelated. I have seen this recently in #25597 where retrigger CI (by closing and reopening) "solved" this - even log showed the following (see https://api.travis-ci.org/v3/job/376465088/log.txt):

redux-form/v6 OK
The 'no-void-expression' rule threw an error in '/home/travis/build/DefinitelyTyped/DefinitelyTyped/types/redux-little-router/redux-little-router-tests.tsx':
RangeError: Maximum call stack size exceeded
    at isPossiblyReferencedInConditionalType (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34309:17)
    at /home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34328:146
    at Object.filter (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:1969:31)
    at getTypeFromConditionalTypeNode (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34328:92)
    at getTypeFromTypeNode (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34695:28)
    at getTemplateTypeFromMappedType (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:32020:52)
    at substituteIndexedMappedType (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34165:36)
    at getSimplifiedIndexedAccessType (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34157:28)
    at getSimplifiedType (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:34110:63)
    at isRelatedTo (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/typescript/lib/typescript.js:35594:30)

@Andy-MS Any hint regarding this spurious failures?

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Merge:Express and removed The Travis CI build failed labels May 10, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@ghost ghost merged commit 8cd6bba into DefinitelyTyped:master May 10, 2018
@ghost
Copy link
Copy Markdown

ghost commented May 10, 2018

I'll look into that soon -- need to improve the error message from "something went wrong"

KSXGitHub pushed a commit to KSXGitHub/DefinitelyTyped that referenced this pull request May 12, 2018
… API (DefinitelyTyped#25664)

* Updated “send” signature with recent changse

* Fixed some other issues with send() signature and added Node 10
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts). 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.

3 participants