Skip to content

Commit 69c4f67

Browse files
committed
Version 0.13.1
1 parent d12e9de commit 69c4f67

File tree

7 files changed

+64
-58
lines changed

7 files changed

+64
-58
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v0.13.1 - Fri, 20 Mar 2015 22:21:57 GMT
2+
---------------------------------------
3+
4+
-
5+
6+
17
v0.13.0 - Fri, 20 Mar 2015 21:25:35 GMT
28
---------------------------------------
39

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "0.13.0",
3+
"version": "0.13.1",
44
"description": "A complete routing library for React.js",
55
"main": "build/global/ReactRouter.js",
66
"homepage": "https://github.com/rackt/react-router",

build/global/ReactRouter.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -1594,9 +1594,9 @@ return /******/ (function(modules) { // webpackBootstrap
15941594
},
15951595

15961596
clearAllRoutes: function clearAllRoutes() {
1597-
this.cancelPendingTransition();
1598-
this.namedRoutes = {};
1599-
this.routes = [];
1597+
Router.cancelPendingTransition();
1598+
Router.namedRoutes = {};
1599+
Router.routes = [];
16001600
},
16011601

16021602
/**
@@ -1605,18 +1605,18 @@ return /******/ (function(modules) { // webpackBootstrap
16051605
addRoutes: function addRoutes(routes) {
16061606
if (isReactChildren(routes)) routes = createRoutesFromReactChildren(routes);
16071607

1608-
addRoutesToNamedRoutes(routes, this.namedRoutes);
1608+
addRoutesToNamedRoutes(routes, Router.namedRoutes);
16091609

1610-
this.routes.push.apply(this.routes, routes);
1610+
Router.routes.push.apply(Router.routes, routes);
16111611
},
16121612

16131613
/**
16141614
* Replaces routes of this router from the given children object (see ReactChildren).
16151615
*/
16161616
replaceRoutes: function replaceRoutes(routes) {
1617-
this.clearAllRoutes();
1618-
this.addRoutes(routes);
1619-
this.refresh();
1617+
Router.clearAllRoutes();
1618+
Router.addRoutes(routes);
1619+
Router.refresh();
16201620
},
16211621

16221622
/**
@@ -1625,7 +1625,7 @@ return /******/ (function(modules) { // webpackBootstrap
16251625
* match can be made.
16261626
*/
16271627
match: function match(path) {
1628-
return Match.findMatch(this.routes, path);
1628+
return Match.findMatch(Router.routes, path);
16291629
},
16301630

16311631
/**
@@ -1637,7 +1637,7 @@ return /******/ (function(modules) { // webpackBootstrap
16371637
if (PathUtils.isAbsolute(to)) {
16381638
path = to;
16391639
} else {
1640-
var route = to instanceof Route ? to : this.namedRoutes[to];
1640+
var route = to instanceof Route ? to : Router.namedRoutes[to];
16411641

16421642
invariant(route instanceof Route, "Cannot find a route named \"%s\"", to);
16431643

@@ -1652,7 +1652,7 @@ return /******/ (function(modules) { // webpackBootstrap
16521652
* to the route with the given name, URL parameters, and query.
16531653
*/
16541654
makeHref: function makeHref(to, params, query) {
1655-
var path = this.makePath(to, params, query);
1655+
var path = Router.makePath(to, params, query);
16561656
return location === HashLocation ? "#" + path : path;
16571657
},
16581658

@@ -1661,7 +1661,7 @@ return /******/ (function(modules) { // webpackBootstrap
16611661
* a new URL onto the history stack.
16621662
*/
16631663
transitionTo: function transitionTo(to, params, query) {
1664-
var path = this.makePath(to, params, query);
1664+
var path = Router.makePath(to, params, query);
16651665

16661666
if (pendingTransition) {
16671667
// Replace so pending location does not stay in history.
@@ -1676,7 +1676,7 @@ return /******/ (function(modules) { // webpackBootstrap
16761676
* the current URL in the history stack.
16771677
*/
16781678
replaceWith: function replaceWith(to, params, query) {
1679-
location.replace(this.makePath(to, params, query));
1679+
location.replace(Router.makePath(to, params, query));
16801680
},
16811681

16821682
/**
@@ -1707,7 +1707,7 @@ return /******/ (function(modules) { // webpackBootstrap
17071707
if (abortReason instanceof Cancellation) {
17081708
return;
17091709
} else if (abortReason instanceof Redirect) {
1710-
location.replace(this.makePath(abortReason.to, abortReason.params, abortReason.query));
1710+
location.replace(Router.makePath(abortReason.to, abortReason.params, abortReason.query));
17111711
} else {
17121712
location.pop();
17131713
}
@@ -1719,7 +1719,7 @@ return /******/ (function(modules) { // webpackBootstrap
17191719
},
17201720

17211721
handleLocationChange: function handleLocationChange(change) {
1722-
this.dispatch(change.path, change.type);
1722+
Router.dispatch(change.path, change.type);
17231723
},
17241724

17251725
/**
@@ -1739,7 +1739,7 @@ return /******/ (function(modules) { // webpackBootstrap
17391739
* hooks wait, the transition is fully synchronous.
17401740
*/
17411741
dispatch: function dispatch(path, action) {
1742-
this.cancelPendingTransition();
1742+
Router.cancelPendingTransition();
17431743

17441744
var prevPath = state.path;
17451745
var isRefreshing = action == null;
@@ -1750,9 +1750,9 @@ return /******/ (function(modules) { // webpackBootstrap
17501750

17511751
// Record the scroll position as early as possible to
17521752
// get it before browsers try update it automatically.
1753-
if (prevPath && action === LocationActions.PUSH) this.recordScrollPosition(prevPath);
1753+
if (prevPath && action === LocationActions.PUSH) Router.recordScrollPosition(prevPath);
17541754

1755-
var match = this.match(path);
1755+
var match = Router.match(path);
17561756

17571757
warning(match != null, "No route matches path \"%s\". Make sure you have <Route path=\"%s\"> somewhere in your routes", path, path);
17581758

@@ -1780,7 +1780,7 @@ return /******/ (function(modules) { // webpackBootstrap
17801780
toRoutes = nextRoutes;
17811781
}
17821782

1783-
var transition = new Transition(path, this.replaceWith.bind(this, path));
1783+
var transition = new Transition(path, Router.replaceWith.bind(Router, path));
17841784
pendingTransition = transition;
17851785

17861786
var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length);
@@ -1809,7 +1809,7 @@ return /******/ (function(modules) { // webpackBootstrap
18091809
* Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation).
18101810
*/
18111811
run: function run(callback) {
1812-
invariant(!this.isRunning, "Router is already running");
1812+
invariant(!Router.isRunning, "Router is already running");
18131813

18141814
dispatchHandler = function (error, transition, newState) {
18151815
if (error) Router.handleError(error);
@@ -1821,30 +1821,30 @@ return /******/ (function(modules) { // webpackBootstrap
18211821
if (transition.abortReason) {
18221822
Router.handleAbort(transition.abortReason);
18231823
} else {
1824-
callback.call(this, this, nextState = newState);
1824+
callback.call(Router, Router, nextState = newState);
18251825
}
18261826
};
18271827

18281828
if (!(location instanceof StaticLocation)) {
1829-
if (location.addChangeListener) location.addChangeListener(Router.handleLocationChange.bind(Router));
1829+
if (location.addChangeListener) location.addChangeListener(Router.handleLocationChange);
18301830

1831-
this.isRunning = true;
1831+
Router.isRunning = true;
18321832
}
18331833

18341834
// Bootstrap using the current path.
1835-
this.refresh();
1835+
Router.refresh();
18361836
},
18371837

18381838
refresh: function refresh() {
18391839
Router.dispatch(location.getCurrentPath(), null);
18401840
},
18411841

18421842
stop: function stop() {
1843-
this.cancelPendingTransition();
1843+
Router.cancelPendingTransition();
18441844

1845-
if (location.removeChangeListener) location.removeChangeListener(Router.handleLocationChange.bind(Router));
1845+
if (location.removeChangeListener) location.removeChangeListener(Router.handleLocationChange);
18461846

1847-
this.isRunning = false;
1847+
Router.isRunning = false;
18481848
},
18491849

18501850
getLocation: function getLocation() {

build/global/ReactRouter.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/npm/lib/createRouter.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ function createRouter(options) {
151151
},
152152

153153
clearAllRoutes: function clearAllRoutes() {
154-
this.cancelPendingTransition();
155-
this.namedRoutes = {};
156-
this.routes = [];
154+
Router.cancelPendingTransition();
155+
Router.namedRoutes = {};
156+
Router.routes = [];
157157
},
158158

159159
/**
@@ -162,18 +162,18 @@ function createRouter(options) {
162162
addRoutes: function addRoutes(routes) {
163163
if (isReactChildren(routes)) routes = createRoutesFromReactChildren(routes);
164164

165-
addRoutesToNamedRoutes(routes, this.namedRoutes);
165+
addRoutesToNamedRoutes(routes, Router.namedRoutes);
166166

167-
this.routes.push.apply(this.routes, routes);
167+
Router.routes.push.apply(Router.routes, routes);
168168
},
169169

170170
/**
171171
* Replaces routes of this router from the given children object (see ReactChildren).
172172
*/
173173
replaceRoutes: function replaceRoutes(routes) {
174-
this.clearAllRoutes();
175-
this.addRoutes(routes);
176-
this.refresh();
174+
Router.clearAllRoutes();
175+
Router.addRoutes(routes);
176+
Router.refresh();
177177
},
178178

179179
/**
@@ -182,7 +182,7 @@ function createRouter(options) {
182182
* match can be made.
183183
*/
184184
match: function match(path) {
185-
return Match.findMatch(this.routes, path);
185+
return Match.findMatch(Router.routes, path);
186186
},
187187

188188
/**
@@ -194,7 +194,7 @@ function createRouter(options) {
194194
if (PathUtils.isAbsolute(to)) {
195195
path = to;
196196
} else {
197-
var route = to instanceof Route ? to : this.namedRoutes[to];
197+
var route = to instanceof Route ? to : Router.namedRoutes[to];
198198

199199
invariant(route instanceof Route, "Cannot find a route named \"%s\"", to);
200200

@@ -209,7 +209,7 @@ function createRouter(options) {
209209
* to the route with the given name, URL parameters, and query.
210210
*/
211211
makeHref: function makeHref(to, params, query) {
212-
var path = this.makePath(to, params, query);
212+
var path = Router.makePath(to, params, query);
213213
return location === HashLocation ? "#" + path : path;
214214
},
215215

@@ -218,7 +218,7 @@ function createRouter(options) {
218218
* a new URL onto the history stack.
219219
*/
220220
transitionTo: function transitionTo(to, params, query) {
221-
var path = this.makePath(to, params, query);
221+
var path = Router.makePath(to, params, query);
222222

223223
if (pendingTransition) {
224224
// Replace so pending location does not stay in history.
@@ -233,7 +233,7 @@ function createRouter(options) {
233233
* the current URL in the history stack.
234234
*/
235235
replaceWith: function replaceWith(to, params, query) {
236-
location.replace(this.makePath(to, params, query));
236+
location.replace(Router.makePath(to, params, query));
237237
},
238238

239239
/**
@@ -264,7 +264,7 @@ function createRouter(options) {
264264
if (abortReason instanceof Cancellation) {
265265
return;
266266
} else if (abortReason instanceof Redirect) {
267-
location.replace(this.makePath(abortReason.to, abortReason.params, abortReason.query));
267+
location.replace(Router.makePath(abortReason.to, abortReason.params, abortReason.query));
268268
} else {
269269
location.pop();
270270
}
@@ -276,7 +276,7 @@ function createRouter(options) {
276276
},
277277

278278
handleLocationChange: function handleLocationChange(change) {
279-
this.dispatch(change.path, change.type);
279+
Router.dispatch(change.path, change.type);
280280
},
281281

282282
/**
@@ -296,7 +296,7 @@ function createRouter(options) {
296296
* hooks wait, the transition is fully synchronous.
297297
*/
298298
dispatch: function dispatch(path, action) {
299-
this.cancelPendingTransition();
299+
Router.cancelPendingTransition();
300300

301301
var prevPath = state.path;
302302
var isRefreshing = action == null;
@@ -307,9 +307,9 @@ function createRouter(options) {
307307

308308
// Record the scroll position as early as possible to
309309
// get it before browsers try update it automatically.
310-
if (prevPath && action === LocationActions.PUSH) this.recordScrollPosition(prevPath);
310+
if (prevPath && action === LocationActions.PUSH) Router.recordScrollPosition(prevPath);
311311

312-
var match = this.match(path);
312+
var match = Router.match(path);
313313

314314
warning(match != null, "No route matches path \"%s\". Make sure you have <Route path=\"%s\"> somewhere in your routes", path, path);
315315

@@ -337,7 +337,7 @@ function createRouter(options) {
337337
toRoutes = nextRoutes;
338338
}
339339

340-
var transition = new Transition(path, this.replaceWith.bind(this, path));
340+
var transition = new Transition(path, Router.replaceWith.bind(Router, path));
341341
pendingTransition = transition;
342342

343343
var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length);
@@ -366,7 +366,7 @@ function createRouter(options) {
366366
* Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation).
367367
*/
368368
run: function run(callback) {
369-
invariant(!this.isRunning, "Router is already running");
369+
invariant(!Router.isRunning, "Router is already running");
370370

371371
dispatchHandler = function (error, transition, newState) {
372372
if (error) Router.handleError(error);
@@ -378,30 +378,30 @@ function createRouter(options) {
378378
if (transition.abortReason) {
379379
Router.handleAbort(transition.abortReason);
380380
} else {
381-
callback.call(this, this, nextState = newState);
381+
callback.call(Router, Router, nextState = newState);
382382
}
383383
};
384384

385385
if (!(location instanceof StaticLocation)) {
386-
if (location.addChangeListener) location.addChangeListener(Router.handleLocationChange.bind(Router));
386+
if (location.addChangeListener) location.addChangeListener(Router.handleLocationChange);
387387

388-
this.isRunning = true;
388+
Router.isRunning = true;
389389
}
390390

391391
// Bootstrap using the current path.
392-
this.refresh();
392+
Router.refresh();
393393
},
394394

395395
refresh: function refresh() {
396396
Router.dispatch(location.getCurrentPath(), null);
397397
},
398398

399399
stop: function stop() {
400-
this.cancelPendingTransition();
400+
Router.cancelPendingTransition();
401401

402-
if (location.removeChangeListener) location.removeChangeListener(Router.handleLocationChange.bind(Router));
402+
if (location.removeChangeListener) location.removeChangeListener(Router.handleLocationChange);
403403

404-
this.isRunning = false;
404+
Router.isRunning = false;
405405
},
406406

407407
getLocation: function getLocation() {

build/npm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "0.13.0",
3+
"version": "0.13.1",
44
"description": "A complete routing library for React.js",
55
"main": "lib",
66
"repository": {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "0.13.0",
3+
"version": "0.13.1",
44
"description": "A complete routing library for React.js",
55
"main": "modules",
66
"repository": {

0 commit comments

Comments
 (0)