-
Notifications
You must be signed in to change notification settings - Fork 45.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a shim file to load addons' dependencies on DOM
By replacing this intermediate file we can do the lazy loading without needing any lazy requires. This set up works with ES modules. We could also replace the globalShim thing with aliased files instead for consistency.
- Loading branch information
1 parent
c6f32c5
commit 9e4485e
Showing
9 changed files
with
94 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* 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 ReactAddonsDOMDependencies | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var ReactDOM = require('ReactDOM'); | ||
var ReactInstanceMap = require('ReactInstanceMap'); | ||
|
||
exports.getReactDOM = function() { | ||
return ReactDOM; | ||
}; | ||
|
||
exports.getReactInstanceMap = function() { | ||
return ReactInstanceMap; | ||
}; | ||
|
||
if (__DEV__) { | ||
var ReactPerf = require('ReactPerf'); | ||
var ReactTestUtils = require('ReactTestUtils'); | ||
|
||
exports.getReactPerf = function() { | ||
return ReactPerf; | ||
}; | ||
|
||
exports.getReactTestUtils = function() { | ||
return ReactTestUtils; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* 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 ReactAddonsDOMDependenciesUMDShim | ||
*/ | ||
|
||
'use strict'; | ||
|
||
exports.getReactDOM = function() { | ||
return ReactDOM; | ||
}; | ||
|
||
exports.getReactInstanceMap = function() { | ||
return ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactInstanceMap; | ||
}; | ||
|
||
if (__DEV__) { | ||
exports.getReactPerf = function() { | ||
return ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf; | ||
}; | ||
|
||
exports.getReactTestUtils = function() { | ||
return ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactTestUtils; | ||
}; | ||
} |