From 2902701566b020c7269fa0bbea96cd6dd2287001 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Thu, 21 Jan 2016 10:25:29 -0800 Subject: [PATCH] Remove now unnecessary tweaking of global MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: public When we were debugging in the main window JS context in Chrome, the global environment had to be tweaked so that DOM features wouldn’t be detected. Since we switched to debugging within a web worker, we don’t need to do this tweaks any more. Reviewed By: bestander Differential Revision: D2850239 fb-gh-sync-id: 886f2f7ac5c579c3fd4a424d5341bc6bc0432c0d --- .../JavaScriptAppEngine/polyfills/document.js | 30 ------------------- local-cli/server/runServer.js | 5 ---- 2 files changed, 35 deletions(-) delete mode 100644 Libraries/JavaScriptAppEngine/polyfills/document.js diff --git a/Libraries/JavaScriptAppEngine/polyfills/document.js b/Libraries/JavaScriptAppEngine/polyfills/document.js deleted file mode 100644 index bff669cce..000000000 --- a/Libraries/JavaScriptAppEngine/polyfills/document.js +++ /dev/null @@ -1,30 +0,0 @@ -/* eslint strict: 0 */ - -// TODO: Remove document polyfill now that chrome debugging is in a web worker. - -// The browser defines Text and Image globals by default. If you forget to -// require them, then the error message is very confusing. -function getInvalidGlobalUseError(name) { - return new Error( - 'You are trying to render the global ' + name + ' variable as a ' + - 'React element. You probably forgot to require ' + name + '.' - ); -} -global.Text = { - get defaultProps() { - throw getInvalidGlobalUseError('Text'); - } -}; -global.Image = { - get defaultProps() { - throw getInvalidGlobalUseError('Image'); - } -}; -// Force `ExecutionEnvironment.canUseDOM` to be false. -if (global.document) { - global.document.createElement = null; -} - -// There is no DOM so MutationObserver doesn't make sense. It is used -// as feature detection in Bluebird Promise implementation -global.MutationObserver = undefined; diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index 7d7463a06..001b9c687 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -79,11 +79,6 @@ function getPackagerServer(args, config) { assetRoots: args.assetRoots, assetExts: ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp'], resetCache: args.resetCache || args['reset-cache'], - polyfillModuleNames: [ - require.resolve( - '../../Libraries/JavaScriptAppEngine/polyfills/document.js' - ), - ], verbose: args.verbose, }); }