alibaba/rax

Name: rax

Owner: Alibaba

Description: :tophat: A universal React-compatible render engine.

Created: 2016-10-14 07:53:50.0

Updated: 2018-01-17 18:20:55.0

Pushed: 2018-01-16 06:11:29.0

Homepage: https://alibaba.github.io/rax

Size: 5940

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rax

A universal React-compatible render engine.


Community


Rax is a universal JavaScript library with a largely React-compatible API. If you use React, you already know how to use Rax.

:zap: Fast: blazing fast virtual DOM.

:dart: Tiny: 8.0 KB minified + gzipped.

:art: Universal: works in browsers, Weex, Node.js and could works more container that implement driver specification.

Quick Start

Install the Rax CLI tools to init project:

install rax-cli -g
init YourProjectName

Start local server to launch project:

ourProjectName
run start
Examples
rt {createElement, Component, render} from 'rax';
rt Text from 'rax-text';

s Hello extends Component {
nder() {
return [
  <Text style={styles.title}>Hello Rax</Text>,
  <Text style={styles.title}>Hello {this.props.name}</Text>,
];



t styles = {
tle: {
color: '#ff4400',
fontSize: 48,
fontWeight: 'bold',



er(<Hello name="world" />);

More examples take a look at the examples folder:

Rax Renderers
Rax Drivers
Compatible with React Components

Usage with Webpack or Babel makes React-based components work with Rax, without any code changes.

Usage with Webpack

Add an alias for react and react-dom:


 ...
solve: {
alias: {
  'react': 'rax',
  'react-dom': 'rax-dom',
  // Not necessary unless you consume a module using `createClass`
  'create-react-class': "rax/lib/createClass"
}

 ...

Usage with Babel

Install the babel plugin for aliasing: npm install --save-dev babel-plugin-module-resolver

Add an alias for react and react-dom in your .babelrc:


 ...
lugins": [
["module-resolver", {
  "root": ["."],
  "alias": {
    "react": "rax",
    "react-dom": "rax-dom",
    // Not necessary unless you consume a module using `createClass`
    "create-react-class": "rax/lib/createClass"
  }
}]

 ...

Developer Tools

React Developer Tools

Redux DevTools extension

Contributing

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing.

Development Workflow

After cloning rax, run npm install to fetch its dependencies.
Run npm run setup link and bootstrap project before development. Then, you can run several commands:

Core Team

@yuanyan

Core


@imsobear

Development


@yacheng

Components


@boiawang

Babel Loaders & Plugins


@noyobo

Webpack Plugins


Weex Logo

? back to top


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.