Closed michallichvar closed 5 years ago
Do you have lots of dependent classes in the project?
2019-08-19 08:22:42.851 INFO 5856 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2692 ms
2019-08-19 08:24:26.218 INFO 5856 --- [ restartedMain] c.v.f.server.startup.DevModeInitializer : Starting dev-mode updaters in C:\Users\lichvar\IdeaProjects\gims\gims-frontend folder.
The lines make seem that the ClassScanning is taking the time. We have the ticket https://github.com/vaadin/spring/issues/476 for adding clarity to where time is spent.
For a start you could try adding a WhiteList for packages to scan for the annotations: Route
and NpmPackage
Please see documentation for the whitelist parameter https://vaadin.com/docs/v14/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters
Similar issue https://github.com/vaadin/flow/issues/5803
sorry even from #5803 I haven't figured out how to setup white/blacklist property. I tried vaadin.blacklisted-packages=^(java|sun|elemental|javax|org.(apache|atmosphere|jsoup|jboss|w3c|spring|joda|hibernate|glassfish|hsqldb)|com.(helger|spring|gwt|lowagie|google|fasterxml)|net.(sf|bytebuddy)).*
still over minute
Whitelist and blacklist do not use regex so they need to be set as in the documentation. the default blacklist consist of the exlusions:
"antlr", "cglib",
"ch/quos/logback", "commons-codec", "commons-fileupload",
"commons-io", "commons-logging", "com/fasterxml", "com/google",
"com/h2database", "com/helger",
"com/vaadin/external/atmosphere", "com/vaadin/webjar", "javax/",
"junit", "net/bytebuddy", "org/apache", "org/aspectj",
"org/bouncycastle", "org/dom4j", "org/easymock", "org/hamcrest",
"org/hibernate", "org/javassist", "org/jboss", "org/jsoup",
"org/seleniumhq", "org/slf4j", "org/atmosphere",
"org/springframework", "org/webjars/bowergithub", "org/yaml"
OK, it's not about whitelist or blacklist, it's about vaadin:build-frontend.
Before start of spring-boot, you should do mvn vaadin:prepare-frontend mvn vaadin:build-frontend (in migration docu, this step is mentioned just for production-mode)
and after that start aplication.
Now start is under 5s.
Even class hotswap works fine.
but auto redeploy of css file is now not working :-/
If you run build-frontend
the project will not run the webpack dev server.
This will make the project start faster as now we do not scan for frontend annotations or start the dev server, but you loose the frontend updates during development.
The time spent comes from when we try to find any frontend data that needs to be added or copied and giving a whitelist of vaadin.whitelisted-packages=com/project/package
(in application.properties) would drastically limit the scope that we try to look at for finding Route(s), NpmPackage(s) and WebComponentExporter(s) that will be visited for components.
It seems to be related with https://github.com/vaadin/flow/issues/6404
Not sure what there still left for this issue. Please create a new issue with description on what is broken and when, I'm closing this one.
Description of the bug: Starting my spring-boot project in IDE takes several minutes, because from Vaadin 14, NPM is required and it starts very slowly. With vaadin.compatibilityMode=true it starts within seconds. As compatibilityMode is some temporary solution and won't be in Vaadin 15, I do not want to develop in it even now. I'm not sure whether the logic underhood is the same (between compMode and Vaadin 14)
I have DevTools in pom.
Minimal reproducible example: Any simple spring-boot project with node.js and NPM installed.
Expected behavior: To run within seconds, as with compatibilityMode:
Actual behavior:
Versions:
vaadin-springboot-compatibilitymode.log vaadin-springboot-npm.log