-
Notifications
You must be signed in to change notification settings - Fork 30.5k
[node] Update typings to v22.2.0 #70193
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] Update typings to v22.2.0 #70193
Conversation
|
|
||
| const stream = Readable.from(generate()); | ||
| stream.on('data', (chunk) => { | ||
| t.assert.strictEqual(chunk, expected.shift()); |
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.
Assertions require every name in the call target to be declared with an explicit type annotation @definitelytyped/expect
Not sure how to fix this...
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.
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 seems unavoidable for any object method that returns an assertion, regardless of exactly how it's defined. To use these methods, any callback provided to test() would need to explicitly type the callback parameter to make the compiler happy.
test(t => { t.assert.strictEqual(true, true) }); // error
test((t: TestContext) => { t.assert.strictEqual(true, true) }); // okThe only alternative would be to duplicate the definition from node:assert but type the return as void instead of asserts ..., but that feels even less satisfactory.
Could perhaps just add this warning to the docblock.
8d75f12 to
c570928
Compare
c570928 to
7bdae22
Compare
|
@Semigradsky Thank you for submitting this PR! This is a live comment that 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. You can test the changes of this PR in the Playground. Status
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": 70193,
"author": "Semigradsky",
"headCommitOid": "805810c6dd55af6b46d654655d7d370a754f6d9c",
"mergeBaseOid": "9d73f7da7885cdc6c994988b274455af33bf9d97",
"lastPushDate": "2024-08-02T04:27:23.000Z",
"lastActivityDate": "2024-08-09T17:48:14.000Z",
"mergeOfferDate": "2024-08-09T16:47:34.000Z",
"mergeRequestDate": "2024-08-09T17:48:14.000Z",
"mergeRequestUser": "Semigradsky",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/node/perf_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/test.d.ts",
"kind": "definition"
},
{
"path": "types/node/test/fs.ts",
"kind": "test"
},
{
"path": "types/node/test/perf_hooks.ts",
"kind": "test"
},
{
"path": "types/node/test/test.ts",
"kind": "test"
},
{
"path": "types/node/test/zlib.ts",
"kind": "test"
},
{
"path": "types/node/v16/perf_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/v16/test/perf_hooks.ts",
"kind": "test"
},
{
"path": "types/node/v18/perf_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/test/perf_hooks.ts",
"kind": "test"
},
{
"path": "types/node/v20/perf_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/v20/test/perf_hooks.ts",
"kind": "test"
},
{
"path": "types/node/zlib.d.ts",
"kind": "definition"
}
],
"owners": [
"Microsoft",
"jkomyno",
"alvis",
"r3nya",
"btoueg",
"smac89",
"touffy",
"DeividasBakanas",
"eyqs",
"Hannes-Magnusson-CK",
"hoo29",
"kjin",
"ajafff",
"islishude",
"mwiktorczyk",
"mohsen1",
"galkin",
"parambirs",
"eps1lon",
"ThomasdenH",
"WilcoBakker",
"wwwy3y3",
"samuela",
"kuehlein",
"bhongy",
"chyzwar",
"trivikr",
"yoursunny",
"qwelias",
"ExE-Boss",
"peterblazejewicz",
"addaleax",
"victorperin",
"ZYSzys",
"NodeJS",
"LinusU",
"wafuwafu13",
"mcollina",
"Semigradsky"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "jakebailey",
"date": "2024-08-09T16:46:58.000Z",
"isMaintainer": true
},
{
"type": "stale",
"reviewer": "Renegade334",
"date": "2024-08-04T22:22:35.000Z",
"abbrOid": "ad94daa"
}
],
"mainBotCommentID": 2266152197,
"ciResult": "pass"
} |
|
🔔 @microsoft @jkomyno @alvis @r3nya @btoueg @smac89 @Touffy @DeividasBakanas @eyqs @Hannes-Magnusson-CK @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @galkin @parambirs @eps1lon @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @bhongy @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @ZYSzys @nodejs @LinusU @wafuwafu13 @mcollina — please review this PR in the next few days. Be sure to explicitly select |
|
@Semigradsky 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
https://github.com/nodejs/node/releases/tag/v22.2.0 - fs: allow 'withFileTypes' to be used with globs - test_runner: support test plans - zlib: expose zlib.crc32() - perf_hooks: add deliveryType and responseStatus fields
7bdae22 to
f7c84f1
Compare
|
@Renegade334 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? |
| class PerformanceResourceTiming extends PerformanceEntry { | ||
| protected constructor(); |
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.
| class PerformanceResourceTiming extends PerformanceEntry { | |
| protected constructor(); | |
| class PerformanceResourceTiming extends PerformanceEntry { | |
| protected constructor(); | |
| readonly entryType: "resource"; |
The other PerformanceEntry subclasses narrow their entryType property, so may as well add this here, and to the existing PerformanceResourceTiming class definitions in v20/v22. ("resource" will need adding to the EntryType union as well.)
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.
Good catch! I also created nodejs/node#54212 because "resource" not documented currently.
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 have added two new entry types: 'resource' and 'net'.
|
@Renegade334 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? |
584c238 to
805810c
Compare
|
@jakebailey please take a look! I think it's ready. |
|
@Semigradsky: Everything looks good here. I am ready to merge this PR (at 805810c) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@microsoft, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @galkin, @parambirs, @eps1lon, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @ZYSzys, @nodejs, @LinusU, @wafuwafu13, @mcollina: you can do this too.) |
|
Ready to merge |
https://github.com/nodejs/node/releases/tag/v22.2.0