On the fly Sass compiler issue with Vaadin 8 and Spring Boot
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 186
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
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:
- /main/resources/VAADIN/themes/apptheme/styles.css is present
- The webapp folder is deleted and its content are moved to /main/resources/VAADIN
- /main/resources/VAADIN/themes/apptheme/apptheme.scss is changed
When theme adjustments inside the resources directory show up:
- After recompiling the themes or mvn clean install which generates styles.css and restaring the application
- After recompiling the themes or mvn clean install which generates styles.css and refreshing the page
On the fly compilation works when:
- mvn clean install is executed at least once
- src/main/resources/VAADIN/themes/apptheme/styles.css is deleted
- src/main/webapp/VAADIN/themes/apptheme is added with the same content as in the resources
- src/main/webapp/ is asigned as a web resource directory in the project module settings
- mvn clean is executed
- The application is (re)started
- src/main/webapp/VAADIN/themes/apptheme/apptheme.scss is changed
- Refresh page
Side notes:
- The apptheme is found, updated and compiled 2 times during a maven install when present in both /main/resources/VAADIN and /main/webapp/VAADIN
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked sample project and comparing the documented Vaadin runtime Sass setup with the Spring Boot resource layout described in the issue. Reproduce the listed resource and webapp cases; done means changes to apptheme.scss under src/main/resources/VAADIN are picked up without generating styles.css or restoring src/main/webapp.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100