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

Wrap contents of if-DEV condition in an IIFE #10361

Merged
merged 1 commit into from Aug 2, 2017

Conversation

Projects
None yet
3 participants
@bvaughn
Contributor

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
Wrap contents of if-DEV condition in an IIFE
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

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Aug 2, 2017

Member

Did you check Chromium (old versions)?

Member

gaearon commented Aug 2, 2017

Did you check Chromium (old versions)?

@gaearon

gaearon approved these changes Aug 2, 2017

@bvaughn

This comment has been minimized.

Show comment
Hide comment
@bvaughn

bvaughn Aug 2, 2017

Contributor

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.

Contributor

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

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@bvaughn bvaughn deleted the bvaughn:if-dev-iife branch Aug 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment