Cross-container hybrid offline component solution

Source: Internet
Author: User

Keywords: cross-container, Hybrid, offline

Absrtact: The main discussion today is the off-line component cross-container scenario, want to understand how the online page across the WebView container, you can see http://www.cnblogs.com/yexiaochai/p/5204847.html this article.

If you don't know what the difference is between offline and online, check the other documentation yourself. I will simply introduce the respective advantages and differences from the code level, not offline and on-line. Take a look at the diagram first:

On the left is the online page, which features a page on the service side. Each container executes the same code, and the code knows in which container it runs only at run time.

On the right is offline page, the feature is that each container has a code in the local, the code is independent, non-interference. In the compiler you will know which container will run.

Different features mean completely different ideas and programs.

Idea: Since the compile time will know which container to run in the future, it is necessary to do some articles in the compiler. First, for different containers, waimai or Nuomi, or, hand hundred, Ctrip, and so on, different containers under the H5 page which is the same, which is not the same.

We know that in the same business, 90% is the same, the main small part of the customization function, and each container of the Jsbridge provided by the interface is not the same.

So, we pull out most of the same business. Added the adapter layer.

Adapter to the business through a unified end-ability interface, and for different containers have different implementations. In this way, the cost of adding one container at a time is only needed for the container, and the adapter can be quickly migrated once again.

FIS3 release Waimai:adapter/waimai + bussiness = Waimai bussiness.

Other components by analogy.

Code path: Https://github.com/liaobin312716/cross-platform-h5-page

At present the code is not very perfect, and mainly the takeaway and glutinous rice components mainly, follow-up will consider more component access.

Cross-container hybrid offline component solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.