1. Cross-platform, which platforms do you want to cross? At present, the cross-platform demand for mobile terminals is mainly concentrated in:
In the foreseeable future, there may be these cross-platform requirements:
In this era, cross-platform development is a strong demand from the perspective of resource cost, development efficiency, product iteration, and technological evolution. Therefore, there are endless cross-platform solutions. 2. The emergence of cross-platform technologies The mainstream cross-platform mobile solutions in the industry in recent years can be roughly divided into three categories:
Cross-platform: The Web is born with it Cross-platform is an inherent advantage of the Web. Browsers and WebView are both standardized Web containers under the W3C specification, so Web pages can be easily delivered to browsers outside the terminal, WebViews within the terminal, and WebViews provided by other apps. From a cost perspective alone, the Web solution is the only cross-platform choice:
Moreover, the Web itself is a platform, which allows for defensiveness and lower technical risks. But in other aspects, relying on Web technology across terminals also has its limitations:
In addition, Web standards are changing slowly, new features have poor compatibility (for example, the Push API has been around for many years but is still not usable with confidence), and Web basic capabilities are difficult to meet the needs of the Native side. Therefore, based on traditional Web Apps, we have conducted more explorations:
PWA standardization seems to be unworkable, and even if it is, it may take several years before it can be used with confidence. Hybrid App solves part of the problem (platform capability expansion), but it is not enough. PHA is the continuation of these two ideas, using Native technology to realize the dream of PWA But whether it is PHA or HA, the introduction of Native dependencies means the loss of Web openness, which in turn brings cross-terminal and cross-App problems. Cross-end: Containerized Native In addition to the natural cross-terminal nature of the Web, another way to unify multiple terminals is to customize Native into a standard container and let the same code run in each standard container, for example:
From a technical perspective, RN and Weex provide a JavaScript runtime environment and layout engine in the Native container, and both use Native controls for the rendering layer, so there are still system differences in UI interaction. The Flutter solution is more thorough, and even the rendering layer is replaced with a self-drawn UI control based on the graphics engine, thus ensuring cross-end consistency of UI interaction. However, since the solution of containerized Native is based on Native and has no cross-end capabilities, in addition to finding ways to support the Web, it also faces a more difficult problem to solve - cross-App Cross-App: One code for multiple investments in mini programs From a technical perspective, Mini Programs across Native Apps still rely on Web solutions, so why not use Web Apps directly? Due to commercial competition and other factors, Web Apps that intrude on other people's turf are usually subject to some restrictions, such as security warnings, permission control, or even access prohibition (hence the roundabout methods such as password sharing) Mini Programs are different. Their original intention was to be open and everyone is welcome to join (of course, they must abide by the rules). Many large domestic apps have also opened up their mini program capabilities, and mini programs have gradually become a formal way to cross apps. However, as the number of mini program platforms increased, the problem of inconsistent framework standards was exposed. They are all called mini programs, but they are all similar. Therefore, how to quickly produce a variety of mini programs has become a technical topic worth exploring. There are two implementation principles: compilation conversion and runtime adaptation. The former can achieve the same performance as native applets but brings many limitations (writing methods that are difficult for the compiler to recognize are not supported). Existing Web Apps are not so easy to migrate to cross-App applets, such as Taro, uni-app, etc. The latter sacrifices performance in exchange for more possibilities. Existing Web Apps can be migrated relatively easily, such as Taro Next, kbone, etc. PS Of course, you can also have a combination of dynamic and static ideas. Ideally, most basic services are migrated during runtime, and some parts with high performance requirements are converted by compilation. 3. What is the constant in the midst of all the changes? Channels/ends/platforms, business codes, and engineering supporting facilities all seem to be changing rapidly, and none of them are stable. Since everything is changing, let's look at it from another angle. Which part will definitely change?
Which part does not need to change?
The cost of business code migration is very high (even more painful when it involves changes in the technology stack), and the demolition and reconstruction of supporting facilities is definitely a large project. So, is there a way to fix these parts that should not change? Yes, abstract away the changing parts. Rely on the abstraction instead of the concrete, and the upper layer does not need to change accordingly:
In this abstract model, the upper-level business code relies on the standard business framework instead of directly relying on container capabilities, allowing the parts below the business framework to be replaced. The business framework relies on an abstract standard container instead of being bound to a specific container, and can be replaced with other containers that follow the container standard. Based on the standard framework, it can provide supporting development tools such as scaffolding, component library, and visual construction. Based on the standard container, it can establish supporting debugging capabilities such as performance diagnosis and event tracking, thus covering the entire engineering link, and the supporting facilities almost do not need to change. As for platform capability expansion, as an important part of the standard container, a standard API should also be abstracted (similar to the BOM API provided by the browser) for use by upper-level businesses. 4. The future of cross-platform technology The future is unpredictable, so here are a few possibilities:
PS Mini Programs are already in the process of standardization, and it is not impossible for the Mini Program framework to become a standardized container. After all, the Mini Program framework does not have the same slow cycle resistance as WebView and browsers. I don’t think a one-size-fits-all solution is a good idea, because both universal components and universal APIs are minimal and cannot meet actual needs. In addition, do we really need to run one set of code on all channels, terminals, and platforms? |
<<: Apple releases major update iOS 13: iPhone is finally not green anymore!
>>: Microsoft's immortal dream of mobile phones
The full text provides a comprehensive and in-dept...
This article combines the popular products in rec...
On May 10, Xiaohongshu announced the "Brand ...
In the era of content consumption, short videos h...
X86 architecture and ARM architecture are two mai...
In the era of traffic, the importance of fans is ...
Details determine success or failure. This time, ...
The World Wide Web Consortium (W3C) announced tha...
I haven’t updated for a long time. Today I want t...
With the popularity of mobile Internet finance an...
Shi Xuemin - Acupuncture and Moxibustion Tianjin ...
Changsha tea tasting takeout tea is more reliable ...
Only with traffic can you make money. In the Inte...
There are many types of B2B marketing, but online...
How to do maternal and infant marketing on Douyin...