-
Notifications
You must be signed in to change notification settings - Fork 175
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: improved endpoint detection #21009
Conversation
Needs to be tested with a Hilla build from this PR branch |
/** | ||
* Checks if Hilla is available and Hilla endpoints are used in the project. | ||
* | ||
* @return {@code true} if Hilla is available and Hilla views are used, |
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.
* @return {@code true} if Hilla is available and Hilla views are used, | |
* @return {@code true} if Hilla is available and Hilla endpoints are used, |
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.
Fixed
@@ -319,6 +319,9 @@ private void addEndpointServicesTasks(Options options) { | |||
if (!EndpointRequestUtil.isHillaAvailable(options.getClassFinder())) { | |||
return; | |||
} | |||
if (!EndpointRequestUtil.areHillaEndpointsUsed(options)) { |
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.
What if views are there but no endpoints yet?
I'd do it in this way:
- If Hilla not available - return
- if endpoints are used or views are used - continue, else - return.
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.
Changed the logic
flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java
Show resolved
Hide resolved
if (endpointGeneratorTaskFactory != null) { | ||
annotations.addAll(endpointGeneratorTaskFactory | ||
.getBrowserCallableAnnotations()); | ||
} |
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.
This doesn't seem to be covered by tests, so needs a unit test.
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.
Added test
Works as expected for me. |
|
This reverts commit 530e757.
This ticket/PR has been released with Vaadin 24.7.0.alpha12 and is also targeting the upcoming stable 24.7.0 version. |
Fixes #20983