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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
Install the Rax CLI tools to init project:
install rax-cli -g
init YourProjectName
Start local server to launch project:
ourProjectName
run start
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:
Usage with Webpack or Babel makes React-based components work with Rax, without any code changes.
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"
}
...
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"
}
}]
...
rax-redux
module in your app
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing.
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:
npm run lint
checks the code style.npm test
runs the complete test suite.npm test -- --watch
runs an interactive test watcher.npm test <pattern>
runs tests with matching filenames.npm run build
creates lib
and dist
folder with all the packages.npm start
start local server with examples
folder.
@yuanyan Core |
@imsobear Development |
@yacheng Components |
@boiawang Babel Loaders & Plugins |
@noyobo Webpack Plugins |