Skip to content

Commit d3b7ce5

Browse files
committed
Rename from partialState to partialNextState
1 parent 61c64f7 commit d3b7ce5

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

docs/API.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ A function used to convert an object from [`<Link>`](#link)s or calls to
8585
A function used to convert a query string into an object that gets passed to route component props.
8686

8787
##### `onError(error)`
88-
While the router is matching, errors may bubble up, here is your opportunity to catch and deal with them. Typically these will come from async features like [`route.getComponents`](#getcomponentsnextstate-callback), [`route.getIndexRoute`](#getindexroutelocation-callback), and [`route.getChildRoutes`](#getchildroutesprogressstate-callback).
88+
While the router is matching, errors may bubble up, here is your opportunity to catch and deal with them. Typically these will come from async features like [`route.getComponents`](#getcomponentsnextstate-callback), [`route.getIndexRoute`](#getindexroutelocation-callback), and [`route.getChildRoutes`](#getchildroutespartialnextstate-callback).
8989

9090
##### `onUpdate()`
9191
Called whenever the router updates its state in response to URL changes.
@@ -368,8 +368,8 @@ A plain JavaScript object route definition. `<Router>` turns JSX `<Route>`s into
368368
##### `childRoutes`
369369
An array of child routes, same as `children` in JSX route configs.
370370

371-
##### `getChildRoutes(progressState, callback)`
372-
Same as `childRoutes` but asynchronous and receives the `progressState`. Useful for code-splitting and dynamic route matching (given some state or session data to return a different set of child routes).
371+
##### `getChildRoutes(partialNextState, callback)`
372+
Same as `childRoutes` but asynchronous and receives the `partialNextState`. Useful for code-splitting and dynamic route matching (given some state or session data to return a different set of child routes).
373373

374374
###### `callback` signature
375375
`cb(err, routesArray)`
@@ -399,8 +399,8 @@ let myRoute = {
399399

400400
let myRoute = {
401401
path: 'picture/:id',
402-
getChildRoutes(progressState, cb) {
403-
let { state } = progressState
402+
getChildRoutes(partialNextState, cb) {
403+
let { state } = partialNextState
404404

405405
if (state && state.fromDashboard) {
406406
cb(null, [dashboardPictureRoute])

docs/guides/DynamicRouting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ A router is the perfect place to handle code splitting: it's responsible for set
1010

1111
React Router does all of its [path matching](/docs/guides/RouteMatching.md) and component fetching asynchronously, which allows you to not only load up the components lazily, *but also lazily load the route configuration*. You really only need one route definition in your initial bundle, the router can resolve the rest on demand.
1212

13-
Routes may define [`getChildRoutes`](/docs/API.md#getchildroutesprogressstate-callback), [`getIndexRoute`](/docs/API.md#getindexroutelocation-callback), and [`getComponents`](/docs/API.md#getcomponentsnextstate-callback) methods. These are asynchronous and only called when needed. We call it "gradual matching". React Router will gradually match the URL and fetch only the amount of route configuration and components it needs to match the URL and render.
13+
Routes may define [`getChildRoutes`](/docs/API.md#getchildroutespartialnextstate-callback), [`getIndexRoute`](/docs/API.md#getindexroutelocation-callback), and [`getComponents`](/docs/API.md#getcomponentsnextstate-callback) methods. These are asynchronous and only called when needed. We call it "gradual matching". React Router will gradually match the URL and fetch only the amount of route configuration and components it needs to match the URL and render.
1414

1515
Coupled with a smart code splitting tool like [webpack](http://webpack.github.io/), a once tiresome architecture is now simple and declarative.
1616

1717
```js
1818
const CourseRoute = {
1919
path: 'course/:courseId',
2020

21-
getChildRoutes(progressState, callback) {
21+
getChildRoutes(partialNextState, callback) {
2222
require.ensure([], function (require) {
2323
callback(null, [
2424
require('./routes/Announcements'),

examples/huge-apps/routes/Course/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
path: 'course/:courseId',
33

4-
getChildRoutes(progressState, cb) {
4+
getChildRoutes(partialNextState, cb) {
55
require.ensure([], (require) => {
66
cb(null, [
77
require('./routes/Announcements'),

examples/huge-apps/routes/Course/routes/Announcements/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
path: 'announcements',
33

4-
getChildRoutes(progressState, cb) {
4+
getChildRoutes(partialNextState, cb) {
55
require.ensure([], (require) => {
66
cb(null, [
77
require('./routes/Announcement')

examples/huge-apps/routes/Course/routes/Assignments/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
path: 'assignments',
33

4-
getChildRoutes(progressState, cb) {
4+
getChildRoutes(partialNextState, cb) {
55
require.ensure([], (require) => {
66
cb(null, [
77
require('./routes/Assignment')

modules/__tests__/matchRoutes-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ describe('matchRoutes', function () {
262262
if (childRoutes) {
263263
delete route.childRoutes
264264

265-
route.getChildRoutes = function (progressState, callback) {
265+
route.getChildRoutes = function (partialNextState, callback) {
266266
setTimeout(function () {
267267
callback(null, childRoutes)
268268
})
@@ -294,7 +294,7 @@ describe('matchRoutes', function () {
294294
let getChildRoutes, getIndexRoute, jsxRoutes
295295

296296
beforeEach(function () {
297-
getChildRoutes = function (progressState, callback) {
297+
getChildRoutes = function (partialNextState, callback) {
298298
setTimeout(function () {
299299
callback(null, <Route path=":userID" />)
300300
})

modules/matchRoutes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ function getChildRoutes(route, location, paramNames, paramValues, remainingPathn
1313
return []
1414
}
1515

16-
let sync = true, result, progressStateWithLocation
17-
const progressState = {
16+
let sync = true, result, partialNextStateWithLocation
17+
const partialNextState = {
1818
params: createParams(paramNames, paramValues),
1919
remainingPathname
2020
}
2121

2222
if (__DEV__ && canUseMembrane) {
23-
progressStateWithLocation = deprecateLocationProperties(progressState, location)
23+
partialNextStateWithLocation = deprecateLocationProperties(partialNextState, location)
2424
} else {
25-
progressStateWithLocation = { ...progressState, ...location }
25+
partialNextStateWithLocation = { ...partialNextState, ...location }
2626
}
2727

28-
route.getChildRoutes(progressStateWithLocation, function (error, childRoutes) {
28+
route.getChildRoutes(partialNextStateWithLocation, function (error, childRoutes) {
2929
childRoutes = !error && createRoutes(childRoutes)
3030
if (sync) {
3131
result = [ error, childRoutes ]

0 commit comments

Comments
 (0)