vaadin / spring

Spring integration for Vaadin
https://vaadin.com/start
175 stars 101 forks source link

On the fly Sass compiler issue with Vaadin 8 and Spring Boot #365

Open sander-beeyond opened 5 years ago

sander-beeyond commented 5 years ago

I'm using Vaadin 8.5.2 with Spring Boot 1.4.7 and Vaadin Spring Boot Starer 3.0.0. I'm trying to use the on the fly Sass compiler as described in the Vaadin docs but it does not work for me and it seems to be related to Spring. The Spring documentation describes that the webapp folder should not be used when packaging the application as a jar, this means the VAADIN directory would no longer be included when deploying the application. To fix this the VAADIN directory was moved to the resources directory which works fine when compiling and packaging the theme and widgetset for deployment. But this seems to have broken the on runtime Sass compiler. During development any changes to a theme only show up after compiling the themes because then the actual style.css is generated.

When the webapp directory is put back in place and the generated style.css is removed the on the fly compiler works again but only picks up changes from the webapp directory. My question on the Vaadin forum which directed me here

Reproducing the issue:

I have made a sample project with the same libraries I'm currently using: https://github.com/sander-beeyond/vaadin8-spring-sass-issue. The actual project is being migrated from Vaadin 7 to 8 at the moment which explains the use of the compatibility libraries.

On the fly compilation does not work when:

When theme adjustments inside the resources directory show up:

On the fly compilation works when:

  1. mvn clean install is executed at least once
  2. src/main/resources/VAADIN/themes/apptheme/styles.css is deleted
  3. src/main/webapp/VAADIN/themes/apptheme is added with the same content as in the resources
  4. src/main/webapp/ is asigned as a web resource directory in the project module settings
  5. mvn clean is executed
  6. The application is (re)started
  7. src/main/webapp/VAADIN/themes/apptheme/apptheme.scss is changed
  8. Refresh page

Side notes:

theshoeshiner commented 5 years ago

I'm having the same issue. Running a spring boot app in eclipse, with or without the spring tools suite, does not have any on-the-fly sass functionality. It's preventing me from really doing any form of theming.