Skip to content

Commit d6d59a2

Browse files
juslegJudahmeek
authored andcommitted
Remove unsupported overlay property for ReactRefreshWebpackPlugin
The v0.6.0 release introduced breaking changes which removed `sockPort` as a property https://github.com/pmmmwh/react-refresh-webpack-plugin/releases/tag/v0.6.0. (pr: pmmmwh/react-refresh-webpack-plugin#850). This updates the generator template for development.js to no longer pass the property. This was tested by successfully creating a new rails 8.0.2 project with ReactRefreshWebpackPlugin 0.6.1 and following the tutorial (https://www.shakacode.com/react-on-rails/docs/guides/tutorial/)
1 parent 673c85a commit d6d59a2

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ To enable the HMR functionality, you have to use `./bin/shakapacker-dev-server`
8585
}
8686
```
8787

88-
We added `overlay.sockPort` option in `ReactRefreshWebpackPlugin` to match the webpack-dev-server port specified in `config/shakapacker.yml`. This makes SockJS works properly and fixes this error in browser console: `GET http://localhost:[port]/sockjs-node/info?t=[xxxxxxxxxx] 404 (Not Found)`.
88+
We added `overlay.sockPort` option in `ReactRefreshWebpackPlugin` to match the webpack-dev-server port specified in `config/shakapacker.yml`. This makes SockJS works properly and fixes this error in browser console: `GET http://localhost:[port]/sockjs-node/info?t=[xxxxxxxxxx] 404 (Not Found)`. When using `ReactRefreshWebpackPlugin` with `v0.6.0` and newer, `overlay.sockPort` is [no longer supported](https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/850) and should be omitted from the configurations.
8989

9090
4. Add the react-refresh plugin in `babel.config.js`
9191

docs/guides/rails-webpacker-react-integration-options.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ You can see an example commit of adding this [here](https://github.com/shakacode
134134
if (isWebpackDevServer) {
135135
environment.plugins.append(
136136
'ReactRefreshWebpackPlugin',
137-
new ReactRefreshWebpackPlugin({
138-
overlay: {
139-
sockPort: 3035,
140-
},
141-
}),
137+
new ReactRefreshWebpackPlugin({}),
142138
);
143139
}
144140
```

lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => {
1313
// eslint-disable-next-line global-require
1414
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
1515
clientWebpackConfig.plugins.push(
16-
new ReactRefreshWebpackPlugin({
17-
overlay: {
18-
sockPort: devServer.port,
19-
},
20-
}),
16+
new ReactRefreshWebpackPlugin({}),
2117
);
2218
}
2319
};

spec/dummy/config/webpack/development.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => {
1313
// eslint-disable-next-line global-require
1414
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
1515
clientWebpackConfig.plugins.push(
16-
new ReactRefreshWebpackPlugin({
17-
overlay: {
18-
sockPort: devServer.port,
19-
},
20-
}),
16+
new ReactRefreshWebpackPlugin({}),
2117
);
2218
}
2319
};

0 commit comments

Comments
 (0)