-
Notifications
You must be signed in to change notification settings - Fork 441
Remove static abort from AbortSignal #1093
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
Conversation
@types/node doesn't have it, and it's not worth it to make @types/node create a new @types/node version. Co-authored-by: Orta Therox <[email protected]>
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
inputfiles/removedTypes.jsonc
Outdated
"AbortSignal": { | ||
"methods": { | ||
"method": { | ||
"abort": null |
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 think this one should be preferred over node, as Node is just following the web standard? What happened there?
But node does have this method?
|
Web browsers and Node.js have the method defined as https://dom.spec.whatwg.org/#interface-AbortSignal . |
Yeah, agree - its more that we didn't think adding this was worth forcing |
Can it be fixed locally in TS rather than affecting @types/web? |
It's a normal assignability bug, not a change in TypeScript (you can see a tonne in here)
Basically it means that anyone with a current or older version of Which to me isn't a reasonable trade-off for that extra definition |
I mean, we'll have to add that to node one day, so it would be good if TS have a local patch that removes abort() so that anyone need it can install @types/web? |
That can happen in deploy script IMO. |
Can we not change the type of |
Sounds like an option tbh. |
Does the code have the ability to generate an interface for the static side too? If not, I guess we could add that. |
No such ability, I think AbortSignal can be special cased. |
oh, I forgot about addedTypes.jsonc. That should work. |
So, I think we're going to have to take this PR as-is because I don't think we're going to get a good answer which doesn't force users to update node or force a typesVersion on node before the release today. We shipped a build to TypeScript with these changes in, because we don't want to force the node update on anyone migrating to the new TS build, and I want to have corresponding I'll make a PR reverting it after we're sure the RC dom is going to be what we ship in TS. I brought up microsoft/TypeScript#43972 in a TS language design meeting on Wednesday and there was general agreement to explore finding the common subset and extract it in here which is going to probably be tricky work in this repo. microsoft/TypeScript#45328 |
I'd prefer manual patching in deploy script if this isn't a strict requirement. |
It's not, I can do that |
Looks good, please reformat 😉 |
5c5d446
to
8e00927
Compare
8e00927
to
e79b67f
Compare
LGTM |
Sorry @saschanaz, you don't have access to merge: /deploy/createTypesPackages.js. |
iterateThroughFiles((content) => { | ||
return content.replace( | ||
"abort(): AbortSignal;", | ||
"// abort(): AbortSignal; - To be re-added in the future" |
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 maaayy advertise @types/web
but your call really.
OK, let's get this in - which will unblock merging some of the other PRs |
@types/node doesn't have it, and it's not worth it to make @types/node create a new typingsVersion.