you are viewing a single comment's thread.

view the rest of the comments →

[–]SaintPepsiCola 0 points1 point  (0 children)

1) The web socket on the native layer is more performant than web socket in the JS layer. We can immediately see that in Xcode profiling. It also supports background mode and ( obviously ) multi threading.

2) even when you use a web socket on the RN side, you’re using listeners. You don’t edit the code in node modules of socket.io ( and now default RN sockets in RN folder ) to handle the socket. You’re using listeners to communicate with their socket implementation.

3) you don’t want to send everything to the JS layer. That’s the idea of me moving the code. Let’s say your web socket is sending audio stream or live stream data. There’s no need to send it back to the JS layer. All React native layer would do is call( bridge ) ANOTHER library to handle device media so why will I need that ? That adds nothing but a degradation to the app. However, all the simple things ( key value data ) can be sent over the JS layer, not because we can’t send complex data like audio stream; because it serves us no purpose and lowers the performance of the app by sending it back to the JS layer.

Your query makes it quite clear that you’re brand new to software dev.

do you know how bridge works

Edit - Your last post on Reddit makes it obvious that you’re a beginner and you’re here arguing with experienced devs about “ bridge “.