-
Notifications
You must be signed in to change notification settings - Fork 24
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
Watch, hot reload, server restart on 1.1.0 #31
Comments
Hi @brunoimbrizi, thanks for using this plugin and filling this issue to improve it!
|
@UstymUkhman I submitted a PR removing Regarding a better approach for HMR, ideally it should be possible to update the shader without reloading the page. I can think of a way to do that with Three.js, by replacing the shader string directly in the materials that use it and forcing a shader recompile by setting |
Thank you so much @brunoimbrizi! I'm gonna merge your PR, check everything again with astro and plain vite and update you here abot the progress. What I'm pretty sure about is that with |
Ok,
|
Hi @UstymUkhman, my main motivation to use
True. I only noticed it after I submitted the PR. Assume the following scenario:
Then in order to see what's going on with
After making a change to AAA.glsl, the page reloads almost immediately and the output in the terminal is:
After making a change to BBB.glsl, the page doesn't reload and the output in the terminal is:
So a change to This is a similar scenario to a CSS
I think something like that could be implemented for GLSL |
I got a quick example working hot reloading |
@brunoimbrizi Looks awesome! Please feel free to submit a PR once you have a stable version and thank you so much for contributing to this project.
Ohh, I see. I have never tested it on large scale projects so I've never faced this issue, but sure, this is a super valid motivation.
Definitely! I have never thought it was possible to use and update vite's |
I'm closing this since |
I noticed some issues on version 1.1.0 and I also have a few questions:
watch = false
on initialisation now has no effect.server.restart()
in handleHotUpdate()?Restarting the server makes every reload much slower. A quick test removing that call (or removing handleHotUpdate altogether) resulted in much faster reloads. It seems that Vite already understands the project needs to be rebuilt without having to force restart the server.
The text was updated successfully, but these errors were encountered: