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

Hot reload for islands #316

Open
notangelmario opened this issue Jun 29, 2022 · 11 comments
Open

Hot reload for islands #316

notangelmario opened this issue Jun 29, 2022 · 11 comments
Labels
feat New feature or request

Comments

@notangelmario
Copy link
Contributor

Is fresh capable of hot reloading while in dev mode? If not, would it be possible?

@fulsomenko
Copy link

If by hot reloading you mean the changes appear in your browser when you save a file. Then yes.

@notangelmario
Copy link
Contributor Author

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

@lucacasonato
Copy link
Member

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).

@lucacasonato lucacasonato changed the title Hot reloading? Hot reload for islands Jun 29, 2022
@notangelmario
Copy link
Contributor Author

well yes, I would not expect hot reloading for prerendered content. but it would be nice for islands

@lucacasonato lucacasonato added the feat New feature or request label Jul 4, 2022
@zoeleu
Copy link

zoeleu commented Jul 5, 2022

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.

@lucacasonato
Copy link
Member

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 :)

@zoeleu
Copy link

zoeleu commented Jul 5, 2022

Weird, it's not refreshing when I do changes.

@notangelmario
Copy link
Contributor Author

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

@dector
Copy link

dector commented Sep 8, 2022

@matteoturini

Weird, it's not refreshing when I do changes.

If you are using FF - check #694

@marcelocra
Copy link

marcelocra commented Jan 21, 2023

(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.

@jiawei397
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants