After I use v4, I feel very good because of change less code than v3!
So I have a fantasy idea, that is, in the future, can we don't need to change any code to use react-hot-loader?
PS: I found the latest version of vue-loader has already achieved it.
Thanks a lot!
The steps to make it:
hotThis is doable for .vue, .tsx or .jsx, as long it is possible to understand - HERE IS THE COMPONENT, you can reload in isolation.
But lots of people use plain js to write the code. React-hot-loader v1 does contain this sort of automagic, but it was build for the older versions React, when Stateless components does not exists.
There is no (stable) way to distinguish function stateless component and a function :( So there is no (stable) way to setup HMR for random set of files.
It is still possible to detect the places where HRM could be safely injected, (for lots of use cases one point ("App") is enough) just by analyzing module dependencies, and should be researched.
Thanks for your reply! I will try to research it.
Most helpful comment
The steps to make it:
hotThis is doable for .vue, .tsx or .jsx, as long it is possible to understand - HERE IS THE COMPONENT, you can reload in isolation.
But lots of people use plain js to write the code. React-hot-loader v1 does contain this sort of
automagic, but it was build for the older versions React, when Stateless components does not exists.There is no (stable) way to distinguish function stateless component and a function :( So there is no (stable) way to setup HMR for random set of files.
It is still possible to detect the places where HRM could be safely injected, (for lots of use cases one point ("App") is enough) just by analyzing module dependencies, and should be researched.