[@types/node] Wrong type for ProcessEnv#51273
Conversation
|
@kylehalleman 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": 51273,
"author": "kylehalleman",
"headCommitOid": "dc642ebfa3cf17fa9a0bd0a25cb2d88c26daf902",
"lastPushDate": "2021-02-16T20:17:18.000Z",
"lastActivityDate": "2021-02-17T21:52:40.000Z",
"maintainerBlessed": false,
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/process.d.ts",
"kind": "definition"
},
{
"path": "types/node/test/path.ts",
"kind": "test"
},
{
"path": "types/node/v10/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/v11/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/v11/test/path.ts",
"kind": "test"
},
{
"path": "types/node/v12/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/v12/test/path.ts",
"kind": "test"
},
{
"path": "types/node/v13/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/v13/test/path.ts",
"kind": "test"
},
{
"path": "types/node/v13/worker_threads.d.ts",
"kind": "definition"
},
{
"path": "types/node/worker_threads.d.ts",
"kind": "definition"
}
],
"owners": [
"Microsoft",
"DefinitelyTyped",
"jkomyno",
"alvis",
"r3nya",
"btoueg",
"brunoscheufler",
"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": "changereq",
"reviewer": "ExE-Boss",
"date": "2021-02-16T23:06:14.000Z"
}
],
"ciResult": "fail",
"ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/dc642ebfa3cf17fa9a0bd0a25cb2d88c26daf902/checks?check_suite_id=2054173674"
} |
|
🔔 @microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @btoueg @BrunoScheufler @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 @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 |
|
👋 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. 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. 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
left a comment
There was a problem hiding this comment.
Unfortunately, there’s no way to do this without breaking a lot of things until microsoft/TypeScript#2521 (PR microsoft/TypeScript#42425) gets implemented.
That is also why DOM interface definitions don’t currently have the implicit string conversion either.
|
@kylehalleman The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
|
@kylehalleman 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. Thank you! |
|
@ExE-Boss I see that a lot of tests in other packages are failing. Taking a look at some of them, like Regardless, I see the impact this is having. I think this would still be valuable even without microsoft/TypeScript#42425. Users who set an environment variable like I might be in over my head here since this is obviously a core package to the ecosystem, so would appreciate your advice on moving forward. |
That's not current behaviour: > process.env.PORT = 3000
3000
> process.env.PORT
'3000'imo there is no clean cut option here |
|
You're correct, my mistake. I swear I've been able to read the value as assigned before. But that might have been through something like webpack. I suppose microsoft/TypeScript#42425 really is a blocker on this then. |
|
@kylehalleman 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 19th (in a week) if the issues aren't addressed. |
|
@kylehalleman 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! |
The type for
ProcessEnvis incorrect. It states it must be astringorundefined, but according to the Node documentation, the value can be astring,number, orboolean.While the deprecated behavior converts the value to a
string, that does not mean you can’t assign anumberorboolean.It is clear from the documentation and examples in the docs that you can assign a
string,number, orboolean.npm test <package to test>.Select one of these and delete the others:
If changing an existing definition: