• Stars
    star
    250
  • Rank 162,397 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A framework for building React applications

Reactant Logo


Node CI npm version license

Reactant - A framework for building React applications

Motivation

React is a JavaScript library for building user interfaces, but when we want to develop applications based on React, we often have to do a lot of building configuration and many other libraries choices(Picking and learning a React state library and router library, etc.). We also need to consider how our business logic should be abstracted and structured. Everyone who uses React practices their own perception of how React is built, but it doesn't allow us to quickly focus on the business logic itself. As the application business grows in size, we urgently need a framework that can be easily understood and maintained.

And for the structured design of the application's business logic, separation of concern is a good idea. It requires clear boundaries of liability to avoid low maintainability when UI logic and business logic are mixed. We always want to focus on business logic when building applications. It is one of the business core values of an application. We want it to be easy to maintain, and test. Redux remains most popular state library in React. It is fully accord with immutable principles for React. Redux is just a state container, and we're often at a loss for how to really manage those states. We need a framework for scalable, loosely coupled and easily maintainable React applications.


In order to solve these problems, Reactant was created. It's a framework for React.

Features

Q&A

  1. How does it differ from Angular?

It is different everywhere except for dependency injection.

  1. What is the biggest advantage of Reactant?

It can architect a variety of large React projects. Reactant advocates a lightweight UI, separating the concerns of the application and UI to greatly enhance the maintainability of the project.

Usage

npx reactant-cli init my-app
cd my-app
yarn start

Example


Reactant is very easy to get started. You can try Reactant by visiting the online demo.

Here is the counter example:

import React from 'react';
import { ViewModule, createApp, injectable, useConnector, action, state } from 'reactant';
import { render } from 'reactant-web';

@injectable()
class Counter {
  @state
  count = 0;

  @action
  increase() {
    this.count += 1;
  }
}

@injectable()
class AppView extends ViewModule {
  constructor(public counter: Counter) {
    super();
  }

  component() {
    const count = useConnector(() => this.counter.count);
    return (
      <button type="button" onClick={() => this.counter.increase()}>
        {count}
      </button>
    );
  }
}

const app = createApp({
  main: AppView,
  render,
});

app.bootstrap(document.getElementById('app'));

Documentation

You can visit reactant.js.org for more documentation.

More Repositories

1

mutative

Efficient immutable updates, 2-6x faster than naive handcrafted reducer, and more than 10x faster than Immer.
TypeScript
1,601
star
2

fronts

A progressive micro frontends framework for building Web applications
TypeScript
517
star
3

usm

๐Ÿ– A concise & flexible state model for Redux/MobX/Vuex, etc.
TypeScript
297
star
4

iflow

Concise & powerful state management framework for Javascript.
JavaScript
79
star
5

use-mutative

A 2-6x faster alternative to useState with spread operation
TypeScript
45
star
6

data-transport

A simple and responsible universal transport
TypeScript
41
star
7

mutability

A JavaScript library for transactional mutable updates
TypeScript
28
star
8

react-native-css-tree

Inheritable dynamic style tree.
JavaScript
26
star
9

tees

Universal test framework for front-end with WebDriver, Puppeteer and Enzyme
JavaScript
24
star
10

origin-storage

A same-origin storage(IndexedDB/WebSQL/localStorage) for cross-domain access
TypeScript
22
star
11

crius

A testing tool for behavior-driven development
TypeScript
22
star
12

react-native-px2dp

Pixels convert to density-independent pixels.
JavaScript
22
star
13

ssh-webpack-plugin

Webpack SSH deployment plugin.
JavaScript
19
star
14

jsdoc-tests

A JSDoc test tool for documentation-driven quality
TypeScript
12
star
15

typescript-tutorial

TypeScript
10
star
16

fronts-example

TypeScript
9
star
17

react-iflow

Connector for React and iFlow.
JavaScript
9
star
18

capturer

Log tracker for debugging
TypeScript
7
star
19

marten

A Process Controller Library
JavaScript
7
star
20

openapi-client-codegen

Node.js library that generates Typescript function chaining clients based on the OpenAPI specification.
TypeScript
7
star
21

awesome-micro-frontends

Awesome lists about micro frontends.
6
star
22

use-immutable

A hook for creating the immutable state with mutations on React
TypeScript
5
star
23

be-type

be-type is based on ECMAScript2015+ proxy feature
JavaScript
3
star
24

invariance

Utils for immutable data structures Records & Tuples
TypeScript
3
star
25

usm-redux-demo

Todo + Counter example with usm-redux and react-navigation
TypeScript
3
star
26

glaive

Trying to build a new dependency module injector
JavaScript
3
star
27

reactant-examples

Just reactant examples
TypeScript
3
star
28

usm-examples

Todo Examples for USM
JavaScript
3
star
29

crius-react-example

React test example with crius-test
JavaScript
2
star
30

installation

An installation template tool
TypeScript
2
star
31

iflow-docs-cn

The Chinese version of iFlow documents.
2
star
32

alias-webpack-plugin

Webpack alias batch relative paths configuration plugin
JavaScript
2
star
33

crius-examples

JavaScript
1
star
34

reactant-todomvc

Reactant TodoMVC Example
TypeScript
1
star
35

reactant-base-example

Just reactant base example
TypeScript
1
star
36

use-transport

A React hook with simple and responsible universal transports
TypeScript
1
star
37

unadlib.github.io

unadlib's Notes
HTML
1
star
38

acting

๐ŸŽActing is a tiny agent model tool.
TypeScript
1
star