Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make next/router a client only API. #443

Merged
merged 3 commits into from
Dec 20, 2016

Conversation

arunoda
Copy link
Contributor

@arunoda arunoda commented Dec 20, 2016

Using next/router inside the server makes API unpredictable and we cannot support it anywhere.
So, with this PR now we are making this as a client side API.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.3%) to 60.808% when pulling f0afe9a on arunoda:restrict-next-router-usage into 660147f on zeit:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+2.3%) to 60.808% when pulling f0afe9a on arunoda:restrict-next-router-usage into 660147f on zeit:master.

@coveralls
Copy link

coveralls commented Dec 20, 2016

Coverage Status

Coverage increased (+2.3%) to 60.808% when pulling 84a4dcd on arunoda:restrict-next-router-usage into 660147f on zeit:master.

@arunoda arunoda changed the title Restrict the next/router usage only in selected places Make next/router a client only API. Dec 20, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 58.174% when pulling dd33235 on arunoda:restrict-next-router-usage into 660147f on zeit:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 58.174% when pulling dd33235 on arunoda:restrict-next-router-usage into 660147f on zeit:master.

@@ -6,7 +6,7 @@ let router = null
const SingletonRouter = {}

// Create public properties and methods of the router in the SingletonRouter
const propertyFields = ['route', 'components', 'pathname', 'query']
const propertyFields = ['components', 'pathname', 'route', 'query']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkzawa I think we still need to keep these because they are pretty useful when doing custom routing.

If used for rendering, it'll throw an error in the SSR process.
So, I think that's fine.

@rauchg rauchg merged commit 141c045 into vercel:master Dec 20, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants