RRouter
=======
RRouter is a declarative routing layer for React applications.
The main idea of RRouter is to isolate routing in an application in a single
place. That makes possible to compose your application from "pure" React
components.
The minimal React application which uses RRouter looks like::
var React = require('react')
var RRouter = require('rrouter')
var Routes = RRouter.Routes
var Route = RRouter.Route
var MainPage = React.createClass({ ... })
var AboutPage = React.createClass({ ... })
var routes = (
)
RRouter.start(routes, function(view) {
React.renderComponent(view, document.getElementById('app'))
})
Features
--------
**Declarative routing configuration**. Application routes are configured in a
declarative way. Application can inspect configuration and attach additional
metadata to routes. Routing configuration can be nested, so that we can
naturally express interdependencies between routes in an application.
**Named routes and link generation**. Each route can have a ``name`` property
which is used to refer to a route inside a routing structure. RRouter also
provides a ``Link`` component which can generate a ```` element which points
to a specific route by simply referring to the route via ``to`` prop::
Profile
**Data dependencies**. Routes can specify which data should be fetched
asynchronously. It works even with nested routing configurations — RRouter will
collect all data dependencies and fetch them in parallel.
**Composability**. Applications can be composed from smaller isolated pieces
with their own routes. Those smaller pieces can be completely unaware of other
the environment including the prefix they are mounted under.
**Server-side rendering**. An application which uses RRouter can be rendered
entirely on server (using JavaScript runtime such as Node or V8). This works
even if routes require to fetch some data before rendering markup.
.. toctree::
:maxdepth: 3
:hidden:
self
usage
routing-configuration
navigation
data-fetching
composing-routes
server-side-rendering
examples/index
related-work
.. _react-router-component: http://andreypopp.viewdocs.io/react-router-component
.. _react-async: http://andreypopp.viewdocs.io/react-async
.. _node-fibers: https://github.com/laverdet/node-fibers