Giter Site home page Giter Site logo

wsy1983wsy / gaiax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alibaba/gaiax

0.0 0.0 0.0 33.87 MB

GaiaX动态模板引擎是一套轻量化、跨平台、高性能的纯原生移动端卡片渲染动态化解决方案

Home Page: https://youku-gaiax.github.io/

License: Apache License 2.0

Shell 0.01% JavaScript 0.54% Ruby 0.09% C++ 4.83% C 0.30% Objective-C 14.83% Java 11.48% Rust 31.26% Kotlin 25.94% TypeScript 3.25% CSS 3.03% Objective-C++ 1.35% Swift 0.45% HTML 2.55% CMake 0.06% SCSS 0.02%

gaiax's Introduction

GaiaX-logo

GaiaX dynamic template engine is a lightweight cross-platform solution for pure native dynamic card, developed by Alibaba YouKu technology team

README-en README-zh Docs-zh GitHub release GitHub Stars GitHub Forks user repos GitHub Contributors License

GaiaX dynamic template engine

GaiaX dynamic template engine is a lightweight cross-platform solution for pure native dynamic card, developed by Alibaba YouKu technology team.

Besides client SDK, we provide the template visual build tool - GaiaStudio, and Demo Project - template sample and real-time preview, which supports creating templates, editing templates, real machine debugging, and real-time preview.

GaiaX dynamic template engine aims to ensure that the native experience and performance at the same time, help the client achieve low code.

Goals

The following goals are the way forward for our project:

  • High performance
  • Cross-platform technology
  • Visual construction
  • Pure native rendering

Supported Platforms

  • Android
  • iOS

Core Concept

GaiaX-arch

The technology used

Rust/Android/Kotlin/iOS/OC/C++/JNI/CSS/FlexBox

Usage

Android

Dependency

add jitpack source:

// with setting.gradle
pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        maven { url 'https://jitpack.io' }
        mavenCentral()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        maven { url 'https://jitpack.io' }
        mavenCentral()
    }
}

// with build.gradle
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Android-Support version:

implementation 'com.github.alibaba.GaiaX:GaiaX-Adapter:0.2.8-support'
implementation 'com.github.alibaba.GaiaX:GaiaX:0.2.8-support'
implementation 'com.alibaba:fastjson:1.2.76'

AndroidX version:

implementation 'com.github.alibaba.GaiaX:GaiaX-Adapter:$version'
implementation 'com.github.alibaba.GaiaX:GaiaX:$version'
implementation 'com.alibaba:fastjson:1.2.76'

Template File

// Path used to store template resources
/assets/${templateBiz}/${templateId}

Methods

// SDK usages

// Initialization - Initializes the SDK
GXTemplateEngine.instance.init(activity)

// Build template parameters - Template information
// activity       - context
// templateBiz    - template biz id
// templateId     - template id
val item = GXTemplateEngine.GXTemplateItem(activity, "templateBiz", "templateId")

// Build template parameters - Viewport size (template draw size, similar to the concept of canvas in Android)
val size = GXTemplateEngine.GXMeasureSize(100F.dpToPx(), null)

// Build template parameters - Template data
val dataJson = AssetsUtils.parseAssets(activity, "template-data.json")
val data = GXTemplateEngine.GXTemplateData(dataJson)

// Create template View - Creates a native View based on template parameters
val view = GXTemplateEngine.instance.createView(item, size)

// Bind the view data
GXTemplateEngine.instance.bindData(view, data)

// Insert the template into the container for rendering
findViewById<ViewGroup>(R.id.template_container).addView(view, 0)

iOS

CocoaPods

Add a dependency to your Podfile

// Dependency
pod 'GaiaXiOS'

Template File

Add template files to App or FrameWork

// Path used to store template resources
xxx.bundle/templateId

Methods

// SDK Usages

// Introduced header files
#import <GaiaXiOS/GaiaXiOS.h>

//register template service
[TheGXRegisterCenter registerTemplateServiceWithBizId:bizId templateBundle:@"xxx.bundle"];

// Build template parameters - Template information
// activity       - context
// templateBiz    - template biz id
// templateId     - template id
GXTemplateItem *item = [[GXTemplateItem alloc] init];
item.templateId = templateId;
item.bizId = templateBiz;

// Build template parameters - Viewport size (template draw size, similar to the concept of canvas in Android)
CGSize size = CGSizeMake(1080, NAN);

// Build template parameters - Template data
GXTemplateData *data = [[GXTemplateData alloc] init];
data.data = @{@"xxx": @"xxx"};

// Create template View - Creates a native View based on template parameters
UIView *view = [TheGXTemplateEngine creatViewByTemplateItem:item measureSize:size];

// Bind the view data
[TheGXTemplateEngine bindData:data onView:view];

// Insert the template into the container for rendering
[self.view addSubview:view];

Roadmap

image

Contributing

We very welcome your to contribute code for the project. In you before writing any code, start by creating a issue or pull request in order for us to be able to discuss details of the proposal and the rationality of the scheme. You can in the following areas contribute code:

  • Packet size
  • The run-time performance
  • Across-side consistency
  • Unit test cases
  • Document or use cases
  • And so on

Tool

Contact us

DingTalk:

WeChat:

Email: [email protected]

LICENSE

Ali-GaiaX-Project is a template dynamic develop solutions developed by Alibaba and licensed under the Apache License (Version 2.0)
This product contains various third-party components under other open source licenses. 
See the NOTICE file for more information.

gaiax's People

Contributors

biezhihua avatar mxpds6688 avatar jingcheng1988 avatar fullalien avatar dqelong avatar amjunliang avatar alibaba-oss avatar oraoto avatar speedrn avatar broven avatar qiqiangqq avatar zylcold avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.