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

feat: improved endpoint detection #3255

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

tepi
Copy link
Contributor

@tepi tepi commented Feb 19, 2025

@mshabarov
Copy link
Contributor

When tested this together with Flow counterpart, the following error is thrown for me:

Caused by: java.lang.IllegalArgumentException: Unexpected class name interface com.vaadin.hilla.BrowserCallable. Implementation error: the class finder instance is not aware of this class. Fix @HandlesTypes annotation value for com.vaadin.base.devserver.startup.DevModeStartupListener
        at com.vaadin.base.devserver.startup.DevModeInitializer$DevModeClassFinder.ensureImplementation(DevModeInitializer.java:125) ~[vaadin-dev-server-24.7-SNAPSHOT.jar:na]
        at com.vaadin.base.devserver.startup.DevModeInitializer$DevModeClassFinder.getAnnotatedClasses(DevModeInitializer.java:109) ~[vaadin-dev-server-24.7-SNAPSHOT.jar:na]
        at com.vaadin.flow.server.frontend.scanner.ClassFinder$CachedClassFinder.lambda$getAnnotatedClasses$0(ClassFinder.java:154) ~[flow-server-24.7-SNAPSHOT.jar:24.7-SNAPSHOT]
        at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1229) ~[na:na]
        at com.vaadin.flow.server.frontend.scanner.ClassFinder$CachedClassFinder.getAnnotatedClasses(ClassFinder.java:153) ~[flow-server-24.7-SNAPSHOT.jar:24.7-SNAPSHOT]
        at com.vaadin.hilla.internal.EndpointGeneratorTaskFactoryImpl.lambda$hasBrowserCallables$0(EndpointGeneratorTaskFactoryImpl.java:100) ~[hilla-engine-runtime-24.7-SNAPSHOT.jar:na]
        at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
        at com.vaadin.hilla.internal.EndpointGeneratorTaskFactoryImpl.hasBrowserCallables(EndpointGeneratorTaskFactoryImpl.java:99) ~[hilla-engine-runtime-24.7-SNAPSHOT.jar:na]
        at com.vaadin.flow.internal.hilla.EndpointRequestUtil.areHillaEndpointsUsed(EndpointRequestUtil.java:105) ~[flow-server-24.7-SNAPSHOT.jar:24.7-SNAPSHOT]
        at com.vaadin.flow.server.frontend.NodeTasks.addEndpointServicesTasks(NodeTasks.java:322) ~[flow-server-24.7-SNAPSHOT.jar:24.7-SNAPSHOT]
        at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:237) ~[flow-server-24.7-SNAPSHOT.jar:24.7-SNAPSHOT]
        at com.vaadin.base.devserver.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:331) ~[vaadin-dev-server-24.7-SNAPSHOT.jar:na]
        at com.vaadin.base.devserver.DevModeHandlerManagerImpl.initDevModeHandler(DevModeHandlerManagerImpl.java:106) ~[vaadin-dev-server-24.7-SNAPSHOT.jar:na]
        at com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener.failFastContextInitialized(VaadinServletContextInitializer.java:601) ~[vaadin-spring-24.7-SNAPSHOT.jar:na]
        at com.vaadin.flow.spring.VaadinServletContextInitializer$FailFastServletContextListener.contextInitialized(VaadinServletContextInitializer.java:202) ~[vaadin-spring-24.7-SNAPSHOT.jar:na]
        ... 44 common frames omitted

that means the class finder needs endpoint annotations in Flow's context initializer, but we cannot add them as Flow does not depend on Hilla.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.99%. Comparing base (c431cbb) to head (0e082fc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3255   +/-   ##
=======================================
  Coverage   86.99%   86.99%           
=======================================
  Files         118      118           
  Lines        8292     8292           
  Branches     1269     1269           
=======================================
  Hits         7214     7214           
  Misses       1064     1064           
  Partials       14       14           
Flag Coverage Δ
unittests 86.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZheSun88 ZheSun88 enabled auto-merge (squash) February 25, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BrowserCallable-aware package handling in Flow
4 participants