Skip to content

Commit a36457b

Browse files
authored
#1772 Replace React-hot-loader with React-fast-refresh (#1773)
Signed-off-by: srikant <[email protected]>
1 parent 0407ec3 commit a36457b

File tree

7 files changed

+9
-17
lines changed

7 files changed

+9
-17
lines changed

canvas_modules/harness/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@carbon/charts-react": "1.15.3",
3939
"@carbon/react": "^1.52.0",
4040
"@elyra/canvas": "file:../common-canvas",
41+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
4142
"ajv": "8.12.0",
4243
"autoprefixer": "10.4.19",
4344
"babel-loader": "9.1.3",
@@ -69,7 +70,6 @@
6970
"prop-types": "15.8.1",
7071
"react": "18.2.0",
7172
"react-dom": "18.2.0",
72-
"react-hot-loader": "4.13.1",
7373
"react-inlinesvg": "4.1.3",
7474
"react-intl": "6.6.3",
7575
"react-redux": "7.2.8",

canvas_modules/harness/src/client/App.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { Tooltip as ReactTooltip } from "react-tooltip";
2525
import JavascriptFileDownload from "js-file-download";
2626
import { FormattedMessage, IntlProvider } from "react-intl";
2727
import { forIn, get, has, isEmpty, isEqual } from "lodash";
28-
import { hot } from "react-hot-loader/root";
2928
import classNames from "classnames";
3029
import { v4 as uuid4 } from "uuid";
3130

@@ -2799,4 +2798,4 @@ class App extends React.Component {
27992798
}
28002799
}
28012800

2802-
export default hot(App);
2801+
export default App;

canvas_modules/harness/src/client/app-small.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import AllTypesCanvas from "../../test_resources/diagrams/allTypesCanvas.json";
2121
import ModelerPalette from "../../test_resources/palettes/modelerPalette.json";
2222
// Note use "@elyra/canvas" instead of "common-canvas" here, if you are importing from the NPM module.
2323
import { CommonCanvas, CanvasController } from "common-canvas"; // eslint-disable-line import/no-unresolved
24-
// This library is only needed if you want to use hot loading during development.
25-
import { hot } from "react-hot-loader/root";
2624

2725
class App extends React.Component {
2826
constructor(props) {
@@ -195,4 +193,4 @@ class App extends React.Component {
195193
}
196194
}
197195

198-
export default hot(App);
196+
export default App;

canvas_modules/harness/src/client/app-tiny.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import ModelerPalette from "../../test_resources/palettes/modelerPalette.json";
2222
// Note use "@elyra/canvas" instead of "common-canvas" here, if you are importing from the NPM module.
2323
import { CommonCanvas, CanvasController } from "common-canvas"; // eslint-disable-line import/no-unresolved
2424
// This library is only needed if you want to use hot loading during development.
25-
import { hot } from "react-hot-loader/root";
2625

2726
class App extends React.Component {
2827
constructor(props) {
@@ -46,4 +45,4 @@ class App extends React.Component {
4645
}
4746
}
4847

49-
export default hot(App);
48+
export default App;

canvas_modules/harness/src/client/components/common-properties-components.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import React from "react";
2020
import { Link } from "react-router-dom";
21-
import { hot } from "react-hot-loader/root";
2221
import { Button, Dropdown } from "@carbon/react";
2322
import FunctionList from "../constants/json/functionlist.json";
2423
import {
@@ -2273,4 +2272,4 @@ class CommonPropertiesComponents extends React.Component {
22732272
}
22742273
}
22752274

2276-
export default hot(CommonPropertiesComponents);
2275+
export default CommonPropertiesComponents;

canvas_modules/harness/src/client/components/common-properties-conditions.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import React from "react";
2020
import { Link } from "react-router-dom";
21-
import { hot } from "react-hot-loader/root";
2221
import { Button, Dropdown } from "@carbon/react";
2322
import {
2423
TEXTFIELD_ERROR_PROPS_INFO,
@@ -1306,4 +1305,4 @@ class CommonPropertiesComponents extends React.Component {
13061305
}
13071306
}
13081307

1309-
export default hot(CommonPropertiesComponents);
1308+
export default CommonPropertiesComponents;

canvas_modules/harness/webpack.config.dev.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ const webpack = require("webpack");
2323
const babelOptions = require("./scripts/babel/babelOptions").babelOptions;
2424
const constants = require("./lib/constants");
2525
const HtmlWebpackPlugin = require("html-webpack-plugin");
26+
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
2627

2728
// Globals
2829

2930
// Entry & Output files ------------------------------------------------------------>
3031

3132
const entry = [
32-
"react-hot-loader/patch",
3333
"webpack-hot-middleware/client",
3434
"@babel/polyfill",
3535
"./src/client/index.js",
@@ -49,9 +49,6 @@ const output = {
4949
};
5050

5151

52-
// Loaders ------------------------------------------------------------>
53-
babelOptions.plugins.push("react-hot-loader/babel"); // needed for HMR support
54-
5552
const rules = [
5653
{
5754
test: /\.js(x?)$/,
@@ -115,7 +112,8 @@ const plugins = [
115112
new webpack.SourceMapDevToolPlugin({
116113
module: true,
117114
columns: false
118-
})
115+
}),
116+
new ReactRefreshWebpackPlugin(),
119117
];
120118

121119
// Exports ------------------------------------------------------------>

0 commit comments

Comments
 (0)