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

Remove unnecessary environment check in lib/app.js #4655

Closed
wants to merge 6 commits into from
Closed

Remove unnecessary environment check in lib/app.js #4655

wants to merge 6 commits into from

Conversation

teleginzhenya
Copy link
Contributor

Hello :)

I have removed unnecessary environment check from lib/app.js (Lines 81-85), since lib/utils.js (Lines 2-4) already have it.

if (process.env.NODE_ENV !== 'production') {
warn(`Warning: the 'url' property is deprecated. https://err.sh/next.js/url-deprecated`)
}
warn(`Warning: the 'url' property is deprecated. https://err.sh/next.js/url-deprecated`)
Copy link
Member

Choose a reason for hiding this comment

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

This is totally necessary. We only want to log this in development.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lib/utils.js (Lines 2-4) handles it, doesn’t it?

Copy link
Member

Choose a reason for hiding this comment

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

Also this makes sure we compile it out using webpack, instead of leaving the warn code in production it's compiled away.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was thinking that it handles and can remove unnecessary check. Sorry :)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 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.

2 participants