Skip to content

Commit b8f1600

Browse files
committed
Version 0.12.4
1 parent 5768506 commit b8f1600

12 files changed

+88
-56
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v0.12.4 - Tue, 24 Feb 2015 21:53:02 GMT
2+
---------------------------------------
3+
4+
- [5768506](../../commit/5768506) [fixed] Build generation
5+
6+
17
v0.12.3 - Tue, 24 Feb 2015 21:37:49 GMT
28
---------------------------------------
39

Diff for: bower.json

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

Diff for: build/global/ReactRouter.js

+36-23
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ return /******/ (function(modules) { // webpackBootstrap
15061506
* match can be made.
15071507
*/
15081508
match: function match(path) {
1509-
return Match.findMatchForPath(this.routes, path);
1509+
return Match.findMatch(this.routes, path);
15101510
},
15111511

15121512
/**
@@ -2456,21 +2456,13 @@ return /******/ (function(modules) { // webpackBootstrap
24562456

24572457
"use strict";
24582458

2459+
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };
2460+
24592461
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
24602462

24612463
/* jshint -W084 */
2462-
24632464
var PathUtils = __webpack_require__(25);
24642465

2465-
var Match = function Match(pathname, params, query, routes) {
2466-
_classCallCheck(this, Match);
2467-
2468-
this.pathname = pathname;
2469-
this.params = params;
2470-
this.query = query;
2471-
this.routes = routes;
2472-
};
2473-
24742466
function deepSearch(route, pathname, query) {
24752467
// Check the subtree first to find the most deeply-nested match.
24762468
var childRoutes = route.childRoutes;
@@ -2504,20 +2496,41 @@ return /******/ (function(modules) { // webpackBootstrap
25042496
}return null;
25052497
}
25062498

2507-
/**
2508-
* Attempts to match depth-first a route in the given route's
2509-
* subtree against the given path and returns the match if it
2510-
* succeeds, null if no match can be made.
2511-
*/
2512-
Match.findMatchForPath = function (routes, path) {
2513-
var pathname = PathUtils.withoutQuery(path);
2514-
var query = PathUtils.extractQuery(path);
2515-
var match = null;
2499+
var Match = (function () {
2500+
function Match(pathname, params, query, routes) {
2501+
_classCallCheck(this, Match);
25162502

2517-
for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query);
2503+
this.pathname = pathname;
2504+
this.params = params;
2505+
this.query = query;
2506+
this.routes = routes;
2507+
}
25182508

2519-
return match;
2520-
};
2509+
_prototypeProperties(Match, {
2510+
findMatch: {
2511+
2512+
/**
2513+
* Attempts to match depth-first a route in the given route's
2514+
* subtree against the given path and returns the match if it
2515+
* succeeds, null if no match can be made.
2516+
*/
2517+
2518+
value: function findMatch(routes, path) {
2519+
var pathname = PathUtils.withoutQuery(path);
2520+
var query = PathUtils.extractQuery(path);
2521+
var match = null;
2522+
2523+
for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query);
2524+
2525+
return match;
2526+
},
2527+
writable: true,
2528+
configurable: true
2529+
}
2530+
});
2531+
2532+
return Match;
2533+
})();
25212534

25222535
module.exports = Match;
25232536

Diff for: 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.

Diff for: build/npm/lib/Match.js

+35-22
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
"use strict";
22

3+
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };
4+
35
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
46

57
/* jshint -W084 */
6-
78
var PathUtils = require("./PathUtils");
89

9-
var Match = function Match(pathname, params, query, routes) {
10-
_classCallCheck(this, Match);
11-
12-
this.pathname = pathname;
13-
this.params = params;
14-
this.query = query;
15-
this.routes = routes;
16-
};
17-
1810
function deepSearch(route, pathname, query) {
1911
// Check the subtree first to find the most deeply-nested match.
2012
var childRoutes = route.childRoutes;
@@ -48,19 +40,40 @@ function deepSearch(route, pathname, query) {
4840
}return null;
4941
}
5042

51-
/**
52-
* Attempts to match depth-first a route in the given route's
53-
* subtree against the given path and returns the match if it
54-
* succeeds, null if no match can be made.
55-
*/
56-
Match.findMatchForPath = function (routes, path) {
57-
var pathname = PathUtils.withoutQuery(path);
58-
var query = PathUtils.extractQuery(path);
59-
var match = null;
43+
var Match = (function () {
44+
function Match(pathname, params, query, routes) {
45+
_classCallCheck(this, Match);
46+
47+
this.pathname = pathname;
48+
this.params = params;
49+
this.query = query;
50+
this.routes = routes;
51+
}
52+
53+
_prototypeProperties(Match, {
54+
findMatch: {
55+
56+
/**
57+
* Attempts to match depth-first a route in the given route's
58+
* subtree against the given path and returns the match if it
59+
* succeeds, null if no match can be made.
60+
*/
61+
62+
value: function findMatch(routes, path) {
63+
var pathname = PathUtils.withoutQuery(path);
64+
var query = PathUtils.extractQuery(path);
65+
var match = null;
6066

61-
for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query);
67+
for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query);
68+
69+
return match;
70+
},
71+
writable: true,
72+
configurable: true
73+
}
74+
});
6275

63-
return match;
64-
};
76+
return Match;
77+
})();
6578

6679
module.exports = Match;

Diff for: build/npm/lib/utils/Path.js renamed to build/npm/lib/PathUtils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function compilePattern(pattern) {
3535
return _compiledPatterns[pattern];
3636
}
3737

38-
var Path = {
38+
var PathUtils = {
3939

4040
/**
4141
* Returns true if the given path is absolute.
@@ -137,17 +137,17 @@ var Path = {
137137
* query merged into the query string.
138138
*/
139139
withQuery: function withQuery(path, query) {
140-
var existingQuery = Path.extractQuery(path);
140+
var existingQuery = PathUtils.extractQuery(path);
141141

142142
if (existingQuery) query = query ? merge(existingQuery, query) : existingQuery;
143143

144144
var queryString = qs.stringify(query, { indices: false });
145145

146146
if (queryString) {
147-
return Path.withoutQuery(path) + "?" + queryString;
147+
return PathUtils.withoutQuery(path) + "?" + queryString;
148148
}return path;
149149
}
150150

151151
};
152152

153-
module.exports = Path;
153+
module.exports = PathUtils;

Diff for: build/npm/lib/utils/TestHandlers.js renamed to build/npm/lib/TestUtils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use strict";
22

33
var React = require("react");
4-
var RouteHandler = require("../components/RouteHandler");
5-
var State = require("../State");
4+
var RouteHandler = require("./components/RouteHandler");
5+
var State = require("./State");
66

77
exports.Nested = React.createClass({
88
displayName: "Nested",

Diff for: build/npm/lib/createRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function createRouter(options) {
166166
* match can be made.
167167
*/
168168
match: function match(path) {
169-
return Match.findMatchForPath(this.routes, path);
169+
return Match.findMatch(this.routes, path);
170170
},
171171

172172
/**
File renamed without changes.

Diff for: 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.12.3",
3+
"version": "0.12.4",
44
"description": "A complete routing library for React.js",
55
"main": "lib",
66
"repository": {

Diff for: package.json

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

0 commit comments

Comments
 (0)