Skip to content

Commit

Permalink
Move getNextDebugID() to React package.
Browse files Browse the repository at this point in the history
The module, and its internal state, was duplicated in several packages,
leading to duplicate ids when multiple renderers were used.
  • Loading branch information
wacii committed Mar 2, 2017
1 parent a190cfc commit 5cb42d9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions grunt/config/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
});

Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,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(
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/umd/ReactUMDEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (__DEV__) {
{
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: require('react/lib/ReactComponentTreeHook'),
getNextDebugID: require('react/lib/getNextDebugID'),
}
);
}
Expand Down
1 change: 1 addition & 0 deletions src/umd/ReactWithAddonsUMDEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if (__DEV__) {
{
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: require('react/lib/ReactComponentTreeHook'),
getNextDebugID: require('getNextDebugID'),
}
);
}
Expand Down
19 changes: 19 additions & 0 deletions src/umd/shims/getNextDebugIDUMDShim.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 5cb42d9

Please sign in to comment.