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

Make it easier to debug an empty @Endpoint class #330

Open
Legioth opened this issue Feb 26, 2020 · 3 comments
Open

Make it easier to debug an empty @Endpoint class #330

Legioth opened this issue Feb 26, 2020 · 3 comments
Labels

Comments

@Legioth
Copy link
Member

Legioth commented Feb 26, 2020

If you e.g. forget to mark your endpoint method as public, then there will not be any generated .ts file for your @Endpoint class. This may lead you towards investigating whether the file is detected at all or whether the whole code generation is somehow not working.

If there would instead be an empty generated .ts file, then it would be easier to pinpoint the source of the problem. It would be even better if the generated file would contain a comment that points out that there aren't any public methods in the Java class.

Another alternative would be that the generator fails with a clear error in this kind of situation.

@pleku pleku added the hilla Issues related to Hilla label Mar 9, 2020
vlukashov referenced this issue in vaadin/docs Feb 11, 2021
This is based on direct user feedback. Ppl do not immediately realise that non-public endpoint methods are not exposed to TypeScript.

Related: https://github.com/vaadin/flow/issues/7681
vlukashov referenced this issue in vaadin/docs Feb 11, 2021
This is based on direct user feedback. Ppl do not immediately realise that non-public endpoint methods are not exposed to TypeScript.

Related: https://github.com/vaadin/flow/issues/7681
vlukashov referenced this issue in vaadin/docs Feb 12, 2021
This is based on direct user feedback. People do not immediately realize that non-public endpoint methods are not exposed to TypeScript.

Related: https://github.com/vaadin/flow/issues/7681

+ add _Javadoc_ and _performant_ into the list of valid terms for Vale
@mlopezFC
Copy link

Hi, just a comment regarding this. It happened to me twice that I had to waste time investigating why the endpoint was not being generated because there were no logs and no ts file generated without methods. I think that just stress that endpoint methods should be public in the documentation is not enough (probably that is why this issue is still opened). IMHO, adding a warning in the logs that no public methods where found while scanning an @endpoint annotated class would be enough, given that it would make no sense to have it like that.

@Legioth
Copy link
Member Author

Legioth commented Jul 26, 2021

adding a warning in the logs that no public methods where found

It has occasionally happened that some users have noticed log messages, but I wouldn't count on it. Since there isn't really any reason to have an annotated class without public methods, it could just as well throw an error.

@vaadin-bot vaadin-bot transferred this issue from vaadin/flow Mar 4, 2022
@platosha
Copy link
Contributor

Throwing an error seems good in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants