I wouldn't use Java to create web components (YMMV). To consume components, generate JsInterop interfaces (maybe even widgets) from a custom element manifest, or a .d.ts.
I don't think there's any web component library that's (directly) usable from J2CL, so you'd first have to make one. It might be possible to use Lit or FAST from J2CL but you'd likely want to first create some tooling to make the calls to tagged templates more readable; e.g. from an interface similar to SafeHtmlTemplate:
But I don't see much use for J2CL or GWT nowadays (J2CL might be useful for sharing logic with the backend or a native app, the same way Google uses it, but not really for building UI). I mean, even Vaadin is pivoting with Hilla. That's my personal opinion though, and I won't try to push it through anyone's throat. Feel free to disagree, but I'm not interested in arguing about any of it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I wouldn't use Java to create web components (YMMV). To consume components, generate JsInterop interfaces (maybe even widgets) from a custom element manifest, or a
.d.ts.Makes sense, but I would love to learn about why not?
I don't think there's any web component library that's (directly) usable from J2CL, so you'd first have to make one. It might be possible to use Lit or FAST from J2CL but you'd likely want to first create some tooling to make the calls to tagged templates more readable; e.g. from an interface similar to
SafeHtmlTemplate:to
assuming a definition like:
But I don't see much use for J2CL or GWT nowadays (J2CL might be useful for sharing logic with the backend or a native app, the same way Google uses it, but not really for building UI). I mean, even Vaadin is pivoting with Hilla. That's my personal opinion though, and I won't try to push it through anyone's throat. Feel free to disagree, but I'm not interested in arguing about any of it.