-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
fix: add signal to Request
type
#38536
Conversation
Hi @ljbc1994! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Base commit: f6c417c |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
Hi @ljbc1994, thank you so much for taking care of this.
I left a comment on the PR as I think we should improve it.
This pull request was successfully merged by @ljbc1994 in 823b1f4. When will my fix make it into a release? | Upcoming Releases |
Summary: The `Request` interface provided by `types/react-native` doesn't have a `signal` property when it should as this is something that is accessible on the `Request` object. ![image](https://github.com/facebook/react-native/assets/10697889/f2d75973-61ff-4874-ad8e-2c0898b82d27) For example, running the following: #### Without providing a `signal` ```ts console.log(new Request('https://www.facebook.com')); ``` will result in the following: ```ts {"_bodyInit": undefined, "_bodyText": "", "bodyUsed": false, "credentials": "same-origin", "headers": {"map": {}}, "method": "GET", "mode": null, "referrer": null, "signal": {}, "url": "https://www.facebook.com"} ``` ## Changelog: [GENERAL] [FIXED] - Fixed missing property `signal` for the `Request` interface ## Reproduce 1. Add `new Request('https://www.facebook.com').signal` to a typescript file 2. TS will error `Property 'signal' does not exist on type 'Request'` Pull Request resolved: facebook#38536 Test Plan: Adding to `global.d.ts` in a file will resolve the problem, demonstrating that this works. ```ts interface Request { readonly signal: AbortSignal | undefined } ``` Reviewed By: NickGerleman Differential Revision: D47660506 Pulled By: jacdebug fbshipit-source-id: ef1459fbaca5d8f31bf8539bd61ac5e447111fec
Summary: The `Request` interface provided by `types/react-native` doesn't have a `signal` property when it should as this is something that is accessible on the `Request` object. ![image](https://github.com/facebook/react-native/assets/10697889/f2d75973-61ff-4874-ad8e-2c0898b82d27) For example, running the following: #### Without providing a `signal` ```ts console.log(new Request('https://www.facebook.com')); ``` will result in the following: ```ts {"_bodyInit": undefined, "_bodyText": "", "bodyUsed": false, "credentials": "same-origin", "headers": {"map": {}}, "method": "GET", "mode": null, "referrer": null, "signal": {}, "url": "https://www.facebook.com"} ``` ## Changelog: [GENERAL] [FIXED] - Fixed missing property `signal` for the `Request` interface ## Reproduce 1. Add `new Request('https://www.facebook.com').signal` to a typescript file 2. TS will error `Property 'signal' does not exist on type 'Request'` Pull Request resolved: facebook#38536 Test Plan: Adding to `global.d.ts` in a file will resolve the problem, demonstrating that this works. ```ts interface Request { readonly signal: AbortSignal | undefined } ``` Reviewed By: NickGerleman Differential Revision: D47660506 Pulled By: jacdebug fbshipit-source-id: ef1459fbaca5d8f31bf8539bd61ac5e447111fec
Summary: The `Request` interface provided by `types/react-native` doesn't have a `signal` property when it should as this is something that is accessible on the `Request` object. ![image](https://github.com/facebook/react-native/assets/10697889/f2d75973-61ff-4874-ad8e-2c0898b82d27) For example, running the following: #### Without providing a `signal` ```ts console.log(new Request('https://www.facebook.com')); ``` will result in the following: ```ts {"_bodyInit": undefined, "_bodyText": "", "bodyUsed": false, "credentials": "same-origin", "headers": {"map": {}}, "method": "GET", "mode": null, "referrer": null, "signal": {}, "url": "https://www.facebook.com"} ``` ## Changelog: [GENERAL] [FIXED] - Fixed missing property `signal` for the `Request` interface ## Reproduce 1. Add `new Request('https://www.facebook.com').signal` to a typescript file 2. TS will error `Property 'signal' does not exist on type 'Request'` Pull Request resolved: facebook#38536 Test Plan: Adding to `global.d.ts` in a file will resolve the problem, demonstrating that this works. ```ts interface Request { readonly signal: AbortSignal | undefined } ``` Reviewed By: NickGerleman Differential Revision: D47660506 Pulled By: jacdebug fbshipit-source-id: ef1459fbaca5d8f31bf8539bd61ac5e447111fec
Summary:
The
Request
interface provided by@types/react-native
doesn't have asignal
property when it should as this is something that is accessible on theRequest
object.For example, running the following:
Without providing a
signal
will result in the following:
Changelog:
[GENERAL] [FIXED] - Add missing property
signal
for theRequest
interfaceReproduce
new Request('https://www.facebook.com').signal
to a typescript fileProperty 'signal' does not exist on type 'Request'
Test Plan:
Adding to
global.d.ts
in a file will resolve the problem, demonstrating that this works.