Omi – mp is
Omi framework is a general Web componentization framework open source by wechat Payment LINE R&D Department and AlloyTeam. Based on Web Components, Omi framework is used to develop Web pages of PC, mobile browser or wechat and MOBILE WEBview. Since it was opened in May this year, the project has received more than 5000 stars and 29 contributors. Through the combined efforts of the Omi original development team and community contributors, Omi’s ecology has grown rapidly, including:
Omi recently released OMI-MP, which aims to break the boundary between small programs and Web, allowing small programmers to use small program technology stack to develop Web HTML5 single page application (SPA), and also allowing existing small programs to generate Web pages. One development, multiple operations. For example, the Web page generated by the applets official template:
Wechat mini program ecology
At the fifth World Internet Conference on November 7, Ma Huateng revealed a list of figures: Currently, 1.5 million developers have joined the development of small programs, the number of small program applications has exceeded 1 million, covering more than 200 subsectors, and the daily active users have reached 200 million. In the past 10 months, the number of small programs has almost doubled, the number of developers has increased by 500,000, and the daily activity of small programs has increased by 30 million.
According to statistics, the most common technology stack used in the development of small programs is the use of syntax and tools provided by small programs. Tencent is also increasing the construction of basic capabilities and platform ecology of small programs. In the future, wechat small program not only embrace Web Components, but also better support NPM, small program cloud, visual programming, subcontracting. The visual layout system of small programs allows developers to quickly build small programs like dragging and dragging building blocks.
Wechat mini program and Omi
Wechat applet and Omi frame both use Web Components (CustomElements and ShadowDom) rendering Components to build Web pages in the way of building blocks. Applet renders Components in customized WebView. Omi renders components in PC, Mobile, TV and other modern browser environments. Omi uses JSX as UI expressions and small programs use template engines. JSX is Turing complete and can express all template engines. Here’s an example of the 99 times table:
After compiling to javascript:
Applet support for RPX layout, Omi also enhanced CSS support for RPX layout based on 750 screen width. For example, define a div half screen wide:
Small programs and Omi have a lot in common, and it is natural to open up the boundary between them. Let the small program reflect its value on more platforms, save the company’s labor costs, one development, multiple operation.
This public test of OMI-MP aims to tap the platform potential and advantages of small programs, allowing developers to use existing small programs to quickly generate HTML5 single-page applications based on Web Components. Based on omi and Omi-Router front-end projects, small programs can not only run in wechat. It can also run in wechat built-in browser, hand-Q built-in browser, QQ browser and PC, Mobile, TV and other browsers.
OMI uses WebComponents and shadow-dom, so you don’t need to install other element panels like React. Just use Elements’ Sidebar, which comes with Chrome and is just as powerful as the React developer tool.
Omi – MP is a brand new and breakthrough challenge. During the use of OMI – MP, you can raise issues if you have any opinions or suggestions, and we will give feedback at the first time. You can also submit Pull Request, and we will review and incorporate it at the first time. We hope that the joint development of the open source community can make OMI-MP better and better, and make small programs more and more valuable.
Applets are developed to generate Web samples
The following is a comparison between douban movie small program DEMO and the generated Web page:
Community development, welcome to join and contribute to community
At present, Omi contributors are all over major companies at home and abroad (China, South Korea, the United States, Turkey). Omi has received documents and code submissions from 29 contributors, including 11 core contributors. Inside Tencent, Omi is mainly maintained by the R&D department of wechat Payment line and some members of AlloyTeam. Developers with ideas, ability and passion are welcome to join the ranks of contributors and eventually join the Omi Team.
Here are some ways you can contribute:
1. Translation documents, currently available in Chinese, English and Korean, welcome translation of other languages to join 2. Submit patch code to optimize Omi3. Actively participate in Issue discussions, such as answering questions, providing ideas or reporting unresolvable bugs 4. Contribution cases can be management background, PC website, mobile terminal H5, etc. 5. Improve the document, can repeatedly modify the document, make it easier to understand, get started faster 6. Expand Omi ecology and write Omi custom components 7. Share stories with Omi, excellent ones will be posted in Omi homepage Readme 8. Write Omi related blogs, excellent ones will be listed in Omi homepage readme
Developers are very welcome to contribute to Tencent open source, and we will give incentives to contributors accordingly to show our recognition and gratitude. See The Tencent Contributor Incentive Plan