From 1cc4278acddaf8974f4f8b42e7a38a5308c8bb81 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 11 Mar 2017 00:52:48 +0000 Subject: [PATCH] Add even more forwarding modules that are used on www --- scripts/rollup/forwarding/EventPluginUtils.js | 19 +++++++++++++++++++ scripts/rollup/forwarding/EventPropagators.js | 19 +++++++++++++++++++ scripts/rollup/forwarding/SyntheticUIEvent.js | 19 +++++++++++++++++++ scripts/rollup/forwarding/ViewportMetrics.js | 19 +++++++++++++++++++ src/fb/ReactDOMFBEntry.js | 5 +++++ src/fb/ReactDOMFiberFBEntry.js | 5 +++++ 6 files changed, 86 insertions(+) create mode 100644 scripts/rollup/forwarding/EventPluginUtils.js create mode 100644 scripts/rollup/forwarding/EventPropagators.js create mode 100644 scripts/rollup/forwarding/SyntheticUIEvent.js create mode 100644 scripts/rollup/forwarding/ViewportMetrics.js diff --git a/scripts/rollup/forwarding/EventPluginUtils.js b/scripts/rollup/forwarding/EventPluginUtils.js new file mode 100644 index 0000000000..a3b5a59935 --- /dev/null +++ b/scripts/rollup/forwarding/EventPluginUtils.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 EventPluginUtils + * @flow + */ + +'use strict'; + +const { + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, +} = require('ReactDOM-fb'); + +module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.EventPluginUtils; diff --git a/scripts/rollup/forwarding/EventPropagators.js b/scripts/rollup/forwarding/EventPropagators.js new file mode 100644 index 0000000000..6bf63a3025 --- /dev/null +++ b/scripts/rollup/forwarding/EventPropagators.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 EventPropagators + * @flow + */ + +'use strict'; + +const { + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, +} = require('ReactDOM-fb'); + +module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.EventPropagators; diff --git a/scripts/rollup/forwarding/SyntheticUIEvent.js b/scripts/rollup/forwarding/SyntheticUIEvent.js new file mode 100644 index 0000000000..dd35f737f0 --- /dev/null +++ b/scripts/rollup/forwarding/SyntheticUIEvent.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 SyntheticUIEvent + * @flow + */ + +'use strict'; + +const { + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, +} = require('ReactDOM-fb'); + +module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SyntheticUIEvent; diff --git a/scripts/rollup/forwarding/ViewportMetrics.js b/scripts/rollup/forwarding/ViewportMetrics.js new file mode 100644 index 0000000000..c5e7286d21 --- /dev/null +++ b/scripts/rollup/forwarding/ViewportMetrics.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 ViewportMetrics + * @flow + */ + +'use strict'; + +const { + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, +} = require('ReactDOM-fb'); + +module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ViewportMetrics; diff --git a/src/fb/ReactDOMFBEntry.js b/src/fb/ReactDOMFBEntry.js index df0775f2fc..e136cd13e2 100644 --- a/src/fb/ReactDOMFBEntry.js +++ b/src/fb/ReactDOMFBEntry.js @@ -36,6 +36,11 @@ ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { ReactDOMSelection: require('ReactDOMSelection'), ReactInputSelection: require('ReactInputSelection'), ReactInstanceMap: require('react-dom/lib/ReactInstanceMap'), + // These are dependencies of TapEventPlugin: + EventPluginUtils: require('EventPluginUtils'), + EventPropagators: require('EventPropagators'), + SyntheticUIEvent: require('SyntheticUIEvent'), + ViewportMetrics: require('ViewportMetrics'), }; if (__DEV__) { diff --git a/src/fb/ReactDOMFiberFBEntry.js b/src/fb/ReactDOMFiberFBEntry.js index fd90aa3a09..7988b8f217 100644 --- a/src/fb/ReactDOMFiberFBEntry.js +++ b/src/fb/ReactDOMFiberFBEntry.js @@ -35,6 +35,11 @@ ReactDOMFiber.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { ReactDOMSelection: require('ReactDOMSelection'), ReactInputSelection: require('ReactInputSelection'), ReactInstanceMap: require('react-dom/lib/ReactInstanceMap'), + // These are dependencies of TapEventPlugin: + EventPluginUtils: require('EventPluginUtils'), + EventPropagators: require('EventPropagators'), + SyntheticUIEvent: require('SyntheticUIEvent'), + ViewportMetrics: require('ViewportMetrics'), }; if (__DEV__) {