Skip to content

Issue: 5013 Added necessary code for firing warning if value is null - #5048

Merged
jimfb merged 1 commit into
react:masterfrom
antsmartian:PR-5013
Oct 15, 2015
Merged

jimfb merged 1 commit into
react:masterfrom
antsmartian:PR-5013

Conversation

@antsmartian

Copy link
Copy Markdown
Contributor

Fix of the issue #5013. Let me know if anything else needs to be done. Thanks.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into the if(__DEV__) check above. We only fire warnings in dev mode.

@jimfb

jimfb commented Oct 5, 2015

Copy link
Copy Markdown
Contributor

We should make sure we only warn once for each error message. Otherwise, for an app that renders often, we will fill the error logs with 10,000 copies of this message. See how I did this in https://github.com/facebook/react/pull/5032/files with variables like didWarnCheckedLink

@jimfb jimfb added this to the 0.15 milestone Oct 5, 2015
@jimfb

jimfb commented Oct 7, 2015

Copy link
Copy Markdown
Contributor

@antoaravinth Ok, we're merging 0.15 stuff now. Can you rebase and fix the feedbacks above? Thanks!

@antsmartian

Copy link
Copy Markdown
Contributor Author

@jimfb : Sure. Once the merging is done, I can do the rebase and fix the issues that you have mentioned as well. Thanks.

@jimfb

jimfb commented Oct 8, 2015

Copy link
Copy Markdown
Contributor

@antoaravinth Most of the 0.15 stuff is merged. I don't see any merge conflicts yet (I'm actually a little surprised, I expected #5032 to conflict).

Anyway, we should go ahead and update this PR with the feedback above before merging this change in. You can do that by pushing your changes to the same branch in your github fork.

@antsmartian

Copy link
Copy Markdown
Contributor Author

@jimfb: Sure will do the same.

@antsmartian

Copy link
Copy Markdown
Contributor Author

@jimfb : Thanks for your help, I have rebased and pushed the necessary changes. Kindly let me know if anything else is pending from my side.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@antoaravinth updated the pull request.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a missing " or " between component and undefined

@jimfb

jimfb commented Oct 14, 2015

Copy link
Copy Markdown
Contributor

@pluma Looks like there are still two commits in this PR. Maybe try squashing one more time?

@spicyj This looks good to me. Any last change requests before we merge?

@pluma

pluma commented Oct 14, 2015

Copy link
Copy Markdown
Contributor

@jimfb Yeah, that's because you're looking at the wrong PR 😉

Hint: #5140 is the one you should be looking at.

@jimfb

jimfb commented Oct 14, 2015

Copy link
Copy Markdown
Contributor

Oops, correct PR, wrong person. I meant to ping @antoaravinth

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This formatting doesn't match our style, see any other warning or invariant callsite for examples.

Also, please remove the empty line above the condition.

Edit: further details on formatting long strings like this: blank space should go at the end of the preceding line.

'foo bar. ' +
'baz'

Fixed the lint issues

Added logic for handling the warning only once and added the test cases for the same. Also moved the warning part to only DEV mode

Changed few lines related to the formatting issues

Removing the empty whitespace
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@antoaravinth updated the pull request.

@antsmartian

Copy link
Copy Markdown
Contributor Author

@zpao @jimfb Done, let me know if anything else is needed from my side.

jimfb added a commit that referenced this pull request Oct 15, 2015
Issue: 5013 Added necessary code for firing warning if value is null
@jimfb
jimfb merged commit b735dd4 into react:master Oct 15, 2015
@jimfb

jimfb commented Oct 15, 2015

Copy link
Copy Markdown
Contributor

Looks great, thanks @antoaravinth!

@sophiebits

Copy link
Copy Markdown
Contributor

This warning should really include the owner.

@jimfb

jimfb commented Oct 15, 2015

Copy link
Copy Markdown
Contributor

@spicyj Yeah, that would be good. How would we feel about including the parent/debug path from #5167?

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.

6 participants