Skip to content

Commit d88e936

Browse files
taiontimdorr
authored andcommitted
Remove more deprecations (#3603)
1 parent fe37031 commit d88e936

File tree

5 files changed

+11
-133
lines changed

5 files changed

+11
-133
lines changed

docs/API.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ This is primarily for integrating with other libraries that need to participate
8181

8282
Ensure that you render a `<RouterContext>` at the end of the line, passing all the props passed to `render`.
8383

84-
##### `stringifyQuery(queryObject)` (deprecated)
85-
86-
##### `parseQueryString(queryString)` (deprecated)
87-
8884

8985
#### Examples
9086
Please see the [`examples/`](/examples) directory of the repository for extensive examples of using `<Router>`.
@@ -124,12 +120,6 @@ If `true`, the `<Link>` will only be active when the current route exactly match
124120
##### *others*
125121
You can also pass props you'd like to be on the `<a>` such as a `title`, `id`, `className`, etc.
126122

127-
##### `query` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
128-
129-
##### `hash` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
130-
131-
##### `state` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
132-
133123
#### Example
134124
Given a route like `<Route path="/users/:userId" />`:
135125

modules/__tests__/matchRoutes-test.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import expect from 'expect'
22
import { createMemoryHistory } from 'history'
33
import React from 'react'
4-
import { canUseMembrane } from '../deprecateObjectProperties'
54
import IndexRoute from '../IndexRoute'
65
import matchRoutes from '../matchRoutes'
76
import Route from '../Route'
@@ -335,13 +334,6 @@ describe('matchRoutes', function () {
335334
expect(partialNextState.params).toEqual({ groupId: 'foo' })
336335
expect(partialNextState.location.pathname).toEqual('/foo/users/5')
337336

338-
// Only the calls below this point should emit deprecation warnings.
339-
if (canUseMembrane) {
340-
shouldWarn('deprecated')
341-
}
342-
343-
expect(partialNextState.pathname).toEqual('/foo/users/5')
344-
345337
done()
346338
}
347339
)
@@ -358,13 +350,6 @@ describe('matchRoutes', function () {
358350
expect(partialNextState.params).toEqual({ groupId: 'bar' })
359351
expect(partialNextState.location.pathname).toEqual('/bar/users')
360352

361-
// Only the calls below this point should emit deprecation warnings.
362-
if (canUseMembrane) {
363-
shouldWarn('deprecated')
364-
}
365-
366-
expect(partialNextState.pathname).toEqual('/bar/users')
367-
368353
done()
369354
}
370355
)

modules/deprecateObjectProperties.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

modules/makeStateWithLocation.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

modules/matchRoutes.js

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { loopAsync } from './AsyncUtils'
2-
import makeStateWithLocation from './makeStateWithLocation'
32
import { matchPattern } from './PatternUtils'
43
import warning from './routerWarning'
54
import { createRoutes } from './RouteUtils'
@@ -19,22 +18,15 @@ function getChildRoutes(route, location, paramNames, paramValues, callback) {
1918
params: createParams(paramNames, paramValues)
2019
}
2120

22-
const partialNextStateWithLocation = makeStateWithLocation(
23-
partialNextState, location
24-
)
25-
26-
route.getChildRoutes(
27-
partialNextStateWithLocation,
28-
function (error, childRoutes) {
29-
childRoutes = !error && createRoutes(childRoutes)
30-
if (sync) {
31-
result = [ error, childRoutes ]
32-
return
33-
}
34-
35-
callback(error, childRoutes)
21+
route.getChildRoutes(partialNextState, (error, childRoutes) => {
22+
childRoutes = !error && createRoutes(childRoutes)
23+
if (sync) {
24+
result = [ error, childRoutes ]
25+
return
3626
}
37-
)
27+
28+
callback(error, childRoutes)
29+
})
3830

3931
sync = false
4032
return result // Might be undefined.
@@ -49,16 +41,9 @@ function getIndexRoute(route, location, paramNames, paramValues, callback) {
4941
params: createParams(paramNames, paramValues)
5042
}
5143

52-
const partialNextStateWithLocation = makeStateWithLocation(
53-
partialNextState, location
54-
)
55-
56-
route.getIndexRoute(
57-
partialNextStateWithLocation,
58-
function (error, indexRoute) {
59-
callback(error, !error && createRoutes(indexRoute)[0])
60-
}
61-
)
44+
route.getIndexRoute(partialNextState, (error, indexRoute) => {
45+
callback(error, !error && createRoutes(indexRoute)[0])
46+
})
6247
} else if (route.childRoutes) {
6348
const pathless = route.childRoutes.filter(childRoute => !childRoute.path)
6449

0 commit comments

Comments
 (0)