-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Add support for sending binary data in websockets #6961
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
By analyzing the blame information on this pull request, we identified @hharnisc, @satya164 and @kenwheeler to be potential reviewers. |
@@ -11,114 +11,174 @@ | |||
*/ | |||
'use strict'; | |||
|
|||
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); | |||
var RCTWebSocketModule = require('NativeModules').WebSocketModule; |
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.
no-undef: 'ArrayBufferView' is not defined.
c85386f
to
936d16b
Compare
@philikon updated the pull request. |
var WebSocketEvent = require('WebSocketEvent'); | ||
const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); | ||
const RCTWebSocketModule = require('NativeModules').WebSocketModule; | ||
const Platform = require('Platform'); |
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.
no-undef: 'ArrayBufferView' is not defined.
936d16b
to
c5d9469
Compare
@philikon updated the pull request. |
Not sure what's up with the Travis failure. I've had a few other Travis builds fail last night, so perhaps Travis had some problems. Either way, I ran the e2e test locally and it passed. Maybe somebody with the right permission bits could kick Travis and restart the build. |
Wow thanks for adding the @satya164 Do the changes in WebSocket.js look good to you? |
This is quite a big rewrite - could you please also add sending strings on both Android and iOS to your test plan to make sure it doesn't break anything? There are no breaking API changes, right? |
Travis tests passed now, they can be a bit flaky (but much more stable than they used to be). |
Please see my comment above. Most of the changes in this PR are from being based on #6889. The actual changes here are only in the last commit and I will rebase once all the dependent PRs have been merged. But with review times of O(1 week), I just wanted to move faster. |
c5d9469
to
a6cca78
Compare
@mkonicek @christopherdro now that the other PRs have landed, I have rebased this PR here. It is ready for review now. Thanks! |
@philikon updated the pull request. |
// Maintain iOS 7 compatibility which doesn't have JS typed arrays. | ||
if (typeof ArrayBuffer !== 'undefined' && | ||
typeof Uint8Array !== 'undefined') { | ||
// $FlowIssue #1658 |
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.
Error suppressing comment Unused suppression
@philikon Is this one good to go? Should I merge it? Please check the eslint warnings. |
Ah, got stung by the Flow 0.23 upgrade in the rebase. Will fix tests. |
a6cca78
to
0231bb5
Compare
@philikon updated the pull request. |
0231bb5
to
a3c1835
Compare
@mkonicek Addressed your review comment and hopefully fixed Flow. Should be good to go now once CI comes back green. |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
\o/ |
Summary:This is a reprise of facebook#6327, but with iOS 7.0 compatibility and less `package.json` changes. **Test Plan:** Load WebSocketExample in UIExplorer app and start websocket test server script (both provided in facebook#6889) and test sending binary data on both iOS and Android Closes facebook#6961 Differential Revision: D3202022 Pulled By: mkonicek fb-gh-sync-id: 38843d0a9c0172971c5c70a5139ded04042b280a fbshipit-source-id: 38843d0a9c0172971c5c70a5139ded04042b280a
Summary:This is a reprise of facebook#6327, but with iOS 7.0 compatibility and less `package.json` changes. **Test Plan:** Load WebSocketExample in UIExplorer app and start websocket test server script (both provided in facebook#6889) and test sending binary data on both iOS and Android Closes facebook#6961 Differential Revision: D3202022 Pulled By: mkonicek fb-gh-sync-id: 38843d0a9c0172971c5c70a5139ded04042b280a fbshipit-source-id: 38843d0a9c0172971c5c70a5139ded04042b280a
Summary:This is a reprise of facebook#6327, but with iOS 7.0 compatibility and less `package.json` changes. **Test Plan:** Load WebSocketExample in UIExplorer app and start websocket test server script (both provided in facebook#6889) and test sending binary data on both iOS and Android Closes facebook#6961 Differential Revision: D3202022 Pulled By: mkonicek fb-gh-sync-id: 38843d0a9c0172971c5c70a5139ded04042b280a fbshipit-source-id: 38843d0a9c0172971c5c70a5139ded04042b280a
Summary: **Motivation** This is originally a follow up of PR #6327 by dewe and jeremyong And mkonicek indicated this should split into a separate PR. Now philikon takes over #6327 as #6961 **Test Plan:** According to #6961 and #6889 Load WebSocketExample in UIExplorer app and start websocket test server script and test sending binary data on both iOS and Android Closes #6937 Reviewed By: javache Differential Revision: D3669596 Pulled By: mkonicek fbshipit-source-id: 342e29eb34de882bcbd9f297aab71dd6bb236748
This is a reprise of #6327, but with iOS 7.0 compatibility and less
package.json
changes.Test Plan: Load WebSocketExample in UIExplorer app and start websocket test server script (both provided in #6889) and test sending binary data on both iOS and Android