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] Expose global ResponseInit; remove NodeJS.fetch namespace #67341
[node] Expose global ResponseInit; remove NodeJS.fetch namespace #67341
Conversation
@thw0rted 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. 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": 67341,
"author": "thw0rted",
"headCommitOid": "3884171509ea897c7411be2f8d23f81dd99c1c62",
"mergeBaseOid": "9235592ccbfd67841f58d46f06ddef1306bd61e9",
"lastPushDate": "2023-11-07T16:47:01.000Z",
"lastActivityDate": "2023-12-01T19:42:37.000Z",
"mergeOfferDate": "2023-11-30T23:51:14.000Z",
"mergeRequestDate": "2023-12-01T19:42:37.000Z",
"mergeRequestUser": "thw0rted",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/test/globals.ts",
"kind": "test"
},
{
"path": "types/node/ts4.8/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts4.8/test/globals.ts",
"kind": "test"
},
{
"path": "types/node/v18/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/test/globals.ts",
"kind": "test"
},
{
"path": "types/node/v18/ts4.8/globals.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/ts4.8/test/globals.ts",
"kind": "test"
}
],
"owners": [
"Microsoft",
"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": [
{
"type": "approved",
"reviewer": "andrewbranch",
"date": "2023-11-30T23:50:28.000Z",
"isMaintainer": true
},
{
"type": "stale",
"reviewer": "jakebailey",
"date": "2023-11-13T19:42:49.000Z",
"abbrOid": "d0cd74c"
},
{
"type": "stale",
"reviewer": "RyanCavanaugh",
"date": "2023-11-10T22:32:53.000Z",
"abbrOid": "d0cd74c"
}
],
"mainBotCommentID": 1799183235,
"ciResult": "pass"
} |
🔔 @microsoft @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 — please review this PR in the next few days. Be sure to explicitly select |
This is really two changes and if anyone objects to either, I can split into separate PRs. The first is to add the global The second is to refactor out the I updated tests but couldn't get ETA: figured out |
@thw0rted 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 which are failing do not end up on the list of PRs for the DT maintainers to review. |
I'm not sure these CI failures are actually caused by my changes, see also #67259 and #67291. Maybe @jakebailey or @andrewbranch can take a look? (Author and reviewer of microsoft/DefinitelyTyped-tools#803, respectively.) |
New commit adds the missing global File type as well, since it winds up in some fetch sub-sub-types. |
Weird es-abstract related failures are a problem due to our new partial package installs here; the latest dt-tools should fix this via some hack. |
@thw0rted 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 which are failing do not end up on the list of PRs for the DT maintainers to review. |
@thw0rted 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 which are failing do not end up on the list of PRs for the DT maintainers to review. |
Remove trailing whitespace
@RyanCavanaugh 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? |
@jakebailey, @RyanCavanaugh 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? |
Re-ping @microsoft, @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: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
It has been more than two weeks and this PR still has no reviews. I'll bump it to the DT maintainer queue. Thank you for your patience, @thw0rted. (Ping @microsoft, @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.) |
interface ErrorConstructor { | ||
/** Create .stack property on a target object */ | ||
captureStackTrace(targetObject: object, constructorOpt?: Function): void; | ||
export {} // Make this a module |
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 makes import {} from "node/globals"
legal 😕 That’s why my _Request
et al. types are accessible. There’s no way to hide them without declaring a module.
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 guess you learn something new every day. When I messed this up last time, nobody seems to have noticed. Does that need to change as well?
Would it be preferable to move these declarations out of globals.d.ts
and into some other module context? I was mostly trying to avoid exposing the fictional namespace so that library authors wouldn't come to depend on that implementation detail, but of course I'd defer to the team about which hazard is more important to work around.
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.
Well, if nobody noticed the last one, probably nobody will notice this. I guess it’s fine 😄
If we had a type reference directive condition, we could use it to hide everything from imports while keeping things accessible to type reference directives:
{
"exports": {
"./*": {
"types@>=5.5": {
"typereference": "./*",
"default": null
},
"default": "./*"
}
}
}
🤔
Ready to merge |
You can try an older version of |
Please fill in this template.
pnpm test <package to test>
.Select one of these and delete the others:
If changing an existing definition: