Skip to content

Conversation

@Semigradsky
Copy link
Contributor

In @types/node we have ts4.8 folder for typings specific to TypeScript <= 4.8. The big problem is that contributors really often forget to add the same changes to this folder too. Here I try to decrease it as much as possible.

I revised ts4.8 content and see that the only difference is return type for randomUUID function in node:crypto:

- string;
+ type UUID = `${string}-${string}-${string}-${string}-${string}`;

In main crypto.d.ts we use UUID - typescript literal type from TS v4.1 - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types
Current support TS versions by support window >= 4.5, so looks like removing ts4.8 folder is safe.

Perhaps in ts4.8 version we had some other differences, but they are lost. 🤔

@Semigradsky Semigradsky force-pushed the node-rework-ts4.8 branch 2 times, most recently from adf21ad to 9d804f9 Compare September 8, 2023 22:24
@Semigradsky Semigradsky marked this pull request as ready for review September 8, 2023 23:30
@typescript-bot
Copy link
Contributor

typescript-bot commented Sep 8, 2023

@Semigradsky Thank you for submitting this PR!

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
  • 🕐 A DT maintainer needs to approve changes which affect module config files

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 66640,
  "author": "Semigradsky",
  "headCommitOid": "1de0e62e5be74dcae4ef6d37d7912aecd057d8ef",
  "mergeBaseOid": "b5ea679f8d6805d4617f0dad069587d57e8a08e0",
  "lastPushDate": "2023-09-08T11:43:35.000Z",
  "lastActivityDate": "2023-09-15T22:55:25.000Z",
  "hasMergeConflict": true,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": true,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/scripts/new-version/new-version.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/assert.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/assert/strict.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/async_hooks.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/buffer.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/child_process.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/cluster.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/console.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/constants.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/crypto.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/dgram.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/diagnostics_channel.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/dns.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/dns/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/dom-events.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/domain.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/events.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/fs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/globals.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/globals.global.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/http.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/http2.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/https.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/inspector.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/module.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/net.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/node-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/os.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/path.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/perf_hooks.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/process.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/punycode.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/querystring.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/readline.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/readline/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/repl.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/.gitignore",
          "kind": "package-meta",
          "suspect": "edited"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/README.md",
          "kind": "markdown"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/ast-processing.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/ast-utils.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/docs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/html-doc-processing.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/node-doc-processing.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-docs/utils.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/README.md",
          "kind": "markdown"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/devtools-protocol-schema.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/event-emitter.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/generate-substitute-args.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/index.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/inspector.d.ts.template",
          "kind": "package-meta",
          "suspect": "edited"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/scripts/generate-inspector/utils.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/new-version/new-version.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/scripts/new-version/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/scripts/new-version/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/stream.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/stream/consumers.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/stream/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/stream/web.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/string_decoder.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/test.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/test/assert.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/async_hooks.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/buffer.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/child_process.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/cluster.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/console.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/constants.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/crypto.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/dgram.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/diagnostics_channel.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/dns.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/dom-events.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/events.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/fs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/globals.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/http.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/http2.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/https.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/inspector.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/module.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/net.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/os.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/path.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/perf_hooks.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/process.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/querystring.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/readline.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/repl.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/stream.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/string_decoder.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/test.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/timers.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/timers_promises.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/tls.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/trace_events.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/tty.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/url.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/util.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/util_types.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/v8.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/vm.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/wasi.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/worker_threads.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/test/zlib.ts",
          "kind": "test"
        },
        {
          "path": "types/node/ts4.8/timers.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/timers/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/tls.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/trace_events.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/tslint.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/node/ts4.8/tty.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/url.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/util.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/v8.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/vm.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/wasi.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/worker_threads.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/zlib.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Microsoft",
        "DefinitelyTyped",
        "jkomyno",
        "alvis",
        "r3nya",
        "btoueg",
        "smac89",
        "touffy",
        "DeividasBakanas",
        "eyqs",
        "Hannes-Magnusson-CK",
        "hoo29",
        "kjin",
        "ajafff",
        "islishude",
        "mwiktorczyk",
        "mohsen1",
        "n-e",
        "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": [],
  "mainBotCommentID": 1712333541,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Critical package Author is Owner The author of this PR is a listed owner of the package. Check Config Changes a module config files Huge Change labels Sep 8, 2023
@typescript-bot
Copy link
Contributor

@Semigradsky
Copy link
Contributor Author

I propose removing ts4.8 for node v20 and leaving it for previous versions.

@Semigradsky
Copy link
Contributor Author

@sandersn I see that you added ts4.8 folder (#62375), wdyt?

@peterblazejewicz
Copy link
Member

IMO There was a (now narrowing) split between browsers/Node APIs and how those features could be effectively implemented. I think removing the 'version' folder in Node TS support is not a safe approach, I'd mark it as 'let it to disappear' (do not actively maintain). Maintainers can agree on this.
So IMO this comment sounds aligned:

I propose removing ts4.8 for node v20 and leaving it for previous versions.

@sandersn
Copy link
Contributor

My memory is that the ts4.8 version was kept around to test node in two different environments: node-only and node+dom (or maybe some other pair?). Are there diffs in the test .ts files? If my memory is correct, I would expect 0 diffs in the .d.ts files, which actually ship.

Whether maintaining and shipping two identical copies is worth the increased test coverage, I'm not sure.

I can't find the original reasoning for this, though. I'll try to find it.

@typescript-bot typescript-bot added the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label Sep 15, 2023
@typescript-bot
Copy link
Contributor

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

@sandersn
Copy link
Contributor

Here it is: #62782

@Semigradsky Semigradsky marked this pull request as draft September 18, 2023 06:34
@jakebailey
Copy link
Member

Old PR at this point, but I'm working on making dtslint support multiple tsconfigs; #68908 is where I'm updating the code and dropping these. Will likely close this PR once that's finalized.

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. Check Config Changes a module config files Critical package Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. Huge Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants