vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
612 stars 167 forks source link

Auto-detection for Hilla's endpoints #18800

Open mshabarov opened 7 months ago

mshabarov commented 7 months ago

Describe your motivation

Vaadin Flow adds endpoints generation Node Tasks (see NodeTasks::addEndpointServicesTasks) if Hilla's views are present and base Hilla class is in class path. This, however, doesn't take into account a presence of endpoint classes marked by AtEndpoint or AtBrowserCallable, which leads to wrong detection and not generating the endpoints in the end.

Describe the solution you'd like

Vaadin Flow can check:

Additional context

Vaadin 24.4.

mcollovati commented 7 months ago

Can we also prevent running TaskGenerateEndpoint if there are no endpoint annotated classes? (I mean when potential Hilla views are detected, but there are no endpoint implementations)

mshabarov commented 7 months ago

Yeah, it would be reasonable to skip it. Let's also check if skipping it has any side effects.