In the world of big front-end technology, when we have to solve repetitive problems, we often think about designing a Domain-specific Language (DSL) or abstracting a framework layer to solve similar problems. With DSLS you don’t need to write multiple sets of code for a particular terminal, and you can take advantage of the abstraction capabilities of the host language to ensure consistent and developer-friendly rendering across terminals.
At present, popular DSLS include JSX syntax supported by React, SFC structure and V -* instruction set defined by Vue, WXML/WXS syntax of wechat applets, etc. These DSLS are eventually compiled into object code, published directly on the applets platform, or run in apps and Web browsers with jS-Runtime.
-
Virtual DOM: Render to different terminals through Virtual DOM, fully respect system characteristics, perform differential processing for different terminals, and achieve efficient rendering;
-
Componentization: Highly reusable, composable, and maintainable architectural design hides the complex DOM structure and behavior, allowing developers to focus on the functionality and appearance of the application;
-
Data binding: Easily bind data sources to the application user interface, reducing logic complexity and development difficulty;
-
Status management and routing: effectively separate user interface and data processing to achieve engineering management of the project;
-
Vue-like syntax and React JSX compatibility, combining the agility of Vue with the flexibility of React.