1, the preface

After a few previous Weex source analysis series of articles, I believe that we on Weex is what Weex, Weex can bring what Weex, Weex is how to work and so on several questions have their own answers.

Remark:

  • This article will be very concise, because it stands on the shoulders of previous source code analysis articles to summarize. If you have any doubts, I strongly encourage you to go back and read the previous article;
  • Based on Weex0.16.0;

2. Weex core competencies

Of course, Weex provides a variety of convenient components for developers to develop foolproof, but with Weex, we can learn the essence of Weex: how to solve old problems in a new way?

Weex’s dynamic, cross-platform and Native design not only solves the problem of frequent release, but also saves labor costs to a certain extent. RN and Weex have no problems in the selection of technology, and both believe that this path can be taken. The most core capability of the two is the interaction ability between JS engine and Native, while other categories, such as JS framework, component support, tool chain, extension, ecology, etc., are actually subsidiary and incidental products of a technology, which are made to win the support of developers.

As far as Weex is concerned, as long as the interaction ability between Js and Native is retained, we can achieve a variety of other products by ourselves, and there will be no big difference in thinking.

Therefore, we should gradually transition from learning a new technology to truly understanding the essence behind the technology. If we realize our ideas by ourselves, what can we learn from the new technology?

3. Weex framework analysis

Recall from the article on the source analysis of each component:

  • First of all, JSBridge is indispensable, which is the bridge of INTERACTION between JS and Native. Corresponding to the communication layer;
  • Each instruction sent back from JS will be processed by various managers first, and then encapsulated into the corresponding Action; Corresponding frame layer;
  • Note that many operations are performed on specific threads, such as WeeXDomThread, and that there are thread switches associated with that; Corresponding to the thread communication layer;
  • Finally, each JS directive is executed with a Component: Module, Component, Adapter, etc. Corresponding to component layer;

4. Weex framework diagram

Let’s analyze the frame diagram again: WXBridge is responsible for the interaction between JS engine and Native; framework layer is responsible for processing JS instructions; communication layer is responsible for switching each thread; every JS instruction corresponds to the execution of component layer.

5, summary

This article is a summary of the previous several source code analysis articles, just try to understand Weex SDK framework design and core principles, after all, for Weex the entire ecosystem SDK only accounted for a part of it, there are many such as development process, tool chain, extension and many other aspects to wait for us to continue to explore.

Welcome to the Weex source code analysis project:Weex-Analysis-Project

Welcome to pay attention to wechat public number: regularly share Java, Android dry goods!