-
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
Changes from 5 commits
44d2446
1b0d169
7cf1cf8
d764e8d
4ee07a7
fbd0368
0c502c9
413923e
057d60f
a942ed2
7299c63
0c1fb4c
dc67e73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,9 +73,9 @@ public class NodeTasks implements FallibleCommand { | |
TaskGenerateWebComponentBootstrap.class, | ||
TaskGenerateFeatureFlags.class, | ||
TaskInstallFrontendBuildPlugins.class, | ||
TaskGenerateOpenAPI.class, | ||
TaskUpdatePackages.class, | ||
TaskRunNpmInstall.class, | ||
TaskGenerateOpenAPI.class, | ||
TaskGenerateEndpoint.class, | ||
TaskCopyFrontendFiles.class, | ||
TaskCopyLocalFrontendFiles.class, | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. What if views are there but no endpoints yet?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the logic |
||
return; | ||
} | ||
Lookup lookup = options.getLookup(); | ||
EndpointGeneratorTaskFactory endpointGeneratorTaskFactory = lookup | ||
.lookup(EndpointGeneratorTaskFactory.class); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ | |
import jakarta.servlet.ServletContextListener; | ||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.annotation.HandlesTypes; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.Serializable; | ||
|
@@ -65,6 +64,7 @@ | |
import com.vaadin.flow.di.LookupInitializer; | ||
import com.vaadin.flow.internal.DevModeHandlerManager; | ||
import com.vaadin.flow.router.HasErrorParameter; | ||
import com.vaadin.flow.router.Layout; | ||
import com.vaadin.flow.router.Route; | ||
import com.vaadin.flow.router.RouteAlias; | ||
import com.vaadin.flow.router.RouteConfiguration; | ||
|
@@ -75,7 +75,7 @@ | |
import com.vaadin.flow.server.RouteRegistry; | ||
import com.vaadin.flow.server.VaadinServletContext; | ||
import com.vaadin.flow.server.communication.IndexHtmlRequestHandler; | ||
import com.vaadin.flow.router.Layout; | ||
import com.vaadin.flow.server.frontend.EndpointGeneratorTaskFactory; | ||
import com.vaadin.flow.server.startup.AbstractRouteRegistryInitializer; | ||
import com.vaadin.flow.server.startup.AnnotationValidator; | ||
import com.vaadin.flow.server.startup.ApplicationConfiguration; | ||
|
@@ -559,6 +559,14 @@ public void failFastContextInitialized(ServletContextEvent event) | |
collectHandleTypes(devModeHandlerManager.getHandlesTypes(), | ||
annotations, superTypes); | ||
|
||
EndpointGeneratorTaskFactory endpointGeneratorTaskFactory = lookup | ||
.lookup(EndpointGeneratorTaskFactory.class); | ||
|
||
if (endpointGeneratorTaskFactory != null) { | ||
annotations.addAll(endpointGeneratorTaskFactory | ||
.getBrowserCallableAnnotations()); | ||
} | ||
Comment on lines
+565
to
+568
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Added test |
||
|
||
Set<Class<?>> classes = findClassesForDevMode(basePackages, | ||
annotations, superTypes); | ||
|
||
|
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.
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