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

@FrontendInterface to generate frontend interface #20338

Open
sveinnetnordic opened this issue Oct 25, 2024 · 4 comments
Open

@FrontendInterface to generate frontend interface #20338

sveinnetnordic opened this issue Oct 25, 2024 · 4 comments
Labels
enhancement hilla Issues related to Hilla

Comments

@sveinnetnordic
Copy link

When using ReactAdapterElement, @ClientCallable, executeJs etc its a manual job to create a Typescript interface. If they do not match no error is shown, but fails in runtime.

Please add something like:

@FrontendInterface
public record RgbaColor(int r, int g, int b, double a)

that generates:

export interface  RgbaColor {
    r: number;
    g: number;
    b: number;
    a: number;
}
@Artur-
Copy link
Member

Artur- commented Oct 25, 2024

The workaround for this is to create a dummy @BrowserCallable with all the needed types as parameters

@sveinnetnordic
Copy link
Author

The workaround for this is to create a dummy @BrowserCallable with all the needed types as parameters

Yes, I have done that for some years 😄 Today @BrowserCallable needs Hilla too, which I do not need (don't need frontend routing)

@mshabarov
Copy link
Contributor

Related issue #20289.

@mshabarov mshabarov added the hilla Issues related to Hilla label Oct 29, 2024
@mshabarov
Copy link
Contributor

While the types generation is Hilla's responsibility, the detection of @FrontendInterface being added to a project is a Flow feature.

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
None yet
Development

No branches or pull requests

3 participants