UNPKG

rn-web-cli

Version:

React Native for Web

1 lines 10.5 kB
{"version":3,"sources":["node_modules\\react-dom\\lib\\ReactReconciler.js"],"names":["ReactRef","require","ReactInstrumentation","warning","attachRefs","_currentElement","ReactReconciler","mountComponent","internalInstance","transaction","hostParent","hostContainerInfo","context","parentDebugID","process","env","NODE_ENV","_debugID","debugTool","onBeforeMountComponent","markup","ref","getReactMountReady","enqueue","onMountComponent","getHostNode","unmountComponent","safely","onBeforeUnmountComponent","detachRefs","onUnmountComponent","receiveComponent","nextElement","prevElement","_context","onBeforeUpdateComponent","refsChanged","shouldUpdateRefs","onUpdateComponent","performUpdateIfNecessary","updateBatchNumber","_updateBatchNumber","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,UAAWC,QAAQ,YAAR,CAAf;AACA,GAAIC,sBAAuBD,QAAQ,wBAAR,CAA3B;;AAEA,GAAIE,SAAUF,QAAQ,kBAAR,CAAd;;;;;;AAMA,QAASG,WAAT,EAAsB;AACpBJ,SAASI,UAAT,CAAoB,IAApB,CAA0B,KAAKC,eAA/B;AACD;;AAED,GAAIC,iBAAkB;;;;;;;;;;;;AAYpBC,eAAgB,wBAAUC,gBAAV,CAA4BC,WAA5B,CAAyCC,UAAzC,CAAqDC,iBAArD,CAAwEC,OAAxE,CAAiFC,aAAjF;AAChB;AACE,GAAIC,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAA7B,CAA2C;AACzC,GAAIR,iBAAiBS,QAAjB,GAA8B,CAAlC,CAAqC;AACnCf,qBAAqBgB,SAArB,CAA+BC,sBAA/B,CAAsDX,iBAAiBS,QAAvE,CAAiFT,iBAAiBH,eAAlG,CAAmHQ,aAAnH;AACD;AACF;AACD,GAAIO,QAASZ,iBAAiBD,cAAjB,CAAgCE,WAAhC,CAA6CC,UAA7C,CAAyDC,iBAAzD,CAA4EC,OAA5E,CAAqFC,aAArF,CAAb;AACA,GAAIL,iBAAiBH,eAAjB,EAAoCG,iBAAiBH,eAAjB,CAA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AAhT;AACA;AACD;AACD,GAAI3B,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAA7B,CAA2C;AACzC,GAAIR,iBAAiBS,QAAjB,GAA8B,CAAlC,CAAqC;AACnCf,qBAAqBgB,SAArB,CAA+BiB,uBAA/B,CAAuD3B,iBAAiBS,QAAxE,CAAkFT,iBAAiBH,eAAnG;AACD;AACF;AACDG,iBAAiB+B,wBAAjB,CAA0C9B,WAA1C;AACA,GAAIK,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAA7B,CAA2C;AACzC,GAAIR,iBAAiBS,QAAjB,GAA8B,CAAlC,CAAqC;AACnCf,qBAAqBgB,SAArB,CAA+BoB,iBAA/B,CAAiD9B,iBAAiBS,QAAlE;AACD;AACF;AACF,CAxImB,CAAtB;;;AA2IAyB,OAAOC,OAAP,CAAiBrC,eAAjB","file":"ReactReconciler.js","sourceRoot":"d:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar ReactRef = require('./ReactRef');\nvar ReactInstrumentation = require('./ReactInstrumentation');\n\nvar warning = require('fbjs/lib/warning');\n\n/**\n * Helper to call ReactRef.attachRefs with this composite component, split out\n * to avoid allocations in the transaction mount-ready queue.\n */\nfunction attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}\n\nvar ReactReconciler = {\n /**\n * Initializes the component, renders markup, and registers event listeners.\n *\n * @param {ReactComponent} internalInstance\n * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction\n * @param {?object} the containing host component instance\n * @param {?object} info about the host container\n * @return {?string} Rendered markup to be inserted into the DOM.\n * @final\n * @internal\n */\n mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots\n {\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);\n }\n }\n var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);\n if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {\n transaction.getReactMountReady().enqueue(attachRefs, internalInstance);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);\n }\n }\n return markup;\n },\n\n /**\n * Returns a value that can be passed to\n * ReactComponentEnvironment.replaceNodeWithMarkup.\n */\n getHostNode: function (internalInstance) {\n return internalInstance.getHostNode();\n },\n\n /**\n * Releases any resources allocated by `mountComponent`.\n *\n * @final\n * @internal\n */\n unmountComponent: function (internalInstance, safely) {\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);\n }\n }\n ReactRef.detachRefs(internalInstance, internalInstance._currentElement);\n internalInstance.unmountComponent(safely);\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);\n }\n }\n },\n\n /**\n * Update a component using a new element.\n *\n * @param {ReactComponent} internalInstance\n * @param {ReactElement} nextElement\n * @param {ReactReconcileTransaction} transaction\n * @param {object} context\n * @internal\n */\n receiveComponent: function (internalInstance, nextElement, transaction, context) {\n var prevElement = internalInstance._currentElement;\n\n if (nextElement === prevElement && context === internalInstance._context) {\n // Since elements are immutable after the owner is rendered,\n // we can do a cheap identity compare here to determine if this is a\n // superfluous reconcile. It's possible for state to be mutable but such\n // change should trigger an update of the owner which would recreate\n // the element. We explicitly check for the existence of an owner since\n // it's possible for an element created outside a composite to be\n // deeply mutated and reused.\n\n // TODO: Bailing out early is just a perf optimization right?\n // TODO: Removing the return statement should affect correctness?\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);\n }\n }\n\n var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);\n\n if (refsChanged) {\n ReactRef.detachRefs(internalInstance, prevElement);\n }\n\n internalInstance.receiveComponent(nextElement, transaction, context);\n\n if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {\n transaction.getReactMountReady().enqueue(attachRefs, internalInstance);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);\n }\n }\n },\n\n /**\n * Flush any dirty changes in a component.\n *\n * @param {ReactComponent} internalInstance\n * @param {ReactReconcileTransaction} transaction\n * @internal\n */\n performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {\n if (internalInstance._updateBatchNumber !== updateBatchNumber) {\n // The component's enqueued batch number should always be the current\n // batch or the following one.\n process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);\n }\n }\n internalInstance.performUpdateIfNecessary(transaction);\n if (process.env.NODE_ENV !== 'production') {\n if (internalInstance._debugID !== 0) {\n ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);\n }\n }\n }\n};\n\nmodule.exports = ReactReconciler;"]}