-
Notifications
You must be signed in to change notification settings - Fork 47.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add react-dom-unstable-native-dependencies (#10138)
* Add react-dom-unstable-native-dependencies react-native-web and react-primitives currently access a few internals for shimming DOM events into native ones. Changes in react@16 packaging hide these internals completely. This change adds a submodule to react-dom, unstable-native-dependencies that includes the necessary modules to continue enabling that method of dom-native event injection. * Update ResponderEventPlugin to use "public" interfaces for test In order to get some sort of smoke testing on react-dom-unstable-native-dependencies, update ResponderEventPlugin-test to use the "public" interfaces provided by react-dom and the new react-dom/unstable-native dependencies Also adds the missing references in package.json as well as missing files required for unittests to do imports correctrly Also exports injectComponentTree() which is required for the unittests to re-set the shared component state between runs. * Tweak bundle comment * Bundle content updates from exporting injectComponentTree * Added FB_DEV, FB_PROD to bundle types * Run yarn prettier for -unstable-native-dependencies updates
- Loading branch information
Showing
7 changed files
with
168 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-dom-unstable-native-dependencies.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/react-dom-unstable-native-dependencies.development.js'); | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/renderers/dom/shared/ReactDOMUnstableNativeDependenciesEntry.js
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,29 @@ | ||
/** | ||
* 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 ReactDOMUnstableNativeDependenciesEntry | ||
*/ | ||
|
||
const EventPluginUtils = require('EventPluginUtils'); | ||
const ResponderEventPlugin = require('ResponderEventPlugin'); | ||
const ResponderTouchHistoryStore = require('ResponderTouchHistoryStore'); | ||
|
||
const ReactDOMUnstableNativeDependencies = { | ||
injectComponentTree: EventPluginUtils.injection.injectComponentTree, | ||
ResponderEventPlugin, | ||
ResponderTouchHistoryStore, | ||
}; | ||
|
||
// Inject react-dom's ComponentTree into this module. | ||
const ReactDOM = require('react-dom'); | ||
const { | ||
ReactDOMComponentTree, | ||
} = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
ReactDOMUnstableNativeDependencies.injectComponentTree(ReactDOMComponentTree); | ||
|
||
module.exports = ReactDOMUnstableNativeDependencies; |
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