-
Notifications
You must be signed in to change notification settings - Fork 258
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
SSE | WebSockets for auto-reload (future: HMR) #4
Comments
I started implementing hot reload for trunk. I got everything finished (backend wise) but I'm blocked by an open issue with tide, SSE simply doesn't seem to work. This might be another argument for #81 to switch away to another web server. |
So, now that we’ve got a solid WebSocket impl about to land, we can start building a proper hot reloading mechanism. A rough design:
|
Any idea which bundler for Rust Wasm frontends supports livereload? |
Right now, use |
@hamza1311 Can you recommend a server that supports live reloading that can serve any dist from the CLI? |
@Boscop, take a look at httpwatcher |
@hamza1311 Thanks, but it seems there's no way to proxy my own websocket communication (between backend and frontend) through a different port (like browsersync allows)? |
Unfortunately, I'm not aware of any servers that would do this. If you're willing to do that, I think adding live reloading would be a great addition to trunk |
Some time ago I was working at another project of mine for managing slides creation (essentially with reveal.js), and I wanted live reloading. It's not perfect, but it is working, and I took it exactly from httpwatcher, isolating the websocket from everything else:
I'm sorry not to be so expert in websockets + rust, but I'm pretty sure there should be no obstacle in repeating the same. |
Hey folks. Lots of good discussion here. We now have WebSockets support in the Trunk dev server, and we should be clear to begin implementing a mechanism for auto-reload / live-reload. There are a few options for us to consider, however considering the discussion over in #141 I am strongly tempted to say that we should attempt to knock out these two issues as part of the same objective. |
#191 is an implementation of this feature (not the HMR part though). |
Support for this has landed as part of #191 |
Does trunk support the HMR(Hot Module Replacement). If supported, how to enable it? |
I am not sure this is applicable here. Seems purely like a webpack thing. |
use WebSocket to do WASM HMR (this will probably be a beast, may not even be browser supported quite yet, we'll see).We can look into HMR in the future as WASM module linking stabilizes.The text was updated successfully, but these errors were encountered: