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

Added double newline delimiters to dynamically-populated warnings #8754

Closed
wants to merge 1 commit into from

Conversation

richiethomas
Copy link
Contributor

  • 'getDeclarationErrorAddendum' function of ReactDOMComponent.js
  • 'getSourceInfoErrorAddendum' function of ReactElementValidator.js
  • 'getDeclarationErrorAddendum' function of instantiateReactComponent.js and ReactElementValidator.js
  • 'traverseAllChildrenImpl' function of traverseAllChildren.js
  • 'attachRef' function of ReactRef.js
  • 'mountIndeterminateComponent' function of ReactFiberBeginWork.js
  • 'createFiberFromElementType' function of ReactFiber.js
  • 'getDeclarationErrorAddendum' function of ReactDOMSelect.js
  • 'unmountComponentAtNode' function of ReactMount.js
  • 'getDeclarationErrorAddendum' function of ReactControlledValuePropTypes.js
  • 'checkRenderMessage' function of CSSPropertyOperations.js
  • 'getDeclarationErrorAddendum' function of ReactDomFiberSelect.js
  • 'getCurrentComponentErrorInfo' function in 'ReactElementValidator'
  • 'getDeclarationErrorAddendum' function in ReactDOMFiberComponent.js

Fixes #8719

Before submitting a pull request, please make sure the following is done...

  1. Fork the repo and create your branch from master.
  2. If you've added code that should be tested, add tests!
  3. If you've changed APIs, update the documentation.
  4. Ensure the test suite passes (npm test).
  5. Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.
  6. If you haven't already, complete the CLA.

@gaearon
Copy link
Collaborator

gaearon commented Jan 12, 2017

I'll review after you find the others: #8719 (comment).
Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Jan 13, 2017

@richiethomas Is this ready for review?

@richiethomas
Copy link
Contributor Author

@gaearon yes, just pushed the last of the newlines yesterday.

@@ -44,7 +44,7 @@ var ReactNativeTagHandles = {
assertRootTag: function(tag: number): void {
invariant(
this.reactTagIsNativeTopRootID(tag),
'Expect a native root tag, instead got %s', tag
'\n\nExpect a native root tag, instead got %s', tag
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't look right to me. It puts a newline before the whole message, not before the addendum.
(There is no addendum here.)

Also, I would prefer if we avoided modifying invariant messages. Let’s stick to warnings for now.

        * 'beginLifeCycleTimer' function of ReactDebugTool.js
        * 'findDOMNode' function of findDOMNode.js
        * 'bindAutoBindMethod' function of ReactClass.js
        * 'warnNoop' function of ReactServerUpdateQueue.js
        * 'getInternalInstanceReadyForUpdate' function of ReactUpdateQueue.js
        * 'warnNoop' function of ReactNoopUpdateQueue.js
        * 'getDeclarationErrorAddendum' function of ReactDOMComponent.js
        * 'getSourceInfoErrorAddendum' function of ReactElementValidator.js
        * 'getDeclarationErrorAddendum' function of instantiateReactComponent.js and ReactElementValidator.js
        * 'traverseAllChildrenImpl' function of traverseAllChildren.js
        * 'attachRef' function of ReactRef.js
        * 'mountIndeterminateComponent' function of ReactFiberBeginWork.js
        * 'createFiberFromElementType' function of ReactFiber.js
        * 'getDeclarationErrorAddendum' function of ReactDOMSelect.js
        * 'unmountComponentAtNode' function of ReactMount.js
        * 'getDeclarationErrorAddendum' function of ReactControlledValuePropTypes.js
        * 'checkRenderMessage' function of CSSPropertyOperations.js
        * 'getDeclarationErrorAddendum' function of ReactDomFiberSelect.js
        * 'getCurrentComponentErrorInfo' function in 'ReactElementValidator'
        * 'getDeclarationErrorAddendum' function in ReactDOMFiberComponent.js
@gaearon
Copy link
Collaborator

gaearon commented Jan 13, 2017

You don't need to close the PR—can just push a new commit on top.

@richiethomas
Copy link
Contributor Author

Right, sorry I keep forgetting. :) This PR removes the delimiters from all calls to 'invariant'.

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