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: remove EndpointsValidator class #3167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cromoteca
Copy link
Contributor

@cromoteca cromoteca commented Jan 20, 2025

This is an alternative to #2666.

EndpointsValidator checks if classes annotated with @Endpoint or @BrowserCallable are in the classpath and, in that case, throws an exception if Spring is not available.

In 24.7 we ask Spring for the list of endpoints, so by definition if there's no Spring, there are no endpoints.

See also the discussion in #2938.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.65%. Comparing base (910b89d) to head (2efedb6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3167   +/-   ##
=======================================
  Coverage   92.65%   92.65%           
=======================================
  Files          85       85           
  Lines        3187     3187           
  Branches      778      778           
=======================================
  Hits         2953     2953           
  Misses        182      182           
  Partials       52       52           
Flag Coverage Δ
unittests 92.65% <ø> (ø)

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.

@taefi
Copy link
Contributor

taefi commented Jan 20, 2025

Prior to the unified platform, the existence of EndpointsValidator was unnecessarily a strong check, since most of the Hilla projects would've been initiated either from start.vaadin.com, Spring Initializr, or the skeleton starters we provide. So the chances of users being confused about using endpoints in a non-spring project was very very low.

Now that we have a unified platform, users can start a Vaadin project without Spring, and later get interested in Hilla, and they can be trapped by browsing/following the docs at a wrong place that just instructs how to create endpoints. In that case, a visible enough warning could prevent confusions, but, failing the application startup still feels unnecessary to me.

@cromoteca
Copy link
Contributor Author

If you create an endpoint in your application, you have @BrowserCallable in your classpath, which means that you have Hilla. Is there a possibility to create a non-Spring application that contains Hilla dependencies? I don't think that we provide such a thing, but maybe there's another path that users could follow and could need to be warned.

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.

2 participants