-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: speedup startup time by excluding jars #19395
Conversation
Optimize class scanning of VaadinServletContextInitializer by excluding some commonly used jars and add support for vaadin.blocked-jar boolean property in META-INF/VAADIN/package.properties to exclude whole jar content from the class scanner. Fixes: #19112
vaadin-spring/src/main/java/com/vaadin/flow/spring/VaadinServletContextInitializer.java
Show resolved
Hide resolved
private static final List<String> DEFAULT_SCAN_NEVER_JAR = Stream.of( | ||
"antlr", "logback-classic", "logback-classic-core", | ||
"commons-codec-", "commons-fileupload", "commons-io", | ||
"commons-logging", "commons-exec", "commons-lang", "jackson-", | ||
"atmosphere-runtime", "byte-buddy", "commons-compress", | ||
"aspectjweaver", "hibernate-core", "hibernate-commons", | ||
"hibernate-validator", "jboss-logging", "/selenium-", "slf4j", | ||
"/spring-", "org/webjars/bowergithub", "snakeyaml", | ||
|
||
"javax.", "jakarta.", "kotlin-", | ||
|
||
"gwt-elemental", "javassist", "javaparser-core", | ||
"javaparser-symbol", "oshi-core", "micrometer-", "nimbus-jose-jwt", | ||
|
||
"/hilla-engine-core-", "/hilla-engine-runtime-", | ||
"/hilla-parser-jvm-", "/hilla-runtime-plugin-").toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: why some of the patterns start with /
and others not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably add jooq
and jooq-
to the list, since JOOQ is a quite popular library.
And also some additional Vaadin transitive dependency, such as directory-watcher, classgraph, jsoup, throw-if-servlet3, ph-css, ph-commons, gentyref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern is checked with contains
function. Concern with these patterns is that someone may add custom-hilla-engine-core.jar, which may or may not have Vaadin classes. Starting with slash ensures that we don't accidentally exclude too much. Some of the names are less risky than others. Your suggestions seems safe except jsoup, which could be /jsoup
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matching to jar file name only will simplify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to take that back. We still need the slash in the beginning e.g. for vaadin-spring-*.jar which caused issues as it was blocked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see
vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java
Outdated
Show resolved
Hide resolved
Fixed null jar path. Checking jar name only instead of full paths. Added more default excluded jar name patterns. Added IT for a jar excluded by default.
vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java
Outdated
Show resolved
Hide resolved
vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java
Outdated
Show resolved
Hide resolved
Added more default blocked patterns. Added support for /META-INF/VAADIN/blocked-jars.list to override default blocked jar list.
vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java
Outdated
Show resolved
Hide resolved
vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Great job @tltv
Quality Gate passedIssues Measures |
This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version. |
Optimize class scanning of VaadinServletContextInitializer by excluding some commonly used jars and add support for vaadin.blocked-jar boolean property in META-INF/VAADIN/package.properties to exclude whole jar content from the class scanner.
Fixes: #19112