fresh
fresh copied to clipboard
Hot reload for islands
Is fresh capable of hot reloading while in dev mode? If not, would it be possible?
If by hot reloading you mean the changes appear in your browser when you save a file. Then yes.
yes i noticed. but I mean could the framework only refresh the component that needs to be updated? this is considered it is used with preact
It is not capable of doing this now. It may be possible that we can support this for islands in the future, but Fresh will never support this for generic pages, as there is no infrastructure for rendering pages on the client (pages are always server side rendered).
well yes, I would not expect hot reloading for prerendered content. but it would be nice for islands
This would be possible by injecting a WebSocket script, and telling the browser to refresh with every change. This would be pretty bare bones, and doesn't maintain state, but hey, it would be a start.
This would be possible by injecting a WebSocket script, and telling the browser to refresh with every change. This would be pretty bare bones, and doesn't maintain state, but hey, it would be a start.
It already does this :)
Weird, it's not refreshing when I do changes.
i'm doing some research on how preact handles hot reloading aka preferesh. i'm working on a fix now and will open a pr soon
@matteoturini
Weird, it's not refreshing when I do changes.
If you are using FF - check #694
(Just adding Hot Module Replacement - HMR - here to make it easy for people looking for that in Fresh. Now it will appear in GitHub issue search results.)
It already does this :)
@lucacasonato What do you mean by this? Does it maintain island state? Because if so, it is not currently working for me.
i'm doing some research on how preact handles hot reloading aka preferesh. i'm working on a fix now and will open a pr soon
Do you have any news now?