GithubHelp home page GithubHelp logo

hhy5277 / rax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alibaba/rax

0.0 2.0 0.0 1.99 MB

:tophat: A universal React-compatible render engine.

Home Page: http://rax.taobaofed.org

License: Other

JavaScript 95.33% HTML 4.36% CSS 0.06% Shell 0.26%

rax's Introduction

Rax

A universal React-compatible render engine.


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

โšก Fast: blazing fast virtual DOM.

๐ŸŽฏ Tiny: 8.0 KB minified + gzipped.

๐ŸŽจ Universal: works in browsers, Weex, and Node.js.

Size Comparison

Angular 1.5.8 - 55.4kb (gzip)

React 15.3.2 - 43.7kb (gzip)

Vue 2.1.8 - 17.9kb (gzip)

Rax 0.0.2 - 8.0kb (gzip)

Server-side Rendering Comparison

Benchmark run on a MacBook Pro 2.4GHz Intel Core i5 and 8GB 1600MHz DDR3 with Node.js v6.9.2. For more information, please refer to benchmark repository.

Library renderToSring
[email protected] 94.93 ops/sec
[email protected] 154 ops/sec(faster)

Quick Start

Install the Rax CLI tools to init project:

npm install rax-cli -g
rax init YourProjectName

Start local server to launch project:

cd YourProjectName
npm run start

Examples

import {createElement, Component, render} from 'rax';
import {Text} from 'rax-components';

class Hello extends Component {
  render() {
    return <Text style={styles.title}>Hello {this.props.name}</Text>;
  }
}

const styles = {
  title: {
    color: '#ff4400',
    fontSize: 48,
    fontWeight: 'bold',
  }
};

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

More examples take a look at the examples folder:

Rax Renderers

Universal Libraries

Developer Tools

  • React Developer Tools: Allow you inspect and modify the state of your Rax components at runtime in Chrome 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:

  • 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.

Weex Logo

rax's People

Contributors

alvinhui avatar artoria2e5 avatar boiawang avatar chenjun1011 avatar franklife avatar fraserxu avatar gerhut avatar havefive avatar imsobear avatar noyobo avatar raincal avatar timoxley avatar wjwang avatar wssgcg1213 avatar xcodebuild avatar yacheng avatar yuanyan avatar yujiangshui avatar yyx990803 avatar zhangmengxue avatar

Watchers

 avatar  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.