Skip to content

Commit 6595af6

Browse files
committed
prep for release
1 parent 1e839f8 commit 6595af6

File tree

25 files changed

+105
-78
lines changed

25 files changed

+105
-78
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tmp
2-
node_modules
31
dist
4-
examples/build
2+
examples/build
3+
node_modules
4+

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
karma.conf.js
12
script
2-
vendor
3+
specs
4+
webpack.config.js
35

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- "0.10"
4+
before_script:
5+
- export DISPLAY=:99.0
6+
- sh -e /etc/init.d/xvfb start

README.md

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
React Router
2-
============
1+
React Nested Router
2+
===================
33

4-
Declarative routing with automatic UI nesting for React.
4+
A complete routing library for React.
55

66
Features
77
--------
@@ -20,19 +20,15 @@ and workflows are to create.
2020
Installation
2121
------------
2222

23-
`npm install rpflorence/react-router`
24-
25-
We'll get on npm's registry soon.
26-
27-
WIP
28-
---
29-
30-
This is a work in progress but the API seems to have settled.
23+
`npm install react-nested-router`
3124

3225
Usage
3326
-----
3427

35-
```js
28+
This library only ships with common js modules, so you'll need browserify or
29+
webpack or something that can load/bundle it.
30+
31+
```
3632
var Router = require('react-router');
3733
var Route = Router.Route;
3834
var Link = Router.Link;
@@ -47,12 +43,25 @@ Router(
4743
).renderComponent(document.body);
4844
```
4945

46+
Or if JSX isn't your jam:
47+
48+
```js
49+
Router(
50+
Route({handler: App},
51+
Route({name: "about", handler: About}),
52+
Route({name: "users", handler: Users},
53+
Route({name="user", path: "user/:userId", handler: User})
54+
)
55+
)
56+
).renderComponent(document.body);
57+
```
58+
5059
When a `Route` is active, you'll get an instance of `handler`
5160
automatically rendered for you. When one of the child routes is active,
52-
you can render it with `this.props.activeRoute` all the way down the
53-
view hierarchy. This allows you to create nested layouts without having
54-
to wire it all up yourself. `Link` components create accessible anchor
55-
tags to route you around the application.
61+
you can render it with `this.props.activeRoute` in the parent all the
62+
way down the view hierarchy. This allows you to create nested layouts
63+
without having to wire it all up yourself. `Link` components create
64+
accessible anchor tags to route you around the application.
5665

5766
Here's the rest of the application:
5867

@@ -96,6 +105,31 @@ var User = React.createClass({
96105
});
97106
```
98107

108+
Benefits of This Approach
109+
-------------------------
110+
111+
1. **Incredible screen-creation productivity** - There is only one
112+
use-case when a user visits a route: render something. Every user
113+
interface has layers (or nesting) whether its a simple navbar or
114+
multiple levels of master-detail. Coupling nested routes to these
115+
nested views gets rid of a ton of work for the developer to wire all
116+
of it together when the user switches routes. Adding new screens
117+
could not get faster.
118+
119+
2. **Immediate understanding of application structure** - When routes
120+
are declared in one place, developers can easily construct a mental
121+
image of the application. It's essentially a sitemap. There's not a
122+
better way to get so much information about your app this quickly.
123+
124+
3. **Code tractability** - When a developer gets a ticket to fix a bug
125+
at as specific url they simply 1) look at the route config, then 2)
126+
go find the handler for that route. Every entry point into your
127+
application is represented by these routes.
128+
129+
4. **URLs are your first thought, not an after-thought** - With React
130+
Nested Router, you don't get UI on the page without configuring a url
131+
first. Fortunately, its wildly productive this way, too.
132+
99133
API
100134
---
101135

@@ -285,36 +319,13 @@ active -->
285319
<a href="#/users/123">Michael</a>
286320
```
287321

288-
Benefits of This Approach
289-
-------------------------
290-
291-
1. **Incredible screen-creation productivity** - There is only one
292-
use-case when a user visits a route: render something. Every user
293-
interface has layers (or nesting) whether its a simple navbar or
294-
multiple levels of master-detail. Coupling nested routes to these
295-
nested views gets rid of a ton of work for the developer to wire all
296-
of it together when the user switches routes. Adding new screens
297-
could not get faster.
298-
299-
2. **Immediate understanding of application structure** - When routes
300-
are declared in one place, developers can easily construct a mental
301-
image of the application. It's essentially a sitemap. There's not a
302-
better way to get so much information about your app this quickly.
303-
304-
3. **Code tractability** - When a developer gets a ticket to fix a bug
305-
at as specific url they simply 1) look at the route config, then 2)
306-
go find the handler for that route. Every entry point into your
307-
application is represented by these routes.
308-
309-
4. **URLs are your first thought, not an after-thought** - With
310-
React Router, you don't get UI on the page without configuring a url
311-
first. Fortunately, its wildly productive this way, too.
312-
313322
Development
314323
-----------
315324

316-
`script/test` will fire up a karma runner, `npm test` will do the same
317-
but with the `--single-run` option.
325+
- `script/test` will fire up a karma runner and watch for changes in the
326+
specs directory.
327+
- `npm test` will do the same but doesn't watch, just runs the tests.
328+
- `script/build-examples` does exactly that.
318329

319330
Thanks, Ember
320331
-------------

examples/auth-flow/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx React.DOM */
22
var React = require('react');
3-
var ReactRouter = require('../../lib/main');
3+
var ReactRouter = require('../../modules/main');
44
var Router = ReactRouter.Router;
55
var Route = ReactRouter.Route;
66
var Link = ReactRouter.Link;

examples/data-flow/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx React.DOM */
22
var React = require('react');
3-
var ReactRouter = require('../../lib/main');
3+
var ReactRouter = require('../../modules/main');
44
var Router = ReactRouter.Router;
55
var Route = ReactRouter.Route;
66
var Link = ReactRouter.Link;

examples/dynamic-segments/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx React.DOM */
22
var React = require('react');
3-
var ReactRouter = require('../../lib/main');
3+
var ReactRouter = require('../../modules/main');
44
var Router = ReactRouter.Router;
55
var Route = ReactRouter.Route;
66
var Link = ReactRouter.Link;

examples/master-detail/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx React.DOM */
22
var React = require('react');
3-
var ReactRouter = require('../../lib/main');
3+
var ReactRouter = require('../../modules/main');
44
var Router = ReactRouter.Router;
55
var Route = ReactRouter.Route;
66
var Link = ReactRouter.Link;

examples/partial-app-loading/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx React.DOM */
22
var React = require('react');
3-
var ReactRouter = require('../../lib/main');
3+
var ReactRouter = require('../../modules/main');
44
var Router = ReactRouter.Router;
55
var Route = ReactRouter.Route;
66
var Link = ReactRouter.Link;

examples/partial-app-loading/async-components/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @jsx React.DOM */
22

33
var React = require('react');
4-
var ReactRouter = require('../../../lib/main');
4+
var ReactRouter = require('../../../modules/main');
55
var Link = ReactRouter.Link;
66

77
var Dashboard = React.createClass({

0 commit comments

Comments
 (0)