-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Revisit Dev Tools live reload capabilities #32111
Comments
Thanks for the suggestion, I think we should revisit this at some point. There's also https://browsersync.io/docs/gulp which might help. |
While the livereload browser extensions aren't maintained, the core livereload/livereload-js project is. I've tried pulling it in as a WebJar and including it in my templates and it just works. I can try putting together a PR that explores this approach, if you don't have anything against it. |
That would be useful if you have time, but we're not likely to get to this until after 3.0 has been released so no rush on our side. Perhaps we might be able to bundle livereload-js ourselves so we don't need to use webjars. |
Got it.
I too was thinking the solution that lands in Spring Boot should include the script in In the meanwhile, I did a PoC for this that's serving me well in a couple of projects. I've extracted it to vpavic/poc-spring-boot-livereload in case anyone else finds this interesting. Feel free to assign this issue to me, I'll try to prepare a PR over the next couple of weeks. |
Thanks, @vpavic. I've assigned the issue to you. |
In revisiting this, it would be very nice to have live reloading when Spring Boot is behind a reverse proxy e.g. nginx. With Next.js they are using WebSockets to handle the reloading communication. No browser extension is required. For example the following nginx reverse proxy directive allows live reloading:
Is it feasible for Spring Boot live reloading to use WebSockets and ditch the browser extension all together? |
Would it be possible to trigger a LiveReload after "Update classes and resources"? This is the default behaviour on frame deactivation in IntelliJ now, after @joshlong opened a Issue for that: YouTrack Something like this: class compilation -> hot swap -> live reload event If I call |
This commit improves Dev Tools live reload capabilities by adding support for appending LiveReload.js script to rendered web pages. See spring-projectsgh-32111
Long overdue, but I've finally submitted a PR that attempts to resolve this - see #43697. |
Currently, as explained in LiveReload section of the reference manual, Dev Tools support for live reload requires use of 3rd party browser extensions. The suggested extensions have been unmaintained for more than a few years now as evident by the last publishing dates and the activity in the appropriate repos:
In addition to that, the linked livereload.com site itself is down, which apparently isn't a transient issue as wayback machine was last able to index it on Jun 10th.
With this in mind Spring Boot should IMO revisit live reload capabilities of Dev Tools module. Additionally, some other technologies that I've work with recently offer live reload capabilities without requiring browser extensions at all. Some examples of that are hugo and even IntelliJ IDEA. Both of these work by appending the script within the served HTML, which contains some code that updates the page when needed. Something like this would both improve the developer experience and also remove the requirement to use (unmaintained) 3rd party browser plugins.
The text was updated successfully, but these errors were encountered: