Skip to content
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

Use SocketRocket for web socket library #36347

Closed
wants to merge 2 commits into from

Conversation

amgleitman
Copy link

Summary

The previous native web socket API, RCTSRWebSocket, appears to be an older version of the one provided as part of SocketRocket. The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

Changelog

[IOS] [CHANGED] - Use SocketRocket for web socket library

Test Plan

Validated the following:

  • The WebSocket test page in RNTester
  • Live reloading

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 1, 2023
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,476,862 +0
android hermes armeabi-v7a 7,799,361 +0
android hermes x86 8,953,156 +0
android hermes x86_64 8,810,873 +0
android jsc arm64-v8a 9,107,949 +0
android jsc armeabi-v7a 8,305,122 +0
android jsc x86 9,159,120 +0
android jsc x86_64 9,418,604 +0

Base commit: 4e117cb
Branch: main

@javache javache self-requested a review March 2, 2023 10:39
@javache
Copy link
Member

javache commented Mar 2, 2023

Would it be possible to provide a diff between RCTSRWebSocket.m and the version we'll be using now?

We've had a number of local changes which we need to ensure aren't lost.

@javache javache self-assigned this Mar 2, 2023
@amgleitman
Copy link
Author

Would it be possible to provide a diff between RCTSRWebSocket.m and the version we'll be using now?

We've had a number of local changes which we need to ensure aren't lost.

Sure, I've got a diff here:

https://github.com/facebook/react-native/compare/main...amgleitman:react-native-macos:socket-rocket-diff?expand=1

This was formed by copying over SocketRocket's versions into their RCTSRWebSocket equivalents. The diffs are a bit gross since things don't perfectly line up, but if there are ways to coerce the diffs to look the way we want them, I'm happy to help with that.

@javache
Copy link
Member

javache commented Mar 3, 2023

Can't see any massive differences, but as you say, it's a bit hard to compare. Will pull this to our internal CI, as that will require some work to update the dep.

@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

javache pushed a commit to javache/react-native that referenced this pull request Mar 14, 2023
Summary:
The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

## Changelog

[IOS] [CHANGED] - Use SocketRocket for web socket library

Pull Request resolved: facebook#36347

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 4be7de1fce2183133462c0243b4b3309b02043f5
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 15, 2023
@facebook-github-bot
Copy link
Contributor

@javache merged this pull request in 9ee0e1c.

amgleitman pushed a commit to amgleitman/react-native-macos that referenced this pull request Mar 16, 2023
Summary:
Pull Request resolved: facebook#36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

[IOS] [CHANGED] - Use SocketRocket for web socket library

Pull Request resolved: facebook#36347

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf
microsoft-github-policy-service bot pushed a commit to microsoft/react-native-macos that referenced this pull request Mar 18, 2023
Summary:
Pull Request resolved: facebook#36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

[IOS] [CHANGED] - Use SocketRocket for web socket library

Pull Request resolved: facebook#36347

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>
amgleitman pushed a commit to amgleitman/react-native-macos that referenced this pull request Mar 21, 2023
Summary:
Pull Request resolved: facebook#36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

[IOS] [CHANGED] - Use SocketRocket for web socket library

Pull Request resolved: facebook#36347

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf
microsoft-github-policy-service bot pushed a commit to microsoft/react-native-macos that referenced this pull request Mar 21, 2023
Summary:
Pull Request resolved: facebook#36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

[IOS] [CHANGED] - Use SocketRocket for web socket library

Pull Request resolved: facebook#36347

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Pull Request resolved: facebook#36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

## Changelog

[IOS] [CHANGED] - Use SocketRocket for web socket library

Pull Request resolved: facebook#36347

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants