brazerzkidaithunder.blogg.se

Dev livereload atom
Dev livereload atom












  1. #Dev livereload atom how to
  2. #Dev livereload atom code

The restart functionality of Spring Boot Dev Tools listens to changes to the files in our application and then throws away and restarts the restart classloader.

  • the restart classloader contains the files of our application, which are expected to change in our dev loop.
  • the base classloader contains rarely changing resources like the Spring Boot JARs or 3rd party libraries.
  • To do this, Spring Boot Dev Tools divides the application’s classpath into two classloaders: Spring Boot Dev Tools hooks into the classloader of Spring Boot to provide a way to restart the application context on-demand or to reload changed static files without a restart. Having a solid understanding will help in finding and fixing inevitable issues when optimizing the dev loop of your project.

    dev livereload atom

    You might say it’s not important to know the details of how Spring Boot Dev Tools work, but since a lot of things can break in auto-reloading files, I think it’s good to know how Spring Boot Dev Tools works under the cover.

  • our browser window automatically refreshes and shows the changes.
  • the IDE runs a background task that updates the classpath of the running application.
  • dev livereload atom

  • we change a file in our IDE and save it.
  • So, the dev loop we’re aiming for looks like this:
  • resources files like properties or other configuration files.įiles that need to be compiled (like Java files), will require a restart of the Spring application context.įor files that don’t need to be compiled (like HTML templates), we want the turnaround time to be even faster, as they don’t require a restart of the application context.
  • static assets like Javascript files or CSS.
  • We want that any changes we do to files are visible in the running Spring Boot app a couple of seconds later.

    #Dev livereload atom code

    This article is accompanied by a working code example on GitHub.īefore we start, let’s describe what we want to achieve for our developer experience with Spring Boot.

    dev livereload atom

    #Dev livereload atom how to

    This article explains how Spring Boot Dev Tools works and how to configure it to your Spring Boot application consisting of a single or multiple Gradle modules (it will probably also work with Maven, with some changes, but this article will only show the Gradle configuration). It took me some time to set it up to my satisfaction (and then some more time to build a Gradle plugin that makes the setup easier), but it was worth it. Until I got fed up with it and gave Spring Boot Dev Tools a try. Sound familiar? That’s pretty much how I developed Spring Boot apps for a long time. Then, you log back into the app, navigate to where you were before, and check if your changes work. You probably restart it and go get a coffee or swipe through your Twitter feed until it’s up and running again. What are you doing when you’ve made a change to a Spring Boot app and want to test it?














    Dev livereload atom