Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
924f8ae3
Unverified
Commit
924f8ae3
authored
Feb 05, 2020
by
JJ Kasper
Committed by
GitHub
Feb 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old ts-ignores and extra value in routeInfo (#10429)
parent
0b1ef7cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
router.ts
packages/next/next-server/lib/router/router.ts
+1
-7
No files found.
packages/next/next-server/lib/router/router.ts
View file @
924f8ae3
...
...
@@ -150,7 +150,6 @@ export default class Router implements BaseRouter {
// Backwards compat for Router.router.events
// TODO: Should be remove the following major version as it was never documented
// @ts-ignore backwards compatibility
this
.
events
=
Router
.
events
this
.
pageLoader
=
pageLoader
...
...
@@ -355,7 +354,6 @@ export default class Router implements BaseRouter {
method
=
'replaceState'
}
// @ts-ignore pathname is always a string
const
route
=
toRoute
(
pathname
)
const
{
shallow
=
false
}
=
options
...
...
@@ -394,7 +392,6 @@ export default class Router implements BaseRouter {
Router
.
events
.
emit
(
'routeChangeStart'
,
as
)
// If shallow is true and the route exists in the router cache we reuse the previous result
// @ts-ignore pathname is always a string
this
.
getRouteInfo
(
route
,
pathname
,
query
,
as
,
shallow
).
then
(
routeInfo
=>
{
const
{
error
}
=
routeInfo
...
...
@@ -404,7 +401,6 @@ export default class Router implements BaseRouter {
Router
.
events
.
emit
(
'beforeHistoryChange'
,
as
)
this
.
changeState
(
method
,
url
,
addBasePath
(
as
),
options
)
const
hash
=
window
.
location
.
hash
.
substring
(
1
)
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
const
appComp
:
any
=
this
.
components
[
'/_app'
].
Component
...
...
@@ -413,8 +409,7 @@ export default class Router implements BaseRouter {
!
(
routeInfo
.
Component
as
any
).
getInitialProps
}
// @ts-ignore pathname is always defined
this
.
set
(
route
,
pathname
,
query
,
as
,
{
...
routeInfo
,
hash
})
this
.
set
(
route
,
pathname
,
query
,
as
,
routeInfo
)
if
(
error
)
{
Router
.
events
.
emit
(
'routeChangeError'
,
error
,
as
)
...
...
@@ -658,7 +653,6 @@ export default class Router implements BaseRouter {
return
}
// @ts-ignore pathname is always defined
const
route
=
toRoute
(
pathname
)
this
.
pageLoader
.
prefetch
(
route
).
then
(
resolve
,
reject
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment