The advantage is that most of the time the performance is good enough The disadvantage is that JS bridge Need to adapt to all supported platforms, When the platform side UI Control wants to be in RN Use in, It takes developers extra effort to adapt. Platform rendering : use JS To call native UI, This is a React Native In the way.be based on Canvas drawĬanvas Drawing is the realization of UI Cross platform mainstream thinking : This method is efficient and JSON Not so much, There will also be performance problems when transmitting a large amount of data, therefore Electron Recommended CSS animation, And it's not recommended to do JS anination. However ,Eletron Used web worker API postMessage same structured clone algorithm To do it IPC Serialization and deserialization of data. Interprocess communication can use many ways to deliver messages, For example, the familiar pipeline (pipe). However, it depends on Electron This design is not necessary for desktop applications, It increases IPC Cost of about chrome Come on, This is a reasonable design, One tab Inside crash It won't lead to the whole chrome crash. We can also solve the problem through interprocess communication JS and Call problems between native languages, Its representative scheme is :Electron.Įlectron Use IPC To some extent, it is also a last resort, Because it depends on chromium rengier engine Is to open a process for each window. On the desktop system, Applications have more flexibility, You can organize your own applications by using multiple processes. because JS bridge Layer dependence JSON signal communication, When a large amount of data is transmitted at both ends ( Complex animation, Quick slide of large list ),JSON Performance bottlenecks can cause UI Carton. Through a bridge Native Basic services and RN Of UI Platform based rendering, So in UI Layer also does a lot of bridging. The difference between the two is Cordova Of UI Layer based on WebView Rendering, So you just need to call. The representative of bridging is :Cordova / React native. React Native Learn from this model, adopt JS bridge Pass it back and forth JSON. This model is much like the communication between client and server, The client and server agree on the service interface (REST API) after, adopt JSON Exchange data. native layer The ability to be bridge layer encapsulated, And then provide it to JS layer call, In turn, ,JS layer The function of can also be borrowed from bridge layer for Native layer call. The core problem to be solved by bridging is two languages (JS And native languages ) Communication between, Or say JS thread and native thread Communication between. These solutions have their own advantages and disadvantages, From an architectural point of view, It is roughly the following modes : Several types of cross platform solutions 1.