diff --git a/grunt/config/browserify.js b/grunt/config/browserify.js index 5cc3f1f840a76..cff70af4057ca 100644 --- a/grunt/config/browserify.js +++ b/grunt/config/browserify.js @@ -18,6 +18,7 @@ var shimSharedModules = aliasify.configure({ 'react/lib/React': 'react/lib/ReactUMDShim', 'react/lib/ReactCurrentOwner': 'react/lib/ReactCurrentOwnerUMDShim', 'react/lib/ReactComponentTreeHook': 'react/lib/ReactComponentTreeHookUMDShim', + 'react/lib/getNextDebugID': 'react/lib/getNextDebugIDUMDShim', }, }); diff --git a/gulpfile.js b/gulpfile.js index 91cc987fb862a..0f70d896986e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -129,6 +129,7 @@ var moduleMapReact = Object.assign( 'react/lib/checkPropTypes': './checkPropTypes', 'react/lib/ReactComponentTreeHook': './ReactComponentTreeHook', 'react/lib/ReactDebugCurrentFrame': './ReactDebugCurrentFrame', + 'react/lib/getNextDebugID': './getNextDebugID', }, moduleMapBase ); @@ -141,6 +142,7 @@ var rendererSharedState = { 'react/lib/checkPropTypes': 'react/lib/checkPropTypes', 'react/lib/ReactComponentTreeHook': 'react/lib/ReactComponentTreeHook', 'react/lib/ReactDebugCurrentFrame': 'react/lib/ReactDebugCurrentFrame', + 'react/lib/getNextDebugID': 'react/lib/getNextDebugID', }; var moduleMapReactDOM = Object.assign( diff --git a/src/shared/utils/getNextDebugID.js b/src/isomorphic/getNextDebugID.js similarity index 100% rename from src/shared/utils/getNextDebugID.js rename to src/isomorphic/getNextDebugID.js diff --git a/src/node_modules/react/lib/getNextDebugID.js b/src/node_modules/react/lib/getNextDebugID.js new file mode 100644 index 0000000000000..e7e3d8ca6a014 --- /dev/null +++ b/src/node_modules/react/lib/getNextDebugID.js @@ -0,0 +1,9 @@ +/** + * * Copyright 2016-present Facebook. All Rights Reserved. + * * + * * @flow + * */ + +'use strict'; + +module.exports = require('getNextDebugID'); diff --git a/src/renderers/shared/stack/reconciler/instantiateReactComponent.js b/src/renderers/shared/stack/reconciler/instantiateReactComponent.js index 4fab1a3b200f3..54bcca6baaa09 100644 --- a/src/renderers/shared/stack/reconciler/instantiateReactComponent.js +++ b/src/renderers/shared/stack/reconciler/instantiateReactComponent.js @@ -15,7 +15,7 @@ var ReactCompositeComponent = require('ReactCompositeComponent'); var ReactEmptyComponent = require('ReactEmptyComponent'); var ReactHostComponent = require('ReactHostComponent'); -var getNextDebugID = require('getNextDebugID'); +var getNextDebugID = require('react/lib/getNextDebugID'); var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); diff --git a/src/test/ReactShallowRenderer.js b/src/test/ReactShallowRenderer.js index 6e70f9b99da01..a698efc52c14a 100644 --- a/src/test/ReactShallowRenderer.js +++ b/src/test/ReactShallowRenderer.js @@ -20,7 +20,7 @@ var ReactReconciler = require('ReactReconciler'); var ReactUpdates = require('ReactUpdates'); var emptyObject = require('fbjs/lib/emptyObject'); -var getNextDebugID = require('getNextDebugID'); +var getNextDebugID = require('react/lib/getNextDebugID'); var invariant = require('fbjs/lib/invariant'); class NoopInternalComponent { diff --git a/src/umd/ReactUMDEntry.js b/src/umd/ReactUMDEntry.js index ab926354a63de..36c4fd75cf732 100644 --- a/src/umd/ReactUMDEntry.js +++ b/src/umd/ReactUMDEntry.js @@ -26,6 +26,7 @@ if (__DEV__) { { // ReactComponentTreeHook should not be included in production. ReactComponentTreeHook: require('react/lib/ReactComponentTreeHook'), + getNextDebugID: require('react/lib/getNextDebugID'), } ); } diff --git a/src/umd/ReactWithAddonsUMDEntry.js b/src/umd/ReactWithAddonsUMDEntry.js index c36ade28a98e5..6d943faf8ad7d 100644 --- a/src/umd/ReactWithAddonsUMDEntry.js +++ b/src/umd/ReactWithAddonsUMDEntry.js @@ -27,6 +27,7 @@ if (__DEV__) { { // ReactComponentTreeHook should not be included in production. ReactComponentTreeHook: require('react/lib/ReactComponentTreeHook'), + getNextDebugID: require('react/lib/getNextDebugID'), } ); } diff --git a/src/umd/shims/getNextDebugIDUMDShim.js b/src/umd/shims/getNextDebugIDUMDShim.js new file mode 100644 index 0000000000000..3c8855d20501d --- /dev/null +++ b/src/umd/shims/getNextDebugIDUMDShim.js @@ -0,0 +1,19 @@ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getNextDebugId + */ + +/* globals React */ + +'use strict'; + +var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +module.exports = ReactInternals.getNextDebugID; +