当前位置:网站首页>Several cross end development artifacts

Several cross end development artifacts

2022-06-30 16:58:00 InfoQ

What we all know is that many platforms now adopt cross platform development , Compared with native development , Cross platform development with low development cost , Short development cycle , Many advantages such as low development difficulty . So what is cross platform development ? First, let's understand cross platform , Like Android ,pc, Apple ,ipad, We can call it user terminal , It is also the platform on which our application runs , So what we call cross platform development is to use non Android or non Apple technologies to develop Android applications or apple applications , That's cross platform .
Cross end solutions can more or less play a role in R & D cost reduction and efficiency increase , Each scheme has its own advantages and disadvantages . At present, the mainstream cross end development schemes on the market are as follows 4 Kind of :
1、 With  Web  On the basis of  H5 Hybrid  programme
This kind of scheme is simply to use web pages to cross the end . Now the vast majority of them have ( Even enclosed
Applet
ecology ) All support  Webview, So as long as the development of web pages and then put to multiple end can , On the desktop side, the corresponding solution is Electron. From low development cost 、 Unified standards 、 In terms of ecological prosperity ,H5 Hybrid  Excellent scheme . But the disadvantages of this scheme are also very obvious , There is a significant gap between performance and experience , meanwhile Web  Its ecological prosperity comes from its good historical compatibility , It also means a heavy historical burden .
2、React-Native/Weex  Class scheme
React-Native/Weex  This kind of plan is to learn from each other as much as possible , A combination of Web Ecology and Native Components , Give Way JS  After executing the code, use  Native The components are rendered , To solve the problem of abandoning Web The problem of historical burden .
The scheme also has some defects :iOS/Android  Components and layout mechanisms that are inconsistent at both ends , Make it difficult to guarantee the consistency of both ends ; Depend on  Native  The mechanism also makes some CSS  Property is difficult to implement , for example z-index problem .
in addition , This solution also requires very high maintenance and support costs : If borrowed  Web But it's not exactly Web ecology , There are a lot of inconsistencies , For example, the usual CSS  Layout cannot be used .
3、Flutter
Flutter Don't continue in Web  Ecologically , From the beginning of the design, there was no  Web  Ecological considerations . Compared with RN rely on Native View Rendering ,Flutter Is a self drawn component , adopt  Skia Draw on the screen .
Because it can fully play  GPU  The ability of , There's no need to go  Native  Make a circle .Flutter  Theoretically, it can achieve better performance and consistency at both ends , This means that in theory the future may be based on  Flutter  Of  JS  Dynamic solutions can support more than  WEEX  Better .
But from the perspective of front-end development ,Flutter More like a Native Develop solutions rather than cross end solutions ( Although it's actually across  Android/iOS  Of ). The main problem at the moment is Flutter for Web  Technically, it's probably a long way from being available for production , The ability to be dynamic does make some scenarios unsuitable .
4、 Applet runtime scheme
This scheme can be said to be the most cost-effective scheme at present , Not one of them. .
Application experience , Applet technology is the front end
Containers
An application of Technology , Its components and UI There are clear specifications , Developers don't have to think about compatibility and the like H5 Selection of complex tools and frameworks during development . meanwhile , Due to components and UI It's all preset , The presentation experience will also be better .
Application framework support , Some runtime scenarios support more than just pure  wxml 
Wechat applet
function , Support also includes  uniapp、 Taro、kbone  Applet integrated with third-party framework .
Host environment integration , The applet is based on App Applications implemented on the end , Its acquisition system (App) Will also have more permissions than H5; With the trend of wechat applet , Major mainstream Internet platforms follow , The development of applet technology has become mature , The adaptation of multi intelligent terminal devices has begun to appear when small programs are running on the market ( be based on Andriod Multi terminal screen adaptation of the system ).
Mention the applet runtime scheme , I'd like to introduce
FinClip
Applet runtime project .FinClip It's applet container technology , The cross end technology advantages mentioned above have , Include : Application experience due to H5, The application framework supports small programs generated by a variety of mainstream frameworks , Multi terminal equipment ( host ) Environmentally friendly and compatible .
in addition , The separation of view layer and logic layer also brings many benefits :
1、 Facilitate data sharing and interaction between multiple applet pages . Having the same context in the life cycle of an applet can provide a familiar coding experience for developers with a native application development background ;
2、Service and View The separation and parallel implementation of can prevent JS Perform actions that affect or slow down page rendering , This helps improve rendering performance ;
3、 because JS stay Service Layer execution , therefore JS It's operated inside DOM Will not be right View Layers have an impact , So the applet can't operate DOM Structural , This also makes the performance of small programs better than traditional H5 Better .
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/181/202206301533214375.html