-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
[node]: Base promisify signature on rest arguments and conditional types #49699
Conversation
@AlCalzone Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis 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": 49699,
"author": "AlCalzone",
"headCommitOid": "139c1679ecb5c2a475639582b7a312e4e7a1cde5",
"lastPushDate": "2021-01-15T23:24:04.000Z",
"lastActivityDate": "2021-04-02T09:04:01.000Z",
"maintainerBlessed": false,
"hasMergeConflict": true,
"isFirstContribution": false,
"tooManyFiles": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/base.d.ts",
"kind": "definition"
},
{
"path": "types/node/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/node/test/util.ts",
"kind": "test"
},
{
"path": "types/node/ts3.4/index.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.4/util.promisify.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.6/index.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.9/base.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.9/index.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.9/node-tests.ts",
"kind": "test"
},
{
"path": "types/node/ts3.9/tsconfig.json",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson)"
},
{
"path": "types/node/ts3.9/tslint.json",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-linter-tslintjson)"
},
{
"path": "types/node/util.d.ts",
"kind": "definition"
},
{
"path": "types/node/util.promisify.d.ts",
"kind": "definition"
}
],
"owners": [
"Microsoft",
"DefinitelyTyped",
"jkomyno",
"alvis",
"r3nya",
"btoueg",
"smac89",
"touffy",
"DeividasBakanas",
"eyqs",
"Hannes-Magnusson-CK",
"KSXGitHub",
"hoo29",
"kjin",
"ajafff",
"islishude",
"mwiktorczyk",
"mohsen1",
"n-e",
"galkin",
"parambirs",
"eps1lon",
"SimonSchick",
"ThomasdenH",
"WilcoBakker",
"wwwy3y3",
"samuela",
"kuehlein",
"bhongy",
"chyzwar",
"trivikr",
"nguymin4",
"yoursunny",
"qwelias",
"ExE-Boss",
"Ryan-Willpower",
"peterblazejewicz",
"addaleax",
"JasonHK",
"victorperin",
"ZYSzys"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "ExE-Boss",
"date": "2021-02-08T09:16:43.000Z",
"isMaintainer": false
},
{
"type": "stale",
"reviewer": "rbuckton",
"date": "2020-12-08T01:35:34.000Z",
"abbrOid": "54b22fd"
}
],
"ciResult": "fail",
"ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/139c1679ecb5c2a475639582b7a312e4e7a1cde5/checks?check_suite_id=1839569975"
} |
🔔 @microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @btoueg @BrunoScheufler @smac89 @Touffy @DeividasBakanas @eyqs @Flarna @Hannes-Magnusson-CK @KSXGitHub @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @n-e @galkin @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @j-oliveras @bhongy @chyzwar @trivikr @nguymin4 @yoursunny @qwelias @ExE-Boss @Ryan-Willpower @peterblazejewicz @addaleax @JasonHK @victorperin @ZYSzys — please review this PR in the next few days. Be sure to explicitly select |
@AlCalzone The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
@AlCalzone 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. If you disagree with the reviewer's comments, you can "dismiss" the review using GitHub's review UI. Thank you! |
That would be simpler, but wouldn't that just add another overload instead of replacing the existing ones? |
@ExE-Boss 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? |
You can do what’s being done with the |
@ExE-Boss I've tried what you suggested - hope it is correct this time. All the interdependencies between the different types-versions are confusing. I've also solved the problem that promisify returned |
// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6. | ||
// This is required to enable typing assert in ts3.7 without causing errors | ||
// Typically type modifications should be made in base.d.ts instead of here | ||
|
||
/// <reference path="base.d.ts" /> | ||
|
||
/// <reference path="../ts3.4/assert.d.ts" /> | ||
/// <reference path="../ts3.4/util.promisify.d.ts" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file and directory is probably unnecessary, since util.promisify.d.ts
doesn’t differ between ts3.4
and ts3.9
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to limit the signature to TS 4.0+ without it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the ts3.6 directory exists because TS 3.7 added some new features that are being used. This should be the same - new feature starting with TS 4.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the point @AlCalzone is trying to make here is that ts3.4/util.promisify.d.ts
isn't included in the set of referenced files (it is referenced by ts3.6/index.d.ts
but not by ts3.6/base.d.ts
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm not sure what to do here.
There are some existing definitions that should be active for TS >= 3.7 (thus the 3.6 directory).
Then there are the new promisify signatures which should be active for TS >= 4.0.
And there are the old promisify signatures which need to be available for all versions <= 3.9.
I got it to work the way it is now, but if this is not the correct way, I'm happy to change it.
Out of interest: Where would one report issues with the bot seemingly not being able to read a calendar? |
Hah, good old JavaScript with its 0-based monts 😏 |
@ankon I opened DefinitelyTyped/dt-mergebot#364 to fix the calendar bug you spotted, which is my fault. Sorry about that! |
@AlCalzone 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 12th (in a week) if the issues aren't addressed. |
Which issues though? This is waiting for a re-review. |
@rbuckton got time for a re-review? |
@AlCalzone 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! |
🤷🏻♂️ |
@AlCalzone 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 Apr 8th (in a week) if the issues aren't addressed. |
I don't care anymore. I was asked by a TS developer to raise this PR, yet I can't get anyone to review it and now I need to start from scratch because of the merge conflicts. Do what you want with it, I'll ignore this thread now. |
@AlCalzone 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 May 2nd (in a week) if the issues aren't addressed. |
@AlCalzone 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! |
@AlCalzone don't mean to annoy you with this ping but is there any chance I could assist in getting this re-opened and merged? This is the first time I've managed to find a working version of promisify with typescript. |
@OmgImAlexis if you like, you can try to put up an up-to-date PR with my changes. I'll gladly assist if there are any problems with my types, but I don't have the capacity to jump through these hoops again. |
Please fill in this template.
npm test <package to test>
.If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
. If for reason the any rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.I was asked to create this PR here based on the discussion in microsoft/TypeScript#41563 (comment)
@DanielRosenwasser mentioned that he isn't sure how to feel about the helper types - how to avoid leaking them into the global scope when the new type declarations are used?
I'm not sure if all the config changes are correct - lots of things to shuffle around just to add something for a newer TypeScript version.
And I'm not happy about is that the helper type
Promisify
is exposed as the return type - is there any way to resolve to the function signature it represents?