MCPcopy Index your code
hub / github.com/alibaba/GaiaX

github.com/alibaba/GaiaX @0.4.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.3 ↗ · + Follow
4,543 symbols 15,731 edges 1,045 files 894 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GaiaX-logo

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

Dynamic template engine

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.

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

<img src="https://gw.alicdn.com/imgextra/i3/O1CN01Y4sMkn1Nmnc7thyzR_!!6000000001613-2-tps-3423-886.png" width="1000" alt="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

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.

Extension points exported contracts — how you extend this code

IResponseDispatcher (Interface)
消息分发器,用于处理及分发接收到的消息的接口, 如果需要自定义事件的分发,实现这个类并设置到WebSocketSetting 中即可。 Created by ZhangKe on 2018/6/26. [6 implementers]
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/websocket/dispatcher/IResponseDispatcher.java
GXIExtensionTemplateSource (Interface)
* GXTemplate data source interface */ [8 implementers]
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/GXRegisterCenter.kt
GXIExtensionTemplateInfoSource (Interface)
(no doc) [6 implementers]
GaiaXTaro/packages/gaiax-taro/src/gaiax/GXIExtensionTemplateInfoSource.tsx
MinMax (Interface)
(no doc) [3 implementers]
GaiaXStretch/src/number.rs
IComputeExtend (Interface)
计算逻辑的扩展
GaiaXAnalyze/GXAnalyzeAndroid/src/main/java/com/alibaba/gaiax/analyze/GXAnalyze.kt
MeasureFunc (Interface)
(no doc)
GaiaXStretch/bindings/kotlin/stretch/src/main/java/app/visly/stretch/Node.kt
IDataCallback (Interface)
(no doc)
GaiaXAndroidDemo/app/src/main/kotlin/com/alibaba/gaiax/demo/RemoteDataSourceTemplateActivity.kt
Request (Interface)
请求接口, 之所以使用 Request 对请求数据进行封装,除了考虑数据发送统一管理之外, 还考虑到后面可能会有其他需求。 Created by ZhangKe on 2019/3/22. [7 implementers]
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/websocket/request/Request.java

Core symbols most depended-on inside this repo

unwrap
called by 2935
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/java_websocket/SSLSocketChannel2.java
new_node
called by 1848
GaiaXStretch/src/node.rs
dpToPx
called by 830
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/template/GXSize.kt
child
called by 703
GaiaXStretch/bindings/js/src/lib.rs
add
called by 519
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/websocket/dispatcher/EngineThread.java
compute_layout
called by 349
GaiaXStretch/src/node.rs
bindData
called by 307
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/GXTemplateEngine.kt
createView
called by 301
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/GXTemplateEngine.kt

Shape

Method 2,968
Function 876
Class 575
Interface 94
Enum 30

Languages

Kotlin53%
Java20%
Rust18%
TypeScript5%
C++4%
C1%

Modules by API surface

GaiaXAndroid/src/androidTest/java/com/alibaba/gaiax/utils/GXTestYKExpression.kt126 symbols
GaiaXAndroidDemo/microbenchmark/src/androidTest/java/com/alibaba/gaiax/benchmark/GaiaXYKExpression.kt124 symbols
GaiaXAndroidDemo/app/src/main/kotlin/com/alibaba/gaiax/demo/utils/GaiaXYKExpression.kt124 symbols
GaiaXAndroid/src/androidTest/java/com/alibaba/gaiax/GXComponentTextTest.kt76 symbols
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/GXRegisterCenter.kt65 symbols
GaiaXAndroid/src/androidTest/java/com/alibaba/gaiax/GXComponentScrollTest.kt62 symbols
GaiaXAndroid/src/androidTest/java/com/alibaba/gaiax/GXYKExpressionTest.kt61 symbols
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/java_websocket/server/WebSocketServer.java55 symbols
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/java_websocket/client/WebSocketClient.java55 symbols
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/render/node/GXNodeTreeUpdate.kt53 symbols
GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/GXTemplateEngine.kt53 symbols
GaiaXAndroidClientToStudio/src/main/java/com/alibaba/gaiax/studio/third/socket/java_websocket/drafts/Draft_6455.java50 symbols

For agents

$ claude mcp add GaiaX \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact