From 5d7242b72489ee5360408ebe0fe99c53ef689d98 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 25 Oct 2017 15:29:06 +0100 Subject: [PATCH] Expose TapEventPlugin on the www bundle --- packages/react-dom/index.fb.js | 6 ++---- packages/shared/describeComponentFrame.js | 1 - scripts/rollup/packaging.js | 16 +--------------- scripts/rollup/results.json | 12 ++++++------ .../shims/facebook-www/EventPropagators.js | 17 ----------------- .../shims/facebook-www/SyntheticUIEvent.js | 17 ----------------- .../{EventPluginUtils.js => TapEventPlugin.js} | 4 ++-- 7 files changed, 11 insertions(+), 62 deletions(-) delete mode 100644 scripts/rollup/shims/facebook-www/EventPropagators.js delete mode 100644 scripts/rollup/shims/facebook-www/SyntheticUIEvent.js rename scripts/rollup/shims/facebook-www/{EventPluginUtils.js => TapEventPlugin.js} (74%) diff --git a/packages/react-dom/index.fb.js b/packages/react-dom/index.fb.js index 6771b7557eeb..1de9ecb8aebc 100644 --- a/packages/react-dom/index.fb.js +++ b/packages/react-dom/index.fb.js @@ -18,10 +18,8 @@ Object.assign(ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { ReactFiberTreeReflection: require('shared/ReactFiberTreeReflection'), ReactDOMComponentTree: require('./src/client/ReactDOMComponentTree'), ReactInstanceMap: require('shared/ReactInstanceMap'), - // These are dependencies of TapEventPlugin: - EventPluginUtils: require('events/EventPluginUtils'), - EventPropagators: require('events/EventPropagators'), - SyntheticUIEvent: require('./src/events/SyntheticUIEvent'), + // Used by www msite: + TapEventPlugin: require('./src/events/TapEventPlugin'), }); module.exports = ReactDOM; diff --git a/packages/shared/describeComponentFrame.js b/packages/shared/describeComponentFrame.js index 1bb9ab0dcb94..8f23ca65fb4d 100644 --- a/packages/shared/describeComponentFrame.js +++ b/packages/shared/describeComponentFrame.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. * * @flow - * @providesModule describeComponentFrame */ 'use strict'; diff --git a/scripts/rollup/packaging.js b/scripts/rollup/packaging.js index 3f3a3295310c..c272d7cddd75 100644 --- a/scripts/rollup/packaging.js +++ b/scripts/rollup/packaging.js @@ -17,10 +17,6 @@ const RN_DEV = Bundles.bundleTypes.RN_DEV; const RN_PROD = Bundles.bundleTypes.RN_PROD; const facebookWWW = 'facebook-www'; -// these files need to be copied to the facebook-www build -const facebookWWWSrcDependencies = [ - 'packages/react-dom/src/events/TapEventPlugin.js', -]; // these files need to be copied to the react-native build const reactNativeSrcDependencies = [ @@ -114,17 +110,7 @@ function createFacebookWWWBuild() { const from = join('scripts', 'rollup', 'shims', facebookWWW); const to = join('build', facebookWWW, 'shims'); - return asyncCopyTo(from, to).then(() => { - let promises = []; - // we also need to copy over some specific files from src - // defined in facebookWWWSrcDependencies - for (const srcDependency of facebookWWWSrcDependencies) { - promises.push( - asyncCopyTo(resolve(srcDependency), join(to, basename(srcDependency))) - ); - } - return Promise.all(promises); - }); + return asyncCopyTo(from, to); } function copyBundleIntoNodePackage(packageName, filename, bundleType) { diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index af0d587ac79b..f2ec25b9381d 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -41,12 +41,12 @@ "gzip": 33563 }, "ReactDOM-dev.js (FB_DEV)": { - "size": 587573, - "gzip": 134618 + "size": 590443, + "gzip": 135554 }, "ReactDOM-prod.js (FB_PROD)": { - "size": 418348, - "gzip": 92934 + "size": 420794, + "gzip": 93574 }, "react-dom-test-utils.development.js (NODE_DEV)": { "size": 41554, @@ -101,8 +101,8 @@ "gzip": 5899 }, "ReactDOMServer-dev.js (FB_DEV)": { - "size": 93943, - "gzip": 25012 + "size": 93901, + "gzip": 25000 }, "ReactDOMServer-prod.js (FB_PROD)": { "size": 42426, diff --git a/scripts/rollup/shims/facebook-www/EventPropagators.js b/scripts/rollup/shims/facebook-www/EventPropagators.js deleted file mode 100644 index 3b9e7b55fc07..000000000000 --- a/scripts/rollup/shims/facebook-www/EventPropagators.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @providesModule EventPropagators - */ - -'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/shims/facebook-www/SyntheticUIEvent.js b/scripts/rollup/shims/facebook-www/SyntheticUIEvent.js deleted file mode 100644 index 9bd1f7a53b04..000000000000 --- a/scripts/rollup/shims/facebook-www/SyntheticUIEvent.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @providesModule SyntheticUIEvent - */ - -'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/shims/facebook-www/EventPluginUtils.js b/scripts/rollup/shims/facebook-www/TapEventPlugin.js similarity index 74% rename from scripts/rollup/shims/facebook-www/EventPluginUtils.js rename to scripts/rollup/shims/facebook-www/TapEventPlugin.js index 73f00c3faf97..75654f9b27b2 100644 --- a/scripts/rollup/shims/facebook-www/EventPluginUtils.js +++ b/scripts/rollup/shims/facebook-www/TapEventPlugin.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @providesModule EventPluginUtils + * @providesModule TapEventPlugin */ 'use strict'; @@ -14,4 +14,4 @@ const { } = require('ReactDOM-fb'); module.exports = - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.EventPluginUtils; + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.TapEventPlugin;