-
Notifications
You must be signed in to change notification settings - Fork 48.4k
Move DEV only module requires into __DEV__ blocks #10185
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Move DEV only module requires into __DEV__ blocks #10185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, 👍
Do you mind rebasing this? |
@gaearon Done just now, please give it another check when you have time :) thanks! |
@@ -24,7 +24,7 @@ var REACT_ELEMENT_TYPE = | |||
|
|||
if (__DEV__) { | |||
var warning = require('fbjs/lib/warning'); | |||
var {getCurrentStackAddendum} = require('ReactComponentTreeHook'); | |||
var {getStackAddendum} = require('ReactDebugCurrentFrame'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like code change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops nevermind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Let's get this in. It's not a long term solution but at least it's consistent with what we already do. |
Cool :) Thanks |
@trueadm I noticed that in some files there remain invocations of Sorry if commenting on already merged PRs is not recommended, figured I’d try this rather than create a new GitHub issue |
This is related to #10176. Dangling
require()
calls were created from the build due to the usage not being in a__DEV__
block within the source code. This PR aims to move the require calls so they no longer dangle in the production builds.Also, the need to have single quotes within
modulesToStub
blocks has been removed – it was error prone.