-
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
[TM] Add spec for Networking #24892
[TM] Add spec for Networking #24892
Conversation
c8e635b
to
fd48334
Compare
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.
mostly looks good, but are we supposed to create 2 Specs? I think the aim is for a single Spec, then having bits that are iOS / Android specific commented.
callback: (requestId: number) => mixed, | ||
) => void; | ||
+abortRequest: (requestId: number) => void; | ||
+clearCookies: (callback: (result: boolean) => mixed) => void; |
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.
not sure if mix is understood by the codegen, but i would err towards no.
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.
@rickhanlonii we need your powers here
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.
Why does a callback have a return value?
I don't see any other usages of mixed like this
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.
changing to void right now
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.
Oh, this change. Please see this comment: #24892 (comment) what do you think?
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.
@RSNara could you please advise here? Is using mixed
for callbacks supported by codegen? Or if we want users to be able to pass async callbacks we should return Promise<void> | void
instead of just void
?
import * as TurboModuleRegistry from 'TurboModuleRegistry'; | ||
import type {NativeResponseType} from './XMLHttpRequest'; | ||
|
||
type Header = [string, string]; |
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.
not sure if Tuples are supported, should be interesting!
This is what we concluded with @rickhanlonii since there are 2 methods with different signatures, and Flow wasn't happy with |
Probably the best we can do until we unify the native interface to use the same prop types |
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.
@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @thymikee in e8037cb. When will my fix make it into a release? | Upcoming Releases |
Summary: Part of facebook#24875, adds a spec for Networking. Since `sendRequest` methods are different for both platforms, I had to create 2 spec files as Flow would merge their definitions even when I added `Platform.OS` check ## Changelog [General] [Added] - TM spec for Networking Pull Request resolved: facebook#24892 Reviewed By: RSNara Differential Revision: D15543067 Pulled By: fkgozali fbshipit-source-id: 2b91114dfa45e7899bbb139656a30a6fd52e31db
Summary
Part of #24875, adds a spec for Networking. Since
sendRequest
methods are different for both platforms, I had to create 2 spec files as Flow would merge their definitions even when I addedPlatform.OS
checkChangelog
[General] [Added] - TM spec for Networking
Test Plan
Flow passes.