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

Replace react-hot-loader with react-refresh #3942

Merged
merged 1 commit into from May 29, 2023
Merged

Conversation

eikhr
Copy link
Member

@eikhr eikhr commented May 28, 2023

Description

Faster, better and crashes less:)

As recommended by the author of react-hot-loader: https://github.com/gaearon/react-hot-loader#moving-towards-next-step

Result

Better dev experience

Testing

  • I have thoroughly tested my changes.

Please describe what and how the changes have been tested, and provide instructions to reproduce if necessary.


Resolves ... (either GitHub issue or Linear task)

@eikhr eikhr added future-was-2-years-ago Pull requests that introduce technologies which should have been "long" ago review-needed Pull requests that need review technical-debt Pull requests that reduces technical debt labels May 28, 2023
Copy link
Member

@juniwbjerde juniwbjerde left a comment

Choose a reason for hiding this comment

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

lgtm:)

@@ -39,6 +40,7 @@ module.exports = (env, argv) => {

plugins: [
!isProduction && new webpack.HotModuleReplacementPlugin(),
!isProduction && new ReactRefreshWebpackPlugin(),
Copy link
Member

Choose a reason for hiding this comment

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

Does this work?

Copy link
Member Author

@eikhr eikhr May 29, 2023

Choose a reason for hiding this comment

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

I think so? Any reason why it wouldn't?
In my testing it works fine

Copy link
Member

Choose a reason for hiding this comment

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

Haven't looked too much at this but I would think fast refresh needs some we apis to send the updated code? Don't know how it would do this in node? But if it's tested and its documented then that's great!

Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

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

Looks good, I guess. Near impossible to actually understand webpack conf

Perhaps deploy this branch to prod at night time to see if it actually works? :)

@eikhr eikhr merged commit bf68417 into master May 29, 2023
4 checks passed
@eikhr eikhr deleted the react-fast-refresh branch May 29, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future-was-2-years-ago Pull requests that introduce technologies which should have been "long" ago review-needed Pull requests that need review technical-debt Pull requests that reduces technical debt
Projects
None yet
4 participants