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

Warn when using a minified copy of dev React #5083

Merged
merged 1 commit into from Oct 8, 2015

Conversation

Projects
None yet
6 participants
@sophiebits
Copy link
Collaborator

commented Oct 8, 2015

Fixes #4842.

@syranide

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2015

Idea; since you actually enable name mangling and optimizations separately, what about checking (function() { 0; }).toString().indexOf('0') !== -1 (or return 0+0 and test for +). In the end it doesn't really matter, just thought I'd bring it up.

@@ -74,6 +74,15 @@ if (__DEV__) {
}
}

function testFn() {}
warning(
(testFn.name || testFn.toString()).indexOf('testFn') !== -1,

This comment has been minimized.

Copy link
@gaearon

gaearon Oct 8, 2015

Member

Oh, that's smart.

@jimfb

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2015

@syranide Haha, interesting. In theory, a good optimizer would replace (function() { 0+0; }).toString().indexOf('+') !== -1 with true. But I suspect that's an academic discussion, since I can't think of how detecting optimizations adds much value on top of detecting minification.

@syranide

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2015

@jimfb That applies to the original code as well. It would also be an invalid optimization as toString could have been overloaded elsewhere.

@sophiebits sophiebits force-pushed the sophiebits:warn-min branch from 022f4cf to f3a506b Oct 8, 2015

@jimfb

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2015

👍

sophiebits added a commit that referenced this pull request Oct 8, 2015

Merge pull request #5083 from spicyj/warn-min
Warn when using a minified copy of dev React

@sophiebits sophiebits merged commit 3f57470 into facebook:master Oct 8, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lijunle

This comment has been minimized.

Copy link

commented Nov 17, 2016

Hi, the short URL https://fb.me/react-minification does not redirect to something meaningful now. There is not download page now.

@sophiebits

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 17, 2016

I updated the URL to point somewhere more relevant.

@renovate renovate bot referenced this pull request Feb 2, 2018

Open

Update dependency react to v0.14.9 #29

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.