A weex-like framework, featuring 'write once, run everywhere', but mainly aimming at canvas-render(node and web).
Both React and Vue are supported. In the project's example, mReact and mVue are used.
-
Init xEngine with js-framework bundle
import { xEngine } from 'xRender'; xEngine.initSDKEnvironment(/* js-framework path */);
-
Create a xRender instance and provide render context
import { xInstance } from 'xRender'; import Konva from 'konva'; const ins = new xInstance(); ins.frame = new Konva.Stage({ width: 100, height: 100, }); ins.rootView = new Konva.Layer({ id: 'root', }); ins.frame.add(ins.rootView);
-
load the user application js-bundle
ins.renderWithBundleString(/* js-bundle code string */);
The only important thing is context. User application js-bundle is loaded to the executing runtime with a specific context provided by render-x framework. Vdom related instructions are injected to runtime context to enable communication bwtween user application and render engine, which is well-known as 'bridge'.