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] Add node:
‑prefixed module aliases
#51107
[node] Add node:
‑prefixed module aliases
#51107
Conversation
@ExE-Boss 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
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": 51107,
"author": "ExE-Boss",
"headCommitOid": "a70c7573e100376db55762025065ec3b3af16690",
"lastPushDate": "2021-02-07T14:47:40.000Z",
"lastActivityDate": "2021-02-12T09:08:13.000Z",
"maintainerBlessed": false,
"mergeOfferDate": "2021-02-11T20:05:32.000Z",
"mergeRequestDate": "2021-02-12T09:07:52.000Z",
"mergeRequestUser": "ExE-Boss",
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/assert.d.ts",
"kind": "definition"
},
{
"path": "types/node/async_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/buffer.d.ts",
"kind": "definition"
},
{
"path": "types/node/child_process.d.ts",
"kind": "definition"
},
{
"path": "types/node/cluster.d.ts",
"kind": "definition"
},
{
"path": "types/node/console.d.ts",
"kind": "definition"
},
{
"path": "types/node/constants.d.ts",
"kind": "definition"
},
{
"path": "types/node/crypto.d.ts",
"kind": "definition"
},
{
"path": "types/node/dgram.d.ts",
"kind": "definition"
},
{
"path": "types/node/dns.d.ts",
"kind": "definition"
},
{
"path": "types/node/domain.d.ts",
"kind": "definition"
},
{
"path": "types/node/events.d.ts",
"kind": "definition"
},
{
"path": "types/node/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/http.d.ts",
"kind": "definition"
},
{
"path": "types/node/http2.d.ts",
"kind": "definition"
},
{
"path": "types/node/https.d.ts",
"kind": "definition"
},
{
"path": "types/node/inspector.d.ts",
"kind": "definition"
},
{
"path": "types/node/module.d.ts",
"kind": "definition"
},
{
"path": "types/node/net.d.ts",
"kind": "definition"
},
{
"path": "types/node/node-tests.ts",
"kind": "test"
},
{
"path": "types/node/os.d.ts",
"kind": "definition"
},
{
"path": "types/node/path.d.ts",
"kind": "definition"
},
{
"path": "types/node/perf_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/process.d.ts",
"kind": "definition"
},
{
"path": "types/node/punycode.d.ts",
"kind": "definition"
},
{
"path": "types/node/querystring.d.ts",
"kind": "definition"
},
{
"path": "types/node/readline.d.ts",
"kind": "definition"
},
{
"path": "types/node/repl.d.ts",
"kind": "definition"
},
{
"path": "types/node/scripts/generate-inspector/inspector.d.ts.template",
"kind": "package-meta",
"suspect": "edited"
},
{
"path": "types/node/stream.d.ts",
"kind": "definition"
},
{
"path": "types/node/string_decoder.d.ts",
"kind": "definition"
},
{
"path": "types/node/test/assert.ts",
"kind": "test"
},
{
"path": "types/node/test/async_hooks.ts",
"kind": "test"
},
{
"path": "types/node/test/buffer.ts",
"kind": "test"
},
{
"path": "types/node/test/child_process.ts",
"kind": "test"
},
{
"path": "types/node/test/cluster.ts",
"kind": "test"
},
{
"path": "types/node/test/constants.ts",
"kind": "test"
},
{
"path": "types/node/test/crypto.ts",
"kind": "test"
},
{
"path": "types/node/test/dgram.ts",
"kind": "test"
},
{
"path": "types/node/test/dns.ts",
"kind": "test"
},
{
"path": "types/node/test/events.ts",
"kind": "test"
},
{
"path": "types/node/test/fs.ts",
"kind": "test"
},
{
"path": "types/node/test/global.ts",
"kind": "test"
},
{
"path": "types/node/test/http.ts",
"kind": "test"
},
{
"path": "types/node/test/http2.ts",
"kind": "test"
},
{
"path": "types/node/test/module.ts",
"kind": "test"
},
{
"path": "types/node/test/net.ts",
"kind": "test"
},
{
"path": "types/node/test/os.ts",
"kind": "test"
},
{
"path": "types/node/test/path.ts",
"kind": "test"
},
{
"path": "types/node/test/perf_hooks.ts",
"kind": "test"
},
{
"path": "types/node/test/process.ts",
"kind": "test"
},
{
"path": "types/node/test/querystring.ts",
"kind": "test"
},
{
"path": "types/node/test/readline.ts",
"kind": "test"
},
{
"path": "types/node/test/repl.ts",
"kind": "test"
},
{
"path": "types/node/test/stream.ts",
"kind": "test"
},
{
"path": "types/node/test/string_decoder.ts",
"kind": "test"
},
{
"path": "types/node/test/tls.ts",
"kind": "test"
},
{
"path": "types/node/test/tty.ts",
"kind": "test"
},
{
"path": "types/node/test/url.ts",
"kind": "test"
},
{
"path": "types/node/test/util.ts",
"kind": "test"
},
{
"path": "types/node/test/v8.ts",
"kind": "test"
},
{
"path": "types/node/test/vm.ts",
"kind": "test"
},
{
"path": "types/node/test/wasi.ts",
"kind": "test"
},
{
"path": "types/node/test/worker_threads.ts",
"kind": "test"
},
{
"path": "types/node/test/zlib.ts",
"kind": "test"
},
{
"path": "types/node/timers.d.ts",
"kind": "definition"
},
{
"path": "types/node/tls.d.ts",
"kind": "definition"
},
{
"path": "types/node/trace_events.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.4/assert.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts3.4/node-tests.ts",
"kind": "test"
},
{
"path": "types/node/ts3.6/node-tests.ts",
"kind": "test"
},
{
"path": "types/node/tty.d.ts",
"kind": "definition"
},
{
"path": "types/node/url.d.ts",
"kind": "definition"
},
{
"path": "types/node/util.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/assert.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/async_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/buffer.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/child_process.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/cluster.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/console.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/constants.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/crypto.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/dgram.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/dns.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/domain.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/events.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/http.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/http2.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/https.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/index.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/inspector.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/module.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/net.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/node-tests.ts",
"kind": "test"
},
{
"path": "types/node/v12/os.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/path.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/perf_hooks.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/process.d.ts",
"kind": "definition"
}
],
"owners": [
"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"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "rbuckton",
"date": "2021-02-11T20:04:56.000Z",
"isMaintainer": true
}
],
"ciResult": "pass"
} |
🔔 @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 @Ryan-Willpower @peterblazejewicz @addaleax @JasonHK @victorperin @ZYSzys — please review this PR in the next few days. Be sure to explicitly select |
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? node/v14.14Comparison details for node/14.14 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. node/v14.14Comparison details for node/14.14 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
@ExE-Boss The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
I think using the non-prefixed version is the correct call, as anyone currently using module augmentation against a module like This does lead to an interesting discussion we should have in the TypeScript team about the possibility of defining multiple canonical names for a package in the package itself (as I think this can be accomplished using |
As far as I know the prefixed versions work only in esm mode but not in commonjs. |
Ready to merge |
@Flarna The |
I just published |
I just published |
…liases by @ExE-Boss * [node] Add `node:`‑prefixed module aliases * fixup! [node] Add `node:`‑prefixed module aliases
…liases by @ExE-Boss * [node] Add `node:`‑prefixed module aliases * fixup! [node] Add `node:`‑prefixed module aliases
I think this change broke my IDE (vscode), it will alwaws add the is there any way to opt out and back into the non-prefixed version? |
@lucascaro That will most likely depend on microsoft/TypeScript#42764. |
Should we perhaps temporarily revert this then? I have not seen the |
either reverting or moving the prefixed declarations after the non-prefixed ones would work, I think. |
I discovered this pull request after looking into a StackOverflow question (https://stackoverflow.com/questions/67172090/vscode-typescript-why-suggest-auto-import-from-nodepath), so it seems like something that is starting to show up in the wild. |
@ExE-Boss @SimonSchick I think we should just revert this for now, at least until it lands in new versions of node. Ideally it might best to wait until this feature is available in the current LTS (which if I'm understanding things correctly, will be v16 which is in a few months so not that far away) before re-landing it. It might be worth including a check for this in (I'm also getting this behaviour in WebStorm btw - it prefers |
Reverting this sounds good. VSCode does auto imports well for my old projects, but it's broken for my new projects with the latest type definition. |
Currently my nodev15 PR contains node aliases, can we have a decision here so I can either remove them or move forward? |
@SimonSchick I’d prefer if we tried moving the |
Please fill in this template.
npm test <package to test>
.If changing an existing definition: