-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Auto reload for get new changes! #292
Comments
Live reloading is a wonderful feature. However, supporting it in a compiled language is rather difficult. There is some work done in making it possible to do dynamic loading in Rust, but again, this kind of thing is very difficult in a compiled system, and therefore the current state of this is not mature enough to include in Rocket, I think. more information. |
So Auto Reload in case of source code changes is probably not viable right now, but what about reloading the templates automatically? Is it possible somehow for Tera templates for example? |
See #163 regarding the templates reloading |
I think something like per-route live reloading would be absolutely incredible, but given the complexities involved and the nature of Rust, is unlikely to ever happen. Nonetheless, incremental compilation is actively being worked on by the Rust team, so simply recompiling and restarting should eventually be plenty fast. Coupled with something like For templating specifically, I think it would be nice if Rocket could reload templates automatically during development. Further, I think it's absolutely possible, and quite simple, in fact, given the new fairings and the new |
Hello, in case anyone comes across this issue like I did, there's a pretty simple, "Unixy" workaround that will reload the development server whenever a file changes: fd -g "*.rs" | entr -r cargo run |
For me the following shell code works: |
I use cargo-watch |
For posterity, note that since this issue, Rocket has gained the ability to automatically live-reload templates. This is enabled by default when the application is compiled in debug mode. There is no need to use external tools if the desire is to see changes to templates as they happen. If code changes occur elsewhere, however, the suggestion to use tools like |
I use cargo-make # Makefile.toml
# cargo make watch
[tasks.watch]
command = "cargo"
args = ["run"]
watch = true |
Thanks you |
Auto reload server when change source code for get new changes in development mode. What are you think about it?
The text was updated successfully, but these errors were encountered: