Skip to content

Conversation

@bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Aug 2, 2017

This avoids strict mode conflicts for certain browsers wrt functions being defined within an if-block. Also re-added the if-DEV condition for the ReactNative renderer since it was removed for this reason.

Relates to this comment on issue #10294.

cc @hallaathrad

Bundle impact

build/dist

No impact

build/facebook-www/*-dev.js

17a18
> (function() {
1679a1681
> })();

build/packages/*/cjs/*-dev.js

17a18
> (function() {
1679a1681
> })();

build/react-native

__DEV__ && function() { // New line
  // Indented contents of previous bundle
}(); // New line

This avoids strict mode conflicts for certain browsers wrt functions being defined within an if-block.
Also re-added the if-DEV condition for the ReactNative renderer since it was removed for this reason.
@gaearon
Copy link
Collaborator

gaearon commented Aug 2, 2017

Did you check Chromium (old versions)?

@bvaughn
Copy link
Contributor Author

bvaughn commented Aug 2, 2017

Yes. Running the react-virtualized demo site with the previous build of React 16 beta failed for Chromium 41. Rebuilding the bundle (with this change) and running it fixes the failure.

@bvaughn bvaughn merged commit 630afb3 into facebook:master Aug 2, 2017
@bvaughn bvaughn deleted the if-dev-iife branch August 2, 2017 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants