Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Auto-detection for Hilla's endpoints #18800

Closed
mshabarov opened this issue Feb 26, 2024 · 2 comments · Fixed by vaadin/hilla#2938 or #20567
Closed

Auto-detection for Hilla's endpoints #18800

mshabarov opened this issue Feb 26, 2024 · 2 comments · Fixed by vaadin/hilla#2938 or #20567

Comments

@mshabarov
Copy link
Contributor

mshabarov commented Feb 26, 2024

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:

  • the presence and content of a frontend/generated/openapi.json file (if this file exists at the point where we need to take a decision in Flow about starting the generator), specifically the "tags" json array.
  • presence of any AtEndpoint or AtBrowserCallable annotations in the project.

Additional context

Vaadin 24.4.

@mcollovati
Copy link
Collaborator

mcollovati commented Feb 26, 2024

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
Copy link
Contributor Author

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

@github-project-automation github-project-automation bot moved this from Maybe to Done / Pending Release in Vaadin Flow enhancements backlog (Vaadin 10+) Feb 3, 2025
mshabarov pushed a commit that referenced this issue Feb 3, 2025
Execute Hilla tasks (TaskGenerateOpenAPI and TaskGenerateEndpoint) whenever Hilla is available on the classpath. These tasks should determine the required actions themselves, instead of Flow trying to do it.

Fixes #20289
Fixes #18800
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
2 participants