@samitouri / QOS-React / commits / 4073dc79d7

Remove instrumentation and nesting warning

The nesting warning isn't as important now that we use createElement and I don't want to deal with this just yet.

Sebastian Markbage committed Nov 15, 2016 at 18:11 UTC 4073dc79d7534e58e7a13d1f05c184b66b5f6aa7
1 file changed -68
src/renderers/dom/fiber/ReactDOMFiberComponent.js
-68
@@ -27,7 +27,6 @@ var ReactDOMFiberInput = require('ReactDOMFiberInput');
27 var ReactDOMFiberOption = require('ReactDOMFiberOption');
28 var ReactDOMFiberSelect = require('ReactDOMFiberSelect');
29 var ReactDOMFiberTextarea = require('ReactDOMFiberTextarea');
30 -var ReactInstrumentation = require('ReactInstrumentation');
30 var ReactMultiChild = require('ReactMultiChild');
31 var ReactServerRenderingTransaction = require('ReactServerRenderingTransaction');
32
@@ -37,7 +36,6 @@ var invariant = require('invariant');
36 var isEventSupported = require('isEventSupported');
37 var shallowEqual = require('shallowEqual');
38 var inputValueTracking = require('inputValueTracking');
40 -var validateDOMNesting = require('validateDOMNesting');
39 var warning = require('warning');
40 var didWarnShadyDOM = false;
41
@@ -198,35 +196,6 @@ function optionPostMount() {
196 ReactDOMFiberOption.postMountWrapper(inst);
197 }
198
201 -var setAndValidateContentChildDev = emptyFunction;
202 -if (__DEV__) {
203 - setAndValidateContentChildDev = function(content) {
204 - var hasExistingContent = this._contentDebugID != null;
205 - var debugID = this._debugID;
206 - // This ID represents the inlined child that has no backing instance:
207 - var contentDebugID = -debugID;
208 -
209 - if (content == null) {
210 - if (hasExistingContent) {
211 - ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
212 - }
213 - this._contentDebugID = null;
214 - return;
215 - }
216 -
217 - validateDOMNesting(null, String(content), this, this._ancestorInfo);
218 - this._contentDebugID = contentDebugID;
219 - if (hasExistingContent) {
220 - ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
221 - ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
222 - } else {
223 - ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
224 - ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
225 - ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
226 - }
227 - };
228 -}
229 -
199 // There are so many media events, it makes sense to just
200 // maintain a list rather than create a `trapBubbledEvent` for each
201 var mediaEvents = {
@@ -438,9 +407,6 @@ function createInitialChildren(workInProgress, transaction, props, context, lazy
407 // show within the textarea until it has been focused and blurred again.
408 // https://github.com/facebook/react/issues/6731#issuecomment-254874553
409 if (contentToUse !== '') {
441 - if (__DEV__) {
442 - setAndValidateContentChildDev.call(workInProgress, contentToUse);
443 - }
410 DOMLazyTree.queueText(lazyTree, contentToUse);
411 }
412 } else if (childrenToUse != null) {
@@ -618,30 +584,17 @@ function updateDOMChildren(workInProgress, lastProps, nextProps, transaction, co
584 workInProgress.updateChildren(null, transaction, context);
585 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
586 workInProgress.updateTextContent('');
621 - if (__DEV__) {
622 - ReactInstrumentation.debugTool.onSetChildren(workInProgress._debugID, []);
623 - }
587 }
588
589 if (nextContent != null) {
590 if (lastContent !== nextContent) {
591 workInProgress.updateTextContent('' + nextContent);
629 - if (__DEV__) {
630 - setAndValidateContentChildDev.call(workInProgress, nextContent);
631 - }
592 }
593 } else if (nextHtml != null) {
594 if (lastHtml !== nextHtml) {
595 workInProgress.updateMarkup('' + nextHtml);
596 }
637 - if (__DEV__) {
638 - ReactInstrumentation.debugTool.onSetChildren(workInProgress._debugID, []);
639 - }
597 } else if (nextChildren != null) {
641 - if (__DEV__) {
642 - setAndValidateContentChildDev.call(workInProgress, null);
643 - }
644 -
598 workInProgress.updateChildren(nextChildren, transaction, context);
599 }
600 }
@@ -669,7 +622,6 @@ var ReactDOMFiberComponent = {
622 ) {
623 // validateDangerousTag(tag);
624 // workInProgress._tag = tag.toLowerCase();
672 - // setAndValidateContentChildDev.call(workInProgress, null);
625
626 workInProgress._domID = hostContainerInfo._idCounter++;
627 workInProgress._hostParent = hostParent;
@@ -749,22 +701,6 @@ var ReactDOMFiberComponent = {
701 }
702 workInProgress._namespaceURI = namespaceURI;
703
752 - if (__DEV__) {
753 - var parentInfo;
754 - if (hostParent != null) {
755 - parentInfo = hostParent._ancestorInfo;
756 - } else if (hostContainerInfo._tag) {
757 - parentInfo = hostContainerInfo._ancestorInfo;
758 - }
759 - if (parentInfo) {
760 - // parentInfo should always be present except for the top-level
761 - // component when server rendering
762 - validateDOMNesting(workInProgress._tag, null, workInProgress, parentInfo);
763 - }
764 - workInProgress._ancestorInfo =
765 - validateDOMNesting.updatedAncestorInfo(parentInfo, workInProgress._tag, workInProgress);
766 - }
767 -
704 var mountImage;
705 var type = workInProgress._currentElement.type;
706 var ownerDocument = hostContainerInfo._ownerDocument;
@@ -996,10 +932,6 @@ var ReactDOMFiberComponent = {
932 ReactDOMComponentTree.uncacheNode(workInProgress);
933 workInProgress._domID = 0;
934 workInProgress._wrapperState = null;
999 -
1000 - if (__DEV__) {
1001 - setAndValidateContentChildDev.call(workInProgress, null);
1002 - }
935 },
936
937 restoreControlledState: function(finishedWork : Fiber) {