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

BrowserCallable-aware package handling in Flow #20983

Open
mshabarov opened this issue Feb 12, 2025 · 1 comment · Fixed by #21009 · May be fixed by vaadin/hilla#3255
Open

BrowserCallable-aware package handling in Flow #20983

mshabarov opened this issue Feb 12, 2025 · 1 comment · Fixed by #21009 · May be fixed by vaadin/hilla#3255
Labels
enhancement hilla Issues related to Hilla

Comments

@mshabarov
Copy link
Contributor

Describe your motivation

Follow-up for #20289.

When Hilla's browser callable aka endpoints are present in a project, the Hilla TS endpoints generator packages have to be added.
Flow should know whether to add them during build time based on presence BrowserCallable / Endpoint annotated classes in a project.

Describe the solution you'd like

These annotations are Hilla owned, so there should be a new API to pass this flag from Hilla.
It could be a method like hasBrowserCallables() in EndpointGeneratorTaskFactory interface that calls BrowserCallableFinder internally or Hilla can make BrowserCallableFinder discoverable through lookup for Flow.

We have to change the ordering of node tasks in Flow from

TaskUpdatePackages.class,
TaskRunNpmInstall.class,
TaskGenerateOpenAPI.class,
TaskGenerateEndpoint.class,

to

TaskGenerateOpenAPI.class,
TaskUpdatePackages.class,
TaskRunNpmInstall.class,
TaskGenerateEndpoint.class,

(discover endpoints -> add generators if needed -> npm install -> generate endpoints if needed)

Describe alternatives you've considered

Revert the #20289 and document the workaround.

Additional context

Target version - 24.7

@mshabarov mshabarov added enhancement hilla Issues related to Hilla labels Feb 12, 2025
@mshabarov mshabarov moved this to 🪵Product backlog in Vaadin Flow ongoing work (Vaadin 10+) Feb 12, 2025
@mshabarov mshabarov moved this from 🪵Product backlog to 🟢Ready to Go in Vaadin Flow ongoing work (Vaadin 10+) Feb 12, 2025
@tepi tepi moved this from 🟢Ready to Go to ⚒️ In progress in Vaadin Flow ongoing work (Vaadin 10+) Feb 12, 2025
@tepi tepi moved this from ⚒️ In progress to 🔎Iteration reviews in Vaadin Flow ongoing work (Vaadin 10+) Feb 21, 2025
mshabarov added a commit that referenced this issue Feb 25, 2025
Fixes #20983

---------

Co-authored-by: Mikhail Shabarov <[email protected]>
@github-project-automation github-project-automation bot moved this from 🔎Iteration reviews to Done in Vaadin Flow ongoing work (Vaadin 10+) Feb 25, 2025
@github-project-automation github-project-automation bot moved this from Next for Dev. Team to Done / Pending Release in Vaadin Flow enhancements backlog (Vaadin 10+) Feb 25, 2025
@tepi
Copy link
Contributor

tepi commented Feb 25, 2025

Reverted due to the changes causing test failures in Hilla. For now, the workaround of adding a dummy view should be used, and the issue will be revisited in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hilla Issues related to Hilla
Projects
Development

Successfully merging a pull request may close this issue.

3 participants