React on Rails - The Ultimate React Framework
React on Rails is your way into production-ready React apps. Embracing the core principles of React, React on Rails provides you with all you need to start making you React-powered, full stack JS WebApp, that actually does actual things in actual browsers of actual visitors, served by actual servers crawled by actual spiders. Not your grandma's WebApp.
Installation & Usage
npm install react-rails
and start hacking.
Clone/fork react-rails-starterkit
if you want an opinionated file structure & toolkip.
Check out the Introduction and the Full API Docs for more info.
Core principles
- First-class server-side pre-rendering, even with complex, async data dependencies.
- Fully-integrated flux implementation, including flux over the wire.
- Real-time full-duplex data propagation by default.
- Idiomatic React implementation of all you need for you WebApp: animations, routing, tree transformation, HTTP backend communication, session management, etc, the React Way.
Release notes/news
- 30/9/2014: Should be ready for use, but expect some bugs, still very early release.
Feel free to post and issue. Check out
react-rails-starterkit
.
SHOW ME THE CODE
Animating
Toggles the rotation of an image upon click a button.
var R = ;var styles = // Styles are automatically processed (vendor-prefixing, etc) "left": transform: "rotate(0deg)" "right": transform: "rotate(180deg)" ; moduleexports = React;
Basic Flux - Component
Tells a memory dispatcher to roll a die, and continuously update state to reflect its status.
var R = ; moduleexports = React;
Basic Flux - Backend (with generators)
Dispatches a "/rollTheDice" action.
flux;
Roadmap
-
Release v0.1.0
- Stabilize the API
- Document the API
- Add more tests
-
Release v0.2.0
- Lightweight builds/move plugins out of core