-
Notifications
You must be signed in to change notification settings - Fork 801
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
Preact-hot-loader #952
Comments
Ok. So here is the plan. I'll describe the problems, and a few ways to solve them. How RHL v3 works?It uses babel to "register" all top level variables (including Components), and then replace "real" ones by "fake" on createElement call. The problems here - HOCs and decorators. They are not a "single" top level variable, usually they are top level+internal. And that internal is invisible for v3. What did v4 changedExactly this moment. It first "hydrates" the tree, and then starts traversing the old and the new tree simultaneously. But with preact we don't have the old tree to traverse, as long is it "VDOM-free". How to solve?!I have 2 ideas, both are great, both will work. Idea 1. Put everything inside.Completely disable RHL "hot-renderer" Actually - this is hot react-hot-loader should work from the scratch. Could be easy implemented both in React and Preact. As result it could compare existing component with a potential one, and diside - should it be hot-replaced or not. But it will require changes in base libraries. ####Idea 2. Don't rely on the internals. Remove all "getStack" related code. We will not need it anymore. So - on some component render, we can detect that hot-replacement-render should be run, and then "roll back" the proxy registrations, thus being able to render the old tree. SO?Both ways could reduce technical debt and greatly simplify how RHL works. |
feat: basic Preact support. Implements #952
fixed in v4.3.0 |
Original issue - preactjs/preact#1007
The text was updated successfully, but these errors were encountered: