-
Notifications
You must be signed in to change notification settings - Fork 605
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 hot reloading #5246
add react-refresh hot reloading #5246
Conversation
Sounds like a win to me. |
@@ -162,6 +167,7 @@ | |||
"@types/react-transition-group": "2.x", | |||
"@types/react-virtualized": "9.x", | |||
"@types/webpack": "4.x", | |||
"babel-loader": "^8.1.0", |
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.
We need Babel now on top of TypeScript?
frontend/webpack.config.ts
Outdated
{ | ||
loader: 'babel-loader', | ||
options: { | ||
plugins: [isDevelopment && 'react-refresh/babel'], | ||
}, | ||
}, |
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.
babel-loader
should only be added if isDevelopment === true
Are there any performance changes with using babel now in dev startup and recompiling? |
@christianvogt @alecmerdler
|
c73125f
to
6c2e375
Compare
6c2e375
to
bcfe0d9
Compare
|
@glekner Thanks for the PR. I'm on board. You have a Webpack error, though.
|
/retest |
@spadgett this is weird, my env works well.
|
b821cb8
to
eb81783
Compare
@glekner The error is not in my environment. It's in CI (which uses a fresh workspace). Did you try |
frontend/webpack.config.ts
Outdated
@@ -68,6 +70,12 @@ const config: Configuration = { | |||
workers: require('os').cpus().length - 1, | |||
}, | |||
}, | |||
isDevelopment && { |
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.
This looks like the cause of the error. Won't this add false
to the array when not in development mode?
8dde73a
to
e694fc3
Compare
|
e694fc3
to
a38ee43
Compare
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.
/approve
/lgtm
a38ee43
to
faa7ff4
Compare
@spadgett upgraded plugin version |
faa7ff4
to
190a6f1
Compare
190a6f1
to
a4b1561
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glekner, spadgett 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
This adds the react-refresh webpack plugin, which makes hot component reloading really work.
My webpack PR from 8 months ago enabled an auto reload, with hot reload we won't even need to reload.
This is very beneficial for us because of websockets, they remain in tact so we don't have to wait for a cluster far away, therefore we can develop and debug a LOT faster.
This won't work for all file changes, and once they don't - a full reload is triggered ( just like the current behaviour)
files that won't hot reload:
export * from
render
logic in the same file (just like our very ownapp.jsx
)@spadgett @alecmerdler thoughts?