diff --git a/.prettierignore b/.prettierignore index 199d45f1c..b625db5e9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,5 +10,4 @@ index.js patch.js root.js test/hot/react-dom -coverage -src/webpack/webpackTagCommonJSExports.js +coverage \ No newline at end of file diff --git a/src/proxy/createClassProxy.js b/src/proxy/createClassProxy.js index e23f084a4..eb489bd3f 100644 --- a/src/proxy/createClassProxy.js +++ b/src/proxy/createClassProxy.js @@ -261,6 +261,17 @@ function createClassProxy(InitialComponent, proxyKey, options = {}) { // eslint-disable-next-line func-names ProxyFacade = function(props, context) { + /* + + ! THIS IS NOT YOUR COMPONENT ! + ! THIS IS REACT-HOT-LOADER ! + + And you are probably looking for a function component of yours + It's hidden, but there is a way to fix this - just reconfigure your application a bit + see https://github.com/gaearon/react-hot-loader/issues/1311 + + */ + const result = CurrentComponent(props, context); // This is a Relay-style container constructor. We can't do the prototype- diff --git a/src/webpack/index.js b/src/webpack/index.js index b545e2b1a..bffc84d38 100644 --- a/src/webpack/index.js +++ b/src/webpack/index.js @@ -49,6 +49,7 @@ function transform(source, map) { // Ideally we'd opt out for one file but this is simpler. .replace(/['"]use strict['"];/, '') // eslint comments don't need to end up in the output + .replace(/\/\* (.*) \*\//, '') .replace(/\/\/ eslint-disable-line .*\n/g, '\n') .replace(/\/\* global.*\*\//, '') .split(/\n\s*/) @@ -56,7 +57,7 @@ function transform(source, map) { } // Parameterize the helper with the current filename. - const separator = '\n\n;'; + const separator = '\n'; const appendText = tagCommonJSExportsSource.replace(/__FILENAME__/g, JSON.stringify(resourcePath)); if (this.sourceMap === false) { diff --git a/src/webpack/webpackTagCommonJSExports.js b/src/webpack/webpackTagCommonJSExports.js index d6de252c0..5487425e4 100644 --- a/src/webpack/webpackTagCommonJSExports.js +++ b/src/webpack/webpackTagCommonJSExports.js @@ -1,7 +1,7 @@ -/* eslint-disable global-require, import/no-unresolved, no-var, camelcase, func-names */ +/* eslint-disable global-require, import/no-unresolved, no-var, camelcase, func-names, no-void */ /* global __FILENAME__, reactHotLoaderGlobal */ -;(function register() { +void (function register() { // eslint-disable-line no-extra-semi /* react-hot-loader/webpack */ var safe_require = function() {