Skip to content

Commit

Permalink
Merge pull request #1312 from gaearon/12.10
Browse files Browse the repository at this point in the history
12.10
  • Loading branch information
theKashey authored Jul 27, 2019
2 parents 980ab8d + 43fc5fd commit d9325e4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ index.js
patch.js
root.js
test/hot/react-dom
coverage
src/webpack/webpackTagCommonJSExports.js
coverage
11 changes: 11 additions & 0 deletions src/proxy/createClassProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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-
Expand Down
3 changes: 2 additions & 1 deletion src/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ 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*/)
.join(' ');
}

// 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) {
Expand Down
4 changes: 2 additions & 2 deletions src/webpack/webpackTagCommonJSExports.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit d9325e4

Please sign in to comment.