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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/with-absolute-imports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"start": "next start"
},
"dependencies": {
"babel-plugin-module-resolver": "^2.7.1",
"next": "latest",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"devDependencies": {
"babel-plugin-module-resolver": "^3.1.1"
}
}
8 changes: 0 additions & 8 deletions examples/with-universal-configuration/.babelrc

This file was deleted.

6 changes: 6 additions & 0 deletions examples/with-universal-configuration/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const env = require('./env-config.js')

module.exports = {
presets: ['next/babel'],
plugins: [['transform-define', env]]
}
2 changes: 1 addition & 1 deletion examples/with-universal-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"react-dom": "^16.0.0"
},
"devDependencies": {
"babel-plugin-transform-define": "^1.2.0"
"babel-plugin-transform-define": "^1.3.0"
},
"license": "ISC"
}
4 changes: 1 addition & 3 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ export class Container extends Component {
}

const warnUrl = execOnce(() => {
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 :)

})

export function createUrl (router) {
Expand Down