Skip to content
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

Add react-refresh for WDS #5840

Merged

Conversation

glekner
Copy link
Contributor

@glekner glekner commented Jun 28, 2020

Ok, lets try this again.
This is the same code from the previous PR with 2 changes:

  1. react-refresh will only trigger on WDS scenarios, omitting webpack --mode=development.
    This change fixes yarn check-cycles and yarn dev-once
  2. Switched WDS transportMode to ws instead of SockJS:
    ws mode will become the default mode in the next major devServer version. This mode uses ws as a server, and native WebSockets on the client.
    This fixes the iframe errors, Topology view now works on my env. ws is now the recommended approach, and 97.57%
    of browsers support it

@christianvogt @rawagner @spadgett
can we review this again and make sure it all works? this feature is a blessing :)

Comment on lines 154 to 156
"peerDependencies": {
"type-fest": "0.16.0"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this peer dependency here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/README.md

Note 1: If you use webpack.config.ts, please also install type-fest as a peer dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But peer dependencies aren't installed by default.
If this is required then it should be a dev dependency. But if everything works without it, then just this peer dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well everything works like this, also he mentions in the readme to install is as peer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @christianvogt said, the peer dependencies are not installed. It seems to me that the README is just worded weirdly - type-fest is peerDepedency of react-refresh-webpack-plugin which means it should be in our devDependencies

@glekner
Copy link
Contributor Author

glekner commented Jul 2, 2020

  • Removed peer dependency

Getting this warning when the page loads for the first time, it doesn't seem to hurt functionality, and it doesn't appear again.
looks like we need to input https://webpack.js.org/configuration/dev-server/#devserversockpath
I Opened an issue to get more info, but maybe we shouldn't block, as it doesn't have any effect on the usage.
Annotation 2020-07-02 203714

@christianvogt
Copy link
Contributor

While I don't know the side effect of this error, hot reloading worked for me in testing.

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, glekner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 3, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 9a7550c into openshift:master Jul 3, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 8, 2020
@spadgett spadgett added the kind/dependency-change Categorizes issue or PR as related to changing dependencies label Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/dependency-change Categorizes issue or PR as related to changing dependencies lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants