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

Add auto scan for "org.vaadin" #620

Open
stefanuebe opened this issue May 12, 2020 · 1 comment
Open

Add auto scan for "org.vaadin" #620

stefanuebe opened this issue May 12, 2020 · 1 comment

Comments

@stefanuebe
Copy link

stefanuebe commented May 12, 2020

A customer of us had the following problem: he added an addon from our directory to his Spring Boot application as maven dependency. After preparing the frontend and starting the application he got a lot of JS errors, which told him in short that the client side stuff of this addon is simply not there.

Adding "org.vaadin" as a package to scan to the @SpringBootApplication did not help. Rebuilding and restarting the application still showed the same issue.

After adding @EnableVaadin({"com.vaadin", "org.vaadin", ... }) it worked.

To be honest I by myself stumbled over this issue in the past, too and I guess it will happen to others, too, since it is not really clear from the documentation, that @EnableVaadin has to be used, too, to use addons.

Long text, short request:

Since most addons are in package "org.vaadin" (at least from what I've seen), we should add this package beside "com.vaadin" and the application package to the auto scan for custom components, so that the above mentioned @EnableVaadin arguments combo is not needed.

I'm not sure if that is technically possible, but I guess it would prevent such issues for most addons out of the box.

Also maybe extending the docs regarding this issue would be a good thing, too :)

Small, but maybe interesting side node: When testing the customer's project on my machine with NodeJS 10.x, it worked with the given SpringBootApplication annotation. The customer with NodeJS 12.x had issues.

Used Spring Boot 2.1.7 and Vaadin 14.1.27.

@Frettman
Copy link

Does this problem only exist when vaadin.whitelisted-packages is set? Otherwise the application seems to scan everything for Vaadin annotations anyway, no?

Anyway, I'd prefer a mechanism where every add-on can contribute packages it needs to be scanned. Similar like the spring.factories file that is used to contribute auto configurations in Spring Boot. That would work for all add-ons, not just the ones that happen to use the org.vaadin package (mine don't...). Also, and more importantly, this would make manually managing vaadin.whitelisted-packages obsolete.

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

No branches or pull requests

3 participants