Skip to content
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

Allow fine tuning of class scanning in FrontendDependencies #20977

Open
mcollovati opened this issue Feb 11, 2025 · 0 comments
Open

Allow fine tuning of class scanning in FrontendDependencies #20977

mcollovati opened this issue Feb 11, 2025 · 0 comments

Comments

@mcollovati
Copy link
Collaborator

Describe your motivation

To optimize the production build, the FrontendDependencies class performs a byte-code scan to find all potential frontend dependencies that are referenced by the application.
Currently, to speed up the scan, a list of ignored packages and class name patterns are hard-coded into the class.

While it works well for most of the projects, Flow cannot know all dependencies in advance that a project might use and that do not contain references to frontend packages.
On the other hand, community add-ons may be ignored mistakenly because they are using a package name that Vaadin filters out.

Describe the solution you'd like

In addition to the hard-coded list, allow the developers to configure Maven and Gradle plugins to specify their custom inclusion/exclusion sets.
Inclusion and exclusions can be defined as regular expressions, and if present they override the hard-coded rules (or there can still be a minimal hard-coded exclusion set).

<configuration>
   <frontendScan>
       <excludes>
          <exclude>java|sun|oracle|elemental|javax|javafx|jakarta|oshi|cglib</exclude>
          <exclude>org\.(apache|antlr|atmosphere|aspectj|jsoup|jboss|w3c|spring|joda|hibernate|glassfish|hsqldb|osgi|jooq|springframework|bouncycastle|snakeyaml|keycloak|flywaydb)\b</exclude>
      </excludes>
     <includes>
         <include>com\.application</include>
     <includes>
   </frontendScan>
</configuration>

Describe alternatives you've considered

Vaadin Spring integration already has a concept of filtering that can be adjusted with vaadin.allowed-packages and vaadin.blocked-packages properties.
However, they are used only in development mode for Spring projects and are supposed to be stored in the application.properties files; the build tool plugins currently do not read that file (because it may not be present at all).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants