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

Potential hot destroy fix #947

Merged
merged 2 commits into from
May 12, 2016
Merged

Potential hot destroy fix #947

merged 2 commits into from
May 12, 2016

Conversation

erikras
Copy link
Member

@erikras erikras commented May 12, 2016

Hey, @gaearon, is a reasonable for a library to examine module.hot? This fixes #623.

@erikras
Copy link
Member Author

erikras commented May 12, 2016

I'm gonna merge this, but I might roll it back if @gaearon tells me it's a terrible idea.

@erikras erikras merged commit 77e8848 into v6 May 12, 2016
@gaearon
Copy link
Contributor

gaearon commented May 12, 2016

This is a bit weird. Why is this necessary?

React Hot Loader 3 shouldn’t unmount your components.
My other hot reloading solutions (Babel plugin and React Hot Loader 1) are deprecated.

@erikras
Copy link
Member Author

erikras commented May 12, 2016

Happening with webpack-hot-middleware@2.6.0. Is that deprecated, too?

@gaearon
Copy link
Contributor

gaearon commented May 12, 2016

I would say this should be reverted.
It’s a tangible behavior difference between PROD and DEV.

If there is an issue with RHL, please file it in the RHL repo so I don’t forget to take a look.
Thanks!

@gaearon
Copy link
Contributor

gaearon commented May 12, 2016

webpack-hot-middleware@2.6.0 is irrelevant, this is just transport. Whether you use it or webpack-dev-server has no difference here.

@erikras
Copy link
Member Author

erikras commented May 12, 2016

I guess I'm not seeing any other "hot" stuff in the example that demonstrates this, which I copied from one of your simpler examples not so long ago. Do you see something in there that's deprecated?

@erikras
Copy link
Member Author

erikras commented May 12, 2016

Maybe it's this bit that needs modernizing?

@gaearon
Copy link
Contributor

gaearon commented May 12, 2016

Oh, I see what you mean now. I didn’t realize you were using vanilla HMR API.

With vanilla HMR, it’s expected that components get unmounted on change.
(That’s exactly what React Hot Loader 3 solves.)

So if Redux Form destroys on unmount, everything behaves as expected.
You can add RHL 3 to prevent unmounting on hot reload, if you’d like.

@lock
Copy link

lock bot commented Jun 2, 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 Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants