chameleon, an open source framework that makes multi-end adaptation of small programs easier

chameleon, an open source framework that makes multi-end adaptation of small programs easier

2022-10-09 0 930
Resource Number 44841 Last Updated 2025-02-24
¥ 0HKD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue recommends an open source small program cross-end unified solution. — chameleon.

chameleon, an open source framework that makes multi-end adaptation of small programs easier插图

R&D students not only pursue the flexibility of h5, but also pursue the performance closer to the original. In the face of entrance expansion, a single function of App client, wechat mini program, Alipay mini program, Baidu mini program, Android manufacturer alliance fast application, and other mini programs must be repeatedly implemented on each platform, and the development and maintenance costs will increase exponentially. There is an urgent need to maintain a set of code that can build a multi-entry solution, and Chameleon, Didi’s cross-end solution, has finally been released. Really focus on making a set of code run on multiple ends.

class=”pgc-h-arrow-right” data-track=”79″>

High development efficiency : original and powerful cross-end syntax checking function; The best engineering design in the industry

Good maintainability : original polymorphic protocol; Easily maintain a set of code across multiple ends

Progressive access : one-click export of native components; Pollution-free reference native components

strong scalability : based on polymorphic protocol, it can extend any underlying interface; Updates that do not strongly depend on the framework

Rich base libraries : unified CML Native SDK; Rich components, API libraries

Multi-end highly consistent : unified code, interface interaction, development process; Multi-level highly unified

chameleon, an open source framework that makes multi-end adaptation of small programs easier插图1

class=”pgc-h-arrow-right” data-track=”6″>

The most basic concepts in software architecture design are “split” and “merge”. The meaning of split is “divide and rule”, which divides complex problems into a single problem to solve, such as the “microservitization” design of back-end business systems; The meaning of “merger” is to abstract and converge the same business requirements into one piece to achieve the purpose of high efficiency and high quality, such as the design of “middle service” in the back-end business system.

Chameleon belongs to the latter. By defining a unified language framework + unified polymorphic protocol, Chameleon can extract self-generated, continuous and maintainable “front-end and middle service” from multi-end (corresponding to multiple independent services) services.

chameleon, an open source framework that makes multi-end adaptation of small programs easier插图2

class=”pgc-h-arrow-right” data-track=”39″>

Supported platforms: web, wechat mini program, Alipay Mini program, Baidu Mini program, android(weex), ios(weex), qq mini program, ByteDance mini program, fast application, continuous update

chameleon, an open source framework that makes multi-end adaptation of small programs easier插图3

class=”pgc-h-arrow-right” data-track=”37″> cross-end target

Although each end environment is ever-changing, what always changes is the idea of MVVM architecture. Chameleon aims to unify the MVVM cross-end environment.

chameleon, an open source framework that makes multi-end adaptation of small programs easier插图4

class=”pgc-h-arrow-right” data-track=”80″> Install

dependent environment

 > node > = 8.10.0 > = < / span > < span class = "HLJS - number" > 5.6 < / span > < span class = "HLJS - number" >. 0 < / span > < / code > < / pre >

Install chameleon-tool

 

You are advised to use nvm to manage Node versions. yarn and cnpm are not supported for installation.

 

npm i -g  chameleon-tool

After successful installation, run cml-v to view the current version and cml-h to view the help documentation.

Create project and start

  • execute cml init project
  • Enter project name
  • Wait for automatic execution of npm install dependency
  • Switch to the project root directory and execute cml dev
  • will automatically open the preview screen as follows:

chameleon, an open source framework that makes multi-end adaptation of small programs easier插图5

Directory and file structure

├── chameleon.config.js                 //  Project configuration file 
├─ dist // ├─ dist 
├── alipay // ├─ Alipay 
├── baidu // 
├── wx // ├── wx 
├── tt // 
├── qq // ├── QQ 
├── xx // 
├─ mock // ├─ mock 
├── node_modules // npm package dependencies 
├── package.json
└─ src // project source  span
├── app // ├── app 
├── components // 
├── pages // 
├─ route. config.json // Route configuration 
└─ store // global state management 

editor plugin

  • idea, WebStorm plugin CML Language Support
  • VS Code plugin cml
  • Atom plug-in languages-cml
  • Sublime plugin under review, please look forward to…

Code example

<template>
  <view>
    <text>{{title}}</text><text>{{reversedTitle}}</text>
  </view>
</template>

<script>
class Index  {
  data = {
    title: "chameleon"
  }
  computed = {
    reversedTitle: function () {
      return this.title.split('').reverse().join('')
    }
  }
  mounted() {}
  destroyed() {}
}
export default new  Index();
< /script> 

Those who have been engaged in web programming know that web programming uses a combination of HTML + CSS + JS. Similarly, chameleon uses CML + CMSS + JS.

  • JS syntax is used to deal with the logical layer of the page. Compared with common web programming, this project aims to define the standard MVVM framework, which has a complete life cycle, watch, computed, data two-way binding and other excellent features, which can quickly improve the development speed and reduce the maintenance cost.
  • CML (Chameleon Markup Language) is used to describe the structure of a page. We know that HTML is a set of standard semantic tags, for example, text is < span> The button is < button> . CML also has a standard set of tags, which we define as components, and CML provides users with a set of components. In addition, CML also supports template syntax, such as conditional rendering, list rendering, data binding, and so on. At the same time, CML supports the use of Vue-like syntax, so you can get started faster.
  • CMSS(Chameleon Style Sheets) is a style language used to describe the structure of CML pages. It has most of the features of CSS, and can also support a variety of css preset language less stylus.
  • CML adopts the same componented scheme, single-file organization mode, and life cycle as Vue. Meanwhile, data response capability is aligned with Vue, and data management capability is aligned with Vuex, which is very convenient for developers to start and maintain.

Through the above introduction to the development language, I believe you can see as long as you have the knowledge of web programming can quickly get started with the development of chameleon.

—END—

Open source protocol: Apache-2.0

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free Source Code chameleon, an open source framework that makes multi-end adaptation of small programs easier https://ictcoder.com/an-open-source-framework-that-makes-it-easier-for-mini-programs-to-adapt-to-multiple-devices/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services