Skip to content

Commit 1e15a58

Browse files
committed
updated docs for release
1 parent 5aae2a8 commit 1e15a58

File tree

2 files changed

+40
-43
lines changed

2 files changed

+40
-43
lines changed

UPGRADE_GUIDE.md

+40-39
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To see discussion around these API changes, please refer to the
55
[changelog](/CHANGELOG.md) and visit the commits and issues they
66
reference.
77

8-
0.7.x -> 0.8.x
8+
0.7.x -> 0.9.x
99
--------------
1010

1111
### `ActiveState` mixin `isActive`
@@ -24,7 +24,7 @@ var SomethingActive = React.createClass({
2424
}
2525
});
2626

27-
// 0.8.x
27+
// 0.9.x
2828
var SomethingActive = React.createClass({
2929
mixins: [ActiveState],
3030

@@ -36,17 +36,26 @@ var SomethingActive = React.createClass({
3636
});
3737
```
3838

39-
### `<Routes onActiveStateChange/>` -> `PathState`
39+
### `<Routes onActiveStateChange/>` -> `<Routes onChange />`
4040

4141
```js
4242
// 0.7.x
4343
<Routes onActiveStateChange={fn} />
4444

45-
// 0.8.x
46-
var App = React.createClass({
47-
mixins: [PathState],
48-
updatePath: fn
49-
});
45+
function fn(nextState) {}
46+
47+
// 0.9.x
48+
<Routes onActiveStateChange={fn} />
49+
50+
function fn() {
51+
// no arguments
52+
// `this` is the routes instance
53+
// here are some useful methods to get at the data you probably need
54+
this.getCurrentPath();
55+
this.getActiveRoutes();
56+
this.getActiveParams();
57+
this.getActiveQuery();
58+
}
5059
```
5160

5261
You may need access to the current routes, use the `RouteLookup` mixin
@@ -55,25 +64,7 @@ for that along with `PathState`.
5564
### `.` in params support
5665

5766
`.` used to be a delimiter like `/`, but now its a valid character in
58-
your params. If you were using this feature you'll need to do the split
59-
yourself.
60-
61-
```
62-
// 0.7.x
63-
var route = <Route path=":foo.:bar" />;
64-
65-
// 0.8.x
66-
var route = <Route path=":foobar" handler={Handler}/>
67-
68-
Handler = React.createClass({
69-
render: function() {
70-
var split = this.props.params.foobar.split('.');
71-
var foo = split[0];
72-
var bar = split[1];
73-
// ...
74-
}
75-
});
76-
```
67+
your params.
7768

7869
### `transition.retry()`
7970

@@ -89,9 +80,9 @@ React.createClass({
8980
}
9081
});
9182

92-
// 0.8.x
83+
// 0.9.x
9384
React.createClass({
94-
mixins: [Transitions],
85+
mixins: [Navigation],
9586
login: function() {
9687
// ...
9788
this.transitionTo(transition.path);
@@ -114,7 +105,7 @@ React.createClass({
114105
}
115106
});
116107

117-
// 0.8.x
108+
// 0.9.x
118109
React.createClass({
119110
statics: {
120111
willTransitionTo: function(transition) {
@@ -129,17 +120,17 @@ React.createClass({
129120
`preserveScrollPosition` was totally broken and should have been named
130121
`perverseScrollPosition`.
131122

123+
132124
There are now three scroll behaviors you can use:
133125

134-
- `'imitateBrowser'`
126+
- `'browser'`
135127
- `'scrollToTop'`
136128
- `'none'`
137129

138-
`imitateBrowser` is the default, and imitates what browsers do in a
139-
typical page reload scenario (preserves scroll positions when using the
140-
back button, scrolls up when you come to a new page, etc.)
141-
142-
Also, you can't specify scroll behavior per `<Route/>` anymore.
130+
`browser` is the default, and imitates what browsers do in a typical
131+
page reload scenario (preserves scroll positions when using the back
132+
button, scrolls up when you come to a new page, etc.) Also, you can no
133+
longer specify scroll behavior per `<Route/>` anymore, only `<Routes/>`
143134

144135
```
145136
<Routes scrollBehavior="scrollToTop"/>
@@ -149,7 +140,7 @@ Also, you can't specify scroll behavior per `<Route/>` anymore.
149140

150141
This was not a public module, but we know some people were using it.
151142
It's gone now. We have made getting at the current routes incredibly
152-
convenient now with the `RouteLookup` mixin.
143+
convenient now with additions to the `ActiveState` mixin.
153144

154145
### `Router.transitionTo, replaceWith, goBack`
155146

@@ -167,9 +158,11 @@ React.createClass({
167158
}
168159
});
169160

170-
// 0.8.x
161+
// 0.9.x
162+
var Navigation = Router.Navigation;
163+
171164
React.createClass({
172-
mixins: [Router.Transitions],
165+
mixins: [Navigation],
173166
whenever: function() {
174167
this.transitionTo('something');
175168
this.replaceWith('something');
@@ -178,7 +171,15 @@ React.createClass({
178171
});
179172
```
180173

174+
0.7.x -> 0.8.x
175+
--------------
176+
177+
Please don't upgrade to `0.8.0`, just skip to `0.9.x`.
181178

179+
`0.8.0` had some transient mixins we didn't intend to document, but had
180+
some miscommunication :( If you were one of three people who used some
181+
of these mixins and need help upgrading from `0.8.0 -> 0.9.x` find us on
182+
freenode in `#rackt` or open a ticket. Thanks!
182183

183184
0.6.x -> 0.7.x
184185
--------------

docs/api/components/Routes.md

-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ One of:
3939
- `'none'` - doesn't do anything (you should probably do something about
4040
that).
4141

42-
### `fixedPath`
43-
44-
TODO
45-
4642
### `onAbortedTransition`
4743

4844
A function called when any transition is aborted.

0 commit comments

Comments
 (0)