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

Switch to react-hot-loader v3 #1068

Closed
justingreenberg opened this issue Oct 2, 2016 · 16 comments
Closed

Switch to react-hot-loader v3 #1068

justingreenberg opened this issue Oct 2, 2016 · 16 comments

Comments

@justingreenberg
Copy link
Member

justingreenberg commented Oct 2, 2016

fall cleaning... maybe we should remove babel-preset-hmre as it relies heavily on the now deprecated https://github.com/gaearon/react-transform-hmr the question is: how important is maintaining local (react) component state between HMR reloads?

options:

edit: also see https://github.com/danmartinez101/babel-preset-react-hmre/issues/46

@mxstbr
Copy link
Member

mxstbr commented Nov 3, 2016

We should switch to React Hot Loader v3 as soon as it's stable, but I don't see why we shouldn't stick with our current setup for now as it currently works perfectly fine?

@MoOx
Copy link
Contributor

MoOx commented Nov 3, 2016

If I am correct, without RHL v3 you don't have hot loading for functional components.

@mxstbr
Copy link
Member

mxstbr commented Nov 3, 2016

That's true. Does RHL v3 at this state already have support for functional components?

@MoOx
Copy link
Contributor

MoOx commented Nov 3, 2016

Yeah, I am using it for a few months and it's perfect for me. Also included in Phenomic for a while and nobody reported any issue about it :)

@mxstbr
Copy link
Member

mxstbr commented Nov 3, 2016

Alright, let's switch to RHL v3 then!

@mxstbr mxstbr changed the title RFC: Remove hmre preset in favor of vanilla HMR or RHL3 RFC: Remove hmre preset in favor of RHL3 Nov 3, 2016
@mxstbr mxstbr changed the title RFC: Remove hmre preset in favor of RHL3 Switch to react-hot-loader v3 Nov 3, 2016
@kachkaev
Copy link
Contributor

Hi guys,

I came up with a question and decided to ask it here since it's related to how the app is being reloaded. When editing certain parts of the app like redux actions, we all constantly see the following message in the browser's console: [HMR] The following modules couldn't be hot updated: (Full reload needed). This is normally followed with a manual page refresh.

I once tried create-react-app and got used to their robust cold reloading every time a JS file changes. So after going back to this boilerplate, I started to feel lazy going back to the browser from time to time after seeing a long yellow message in the corner of the dev tools.

I'm wondering how hard would it be to optionally enable cold reloading when HMR has failed. I know that this would imply the loss of states, but this is not a problem if redux store is persisted.

Could anyone suggest how to trigger a full reload? Just spent > 1hr on this and gave up :-)

@manelpb
Copy link

manelpb commented Nov 24, 2016

@kachkaev try to create your components using React.Component instead. It will auto reload

@kachkaev
Copy link
Contributor

@manelpb yeah I know that I can use React.Component instead of React.PureComponent or functions, but that potentially creates performance problems. Even if I do so, there will be still cases when webpack won't be able to reload itself and show me that yellow please refresh message in the console. I'm just wondering how I can automate this refresh.

@jptissot
Copy link
Contributor

I don't have a complete example of this at hand (only private project code) but I was able to use Webpack 2.2 and RHL3 with this boilerplate. It required some moving of code a bit but It works great !

@MichaelIT
Copy link

MichaelIT commented May 13, 2017

image
I am trying use RHL3 in dev branch, But I get some error like @kachkaev . I have spend about 4 hour to google and fix it.But I am faild.Every time I change any component ,it will reload page. 😢

@kai23
Copy link

kai23 commented May 31, 2017

Same as @MichaelIT here, can't make it working.

@kachkaev
Copy link
Contributor

Here is what helped in old webpack #1357

Maybe there is an alternative in v2?

@kai23
Copy link

kai23 commented May 31, 2017

I'm back to the old hmre for the moment, it doesn't work on everything but it's sill better than nothing. I'm waiting for the 3.5 to see if something changes.

1 similar comment
@kai23
Copy link

kai23 commented May 31, 2017

I'm back to the old hmre for the moment, it doesn't work on everything but it's sill better than nothing. I'm waiting for the 3.5 to see if something changes.

@Dattaya
Copy link
Member

Dattaya commented Jul 24, 2017

Fixed in #1871

@Dattaya Dattaya closed this as completed Jul 24, 2017
@lock
Copy link

lock bot commented May 29, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants