-
-
Notifications
You must be signed in to change notification settings - Fork 636
Remove unsupported overlay property for ReactRefreshWebpackPlugin #1739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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/)
WalkthroughThe changes update documentation and configuration files to remove the use of the Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md (1)
88-88
: Fix grammatical issues in the documentation.The explanation is accurate and helpful, but there are several grammatical issues that should be corrected for better readability.
Apply this diff to fix the grammatical issues:
- 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. + We added the `overlay.sockPort` option in the `ReactRefreshWebpackPlugin` to match the webpack-dev-server port specified in `config/shakapacker.yml`. This makes SockJS work properly and fixes this error in the 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.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md
(1 hunks)docs/guides/rails-webpacker-react-integration-options.md
(1 hunks)lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt
(1 hunks)spec/dummy/config/webpack/development.js
(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt (5)
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/clientStartup.ts:18-21
Timestamp: 2025-02-13T16:50:47.848Z
Learning: In the react_on_rails module, the `reactOnRailsPageUnloaded` function in clientStartup.ts is intentionally kept private as it's only used internally as a callback for `onPageUnloaded`.
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/RSCWebpackLoader.ts:0-0
Timestamp: 2025-02-13T19:09:15.991Z
Learning: In React Server Components webpack loader, using `new Function('return import("react-server-dom-webpack/node-loader")')()` is necessary as a workaround to bypass TypeScript compilation issues with direct dynamic imports.
Learnt from: alexeyr-ci
PR: shakacode/react_on_rails#1644
File: node_package/src/ReactOnRailsRSC.ts:87-87
Timestamp: 2024-12-12T13:07:09.929Z
Learning: When handling errors in 'node_package/src/ReactOnRailsRSC.ts', include the error stack in error messages in development and test environments to aid debugging.
docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md (1)
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/RSCWebpackLoader.ts:0-0
Timestamp: 2025-02-13T19:09:15.991Z
Learning: In React Server Components webpack loader, using `new Function('return import("react-server-dom-webpack/node-loader")')()` is necessary as a workaround to bypass TypeScript compilation issues with direct dynamic imports.
spec/dummy/config/webpack/development.js (3)
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/RSCWebpackLoader.ts:0-0
Timestamp: 2025-02-13T19:09:15.991Z
Learning: In React Server Components webpack loader, using `new Function('return import("react-server-dom-webpack/node-loader")')()` is necessary as a workaround to bypass TypeScript compilation issues with direct dynamic imports.
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/clientStartup.ts:18-21
Timestamp: 2025-02-13T16:50:47.848Z
Learning: In the react_on_rails module, the `reactOnRailsPageUnloaded` function in clientStartup.ts is intentionally kept private as it's only used internally as a callback for `onPageUnloaded`.
docs/guides/rails-webpacker-react-integration-options.md (4)
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/clientStartup.ts:18-21
Timestamp: 2025-02-13T16:50:47.848Z
Learning: In the react_on_rails module, the `reactOnRailsPageUnloaded` function in clientStartup.ts is intentionally kept private as it's only used internally as a callback for `onPageUnloaded`.
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: node_package/src/RSCWebpackLoader.ts:0-0
Timestamp: 2025-02-13T19:09:15.991Z
Learning: In React Server Components webpack loader, using `new Function('return import("react-server-dom-webpack/node-loader")')()` is necessary as a workaround to bypass TypeScript compilation issues with direct dynamic imports.
🪛 LanguageTool
docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md
[uncategorized] ~88-~88: You might be missing the article “the” here.
Context: ... }), ); } ``` We added overlay.sockPort
option in `ReactRefres...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~88-~88: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...fig/shakapacker.yml`. This makes SockJS works properly and fixes this error in browse...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
[uncategorized] ~88-~88: You might be missing the article “the” here.
Context: ... works properly and fixes this error in browser console: `GET http://localhost:[port]/s...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
🔇 Additional comments (3)
lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt (1)
16-16
: LGTM: Correctly removes unsupported overlay configuration.The change appropriately removes the
overlay.sockPort
configuration that was deprecated in ReactRefreshWebpackPlugin v0.6.0, using an empty options object instead.docs/guides/rails-webpacker-react-integration-options.md (1)
137-137
: LGTM: Documentation example correctly updated.The example properly reflects the removal of the unsupported
overlay.sockPort
configuration, showing users the correct way to instantiate the plugin with current versions.spec/dummy/config/webpack/development.js (1)
16-16
: LGTM: Test configuration properly updated.The dummy application configuration correctly removes the unsupported overlay configuration, ensuring consistency with the generator template.
Summary
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/)Pull Request checklist
Other Information
This change is
Summary by CodeRabbit
Documentation
Chores