Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 91dfbe9

Browse files
committed
updated readme
1 parent 7471ceb commit 91dfbe9

File tree

1 file changed

+76
-40
lines changed

1 file changed

+76
-40
lines changed

README.md

Lines changed: 76 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,47 @@
1-
# React.rb
1+
# Reactrb / Reactive-Ruby
22

3-
### A complete [React.js](http://facebook.github.io/react/) [Opal Ruby](http://opalrb.org) wrapper.
3+
[![Join the chat at https://gitter.im/reactrb/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/reactrb/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
[![Build Status](https://travis-ci.org/reactrb/reactrb.svg)](https://travis-ci.org/reactrb/reactrb)
5+
[![Code Climate](https://codeclimate.com/github/reactrb/reactrb/badges/gpa.svg)](https://codeclimate.com/github/reactrb/reactrb)
6+
[![Gem Version](https://badge.fury.io/rb/reactrb.svg)](https://badge.fury.io/rb/reactrb)
47

5-
[**Visit reactrb.org For The Full Story**](http://reactrb.org)
6-
7-
[![Join the chat at https://gitter.im/zetachang/react.rb](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zetachang/react.rb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8-
[![Build Status](https://travis-ci.org/zetachang/react.rb.svg)](https://travis-ci.org/zetachang/react.rb)
9-
[![Code Climate](https://codeclimate.com/github/zetachang/react.rb/badges/gpa.svg)](https://codeclimate.com/github/zetachang/react.rb)
10-
[![Gem Version](https://badge.fury.io/rb/reactive-ruby.svg)](https://badge.fury.io/rb/reactive-ruby)
8+
**Reactrb is an [Opal Ruby](http://opalrb.org) wrapper of
9+
[React.js library](http://facebook.github.io/react/)**.
1110

1211
It lets you write reactive UI components, with Ruby's elegance using the tried
1312
and true React.js engine. :heart:
1413

15-
### Important: current `react.rb` gem users please [read this!](#road-map)
14+
[**Visit reactrb.org For The Full Story**](http://reactrb.org)
15+
16+
### Important: `react.rb` and `reactive-ruby` gems are **deprecated.** Please [read this!](#upgrading-to-reactrb)
1617

1718
## Installation
1819

1920
Install the gem, or load the js library
2021

21-
+ add `gem 'reactive_rails_generator'` to your gem file [(details)](https://github.com/loicboutet/reactive-rails-generator) and use the generator, or
22-
+ add `gem 'reactive-ruby'` to your gem file or
23-
+ `gem install reactive-ruby` or
24-
+ install (or load via cdn) [inline-reactive-ruby.js](http://github.com/reactive-ruby/inline-reactive-ruby)
22+
+ add `gem 'reactrb'` to your gem file or
23+
+ `gem install reactrb` or
24+
+ install (or load via cdn) [inline-reactrb.js](http://github.com/reactrb/inline-reactrb)
2525

2626
For gem installation it is highly recommended to read [the getting started section at reactrb.org](http://reactrb.org/docs/getting-started.html)
2727

2828
## Quick Overview
2929

30-
React.rb components are ruby classes that inherit from `React::Component::Base` or include `React::Component`.
30+
Reactrb components are ruby classes that inherit from `React::Component::Base` or include `React::Component`.
3131

3232
`React::Component` provides a complete DSL to generate html and event handlers, and has full set of class macros to define states, parameters, and lifecycle callbacks.
3333

3434
Each react component class has a render method that generates the markup for that component.
3535

3636
Each react component class defines a new tag-method in the DSL that works just like built-in html tags, so react components can render other react components.
3737

38-
As events occur, components update their state, which causes them to rerender, and perhaps pass new parameters to lower level components, thus causing them to rerender.
38+
As events occur, components update their state, which causes them to rerender, and perhaps pass new parameters to lower level components, thus causing them to rerender.
3939

4040
Under the hood the actual work is effeciently done by the [React.js](http://facebook.github.io/react/) engine.
4141

42-
React.rb components are *isomorphic* meaning they can run on the server as well as the client. This means that the initial expansion of the component tree to markup is done server side, just like ERB, or HAML templates. Then the same code runs on the client and will respond to any events.
43-
44-
React.rb integrates well with Rails, Sinatra, and simple static sites, and can be added to existing web pages very easily, or it can be used to deliver complete websites.
45-
46-
[**For complete documentation visit reactrb.org**](http://reactrb.org)
47-
48-
## Examples
42+
Reactrb components are *isomorphic* meaning they can run on the server as well as the client. This means that the initial expansion of the component tree to markup is done server side, just like ERB, or HAML templates. Then the same code runs on the client and will respond to any events.
4943

50-
Refer to [reactive-ruby/react.rb-examples](https://github.com/reactive-ruby/react.rb-examples) to see some live examples in action.
44+
Reactrb integrates well with Rails, Sinatra, and simple static sites, and can be added to existing web pages very easily, or it can be used to deliver complete websites.
5145

5246
## Why ?
5347

@@ -61,36 +55,78 @@ Refer to [reactive-ruby/react.rb-examples](https://github.com/reactive-ruby/reac
6155
# Problems, Questions, Issues
6256

6357
+ [Stack Overflow](http://stackoverflow.com/questions/tagged/react.rb) tag `react.rb` for specific problems.
64-
+ [Gitter.im](https://gitter.im/zetachang/react.rb) for general questions, discussion, and interactive help.
65-
+ [Github Issues](https://github.com/zetachang/react.rb/issues) for bugs, feature enhancements, etc.
58+
+ [Gitter.im](https://gitter.im/reactrb/chat) for general questions, discussion, and interactive help.
59+
+ [Github Issues](https://github.com/reactrb/reactrb/issues) for bugs, feature enhancements, etc.
6660

6761

68-
# Road Map
62+
# Upgrading to Reactrb
6963

70-
The original `react.rb` gem is still available as the [0-3-stable branch.](https://github.com/zetachang/react.rb/tree/0-3-stable) **but please read on..**
64+
The original gem `react.rb` was superceeded by `reactive-ruby`, which has had over 15,000 downloads. This name has now been superceeded by `reactrb` (see #144 for detailed discussion on why.)
7165

72-
Many new features, bug fixes, and improvements are incoporated in the `reactive-ruby` gem currently built on the [0-7-stable branch.](https://github.com/zetachang/react.rb/tree/0-7-stable) In addtion more extensive documentation for the current stable branch is available at [reactrb.org](http://reactrb.org), and the [Opal Ruby Playground](http://fkchang.github.io/opal-playground/?code:&html_code=%3Cdiv%20id%3D%22container%22%3E%3C%2Fdiv%3E%0A&css_code=body%20%7B%0A%20%20background%3A%20%23eeeeee%3B%0A%7D%0A) incorporates the current stable branch.
66+
Going forward the name `reactrb` will be used consistently as the organization name, the gem name, the domain name, the twitter handle, etc.
7367

74-
Our plan is to do one more upgrade on the `reactive-ruby` gem which will be designated version 0.8.0. [click for detailed feature list](https://github.com/zetachang/react.rb/milestones/0.8.x)
68+
The first initial version of `reactrb` is 0.8.x.
7569

76-
From 0.9.0 and beyond we will return to using the `react.rb` gem for releases, and `reactive-ruby` will continue as a meta gem that depends only on react.rb >= 0.9.x.
70+
It is very unlikely that there will be any more releases of the `reactive-ruby` gem, so users should upgrade to `reactrb`.
7771

78-
Version 0.9.0 of `react.rb` **will not be** 100% backward compatible with 0.3.0 so its very important to begin your upgrade process now by switching to `reactive-ruby` 0.7.0.
72+
There are no syntactic or semantic breaking changes between `reactrb` v 0.8.x and
73+
previous versions, however the `reactrb` does *not* include the react js source as previous versions did. This allows you to pick the react js source compatible with other gems and react js components you may be using.
7974

80-
Please let us know either at [Gitter.im](https://gitter.im/zetachang/react.rb) or [via an issue](https://github.com/zetachang/react.rb/issues) if you have specific concerns with the upgrade from 0.3.0 to 0.9.0.
75+
To upgrade, replace `reactive-ruby` with `reactrb`, both in your Gemfile, and in any `requires` in your code. You will also need to require react-js as this is no longer included in the gem.
8176

82-
## Contributing
77+
If you are using react-rails then simply find anyplace where you `require 'reactrb'` and immediately before this do a `require 'react'` which will load the compatible react js file.
8378

84-
This project is still in early stage, so discussion, bug reports and PRs are
85-
really welcome :wink:.
79+
If you are using webpack then add `react` to your manifest.
80+
81+
If you are not using react-rails then find where you `require 'reactrb'` and immediately before this do a `require 'react-latest'` (or 'react-v13', 'react-v14' or 'react-v15')
82+
83+
# Roadmap
84+
85+
Upcoming will be an 0.9.x release which will deprecate a number of features and DSL elements. [click for detailed feature list](https://github.com/reactrb/reactrb/milestones/0.9.x)
86+
87+
Version 0.10.x **will not be** 100% backward compatible with 0.3.0 (`react.rb`) or 0.7.x (`reactive-ruby`) so its very important to begin your upgrade process now by switching to `reactrb` now.
88+
89+
Please let us know either at [Gitter.im](https://gitter.im/react/chat) or [via an issue](https://github.com/react/reactrb/issues) if you have specific concerns with the upgrade from 0.3.0 to 0.10.x.
8690

87-
#### Testing react.rb
91+
## Developing
92+
93+
`git clone` the project.
94+
95+
To play with some live examples cd to the project directory then
96+
97+
2. `cd example/examples`
98+
2. `bundle install`
99+
3. `bundle exec rackup`
100+
4. Open `http://localhost:9292`
101+
102+
or
103+
104+
1. `cd example/rails-tutorial`
105+
2. `bundle install`
106+
3. `bundle exec rails s`
107+
4. Open `http://localhost:3000`
108+
109+
or
110+
111+
1. `cd example/sinatra-tutorial`
112+
2. `bundle install`
113+
3. `bundle exec rackup`
114+
4. Open `http://localhost:9292`
115+
116+
Note that these are very simple examples, for the purpose of showing how to configure the gem in various server environments. For more examples and information see [reactrb.org.](http://reactrb.org)
117+
118+
## Testing
119+
120+
1. Run `bundle exec rake test_app` to generate a dummy test app.
121+
2. `bundle exec rake`
122+
123+
## Contributions
124+
125+
This project is still in early stage, so discussion, bug reports and PRs are
126+
really welcome :wink:.
88127

89-
1. `bundle install`
90-
2. `bundle exec rake test_app` to generate a dummy test app.
91-
3. `bundle exec rake`
92128

93129
## License
94130

95-
In short, React.rb is available under the MIT license. See the LICENSE file for
131+
In short, Reactrb is available under the MIT license. See the LICENSE file for
96132
more info.

0 commit comments

Comments
 (0)