Skip to content

BrowserCallable-aware package handling in Flow #20983

@mshabarov

Description

@mshabarov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Next for Dev. Team

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions