Skip to content

Conversation

@Semigradsky
Copy link
Contributor

@Semigradsky Semigradsky commented Aug 2, 2024

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

@Semigradsky Semigradsky changed the title [node] Update typings to v22.1.0 [node] Update typings to v22.2.0 Aug 2, 2024

const stream = Readable.from(generate());
stream.on('data', (chunk) => {
t.assert.strictEqual(chunk, expected.shift());
Copy link
Contributor Author

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

microsoft/TypeScript#36931

Not sure how to fix this...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @G-Rath! I see that you added assertion guards in assert module (#42786), maybe you can help with this.

Copy link
Contributor

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) }); // ok

The 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.

@Semigradsky Semigradsky marked this pull request as ready for review August 2, 2024 21:13
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 2, 2024

@Semigradsky Thank you for submitting this PR!

This is a live comment that 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": 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"
}

@typescript-bot typescript-bot added Critical package Author is Owner The author of this PR is a listed owner of the package. labels Aug 2, 2024
@typescript-bot
Copy link
Contributor

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Aug 2, 2024
@typescript-bot
Copy link
Contributor

@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
@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Aug 4, 2024
@typescript-bot
Copy link
Contributor

@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?

Comment on lines 481 to 482
class PerformanceResourceTiming extends PerformanceEntry {
protected constructor();
Copy link
Contributor

@Renegade334 Renegade334 Aug 4, 2024

Choose a reason for hiding this comment

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

Suggested change
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.)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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'.

@typescript-bot
Copy link
Contributor

@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?

@Semigradsky
Copy link
Contributor Author

@jakebailey please take a look! I think it's ready.

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Aug 9, 2024
@typescript-bot
Copy link
Contributor

@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:

Ready to merge

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.)

@Semigradsky
Copy link
Contributor Author

Ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. Critical package Maintainer Approved 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.

4 participants