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

Generators for other Web components #1

Open
nghuuphuoc opened this issue Nov 9, 2023 · 5 comments
Open

Generators for other Web components #1

nghuuphuoc opened this issue Nov 9, 2023 · 5 comments

Comments

@nghuuphuoc
Copy link

Firstly, I want to express my gratitude to @raquo for your hard work on Laminar and this generator. In the README, you mentioned the possibility of parsing other Web Component libraries, but acknowledged that it would require additional effort.

My company has been utilizing Laminar in productions for a couple of years now, and we're exploring the possibility of using Web components (specifically SAP UI) instead of building our own UI components. I'm wondering if this is the appropriate place to request the creation of Laminar wrappers for SAP UI.

If it's not feasible to create SAP UI wrappers here, it would be fantastic if this generator could be modified to work with other Web component libraries.

@raquo
Copy link
Owner

raquo commented Nov 9, 2023

Oh, well I do have good news for you! Antoine already made SAP UI5 bindings for Laminar: https://github.com/sherpal/LaminarSAPUI5Bindings so for SAP UI5, this generator won't be needed, with Laminar at least.

@ngbinh
Copy link

ngbinh commented Nov 10, 2023

@raquo I know about that bindings. But I think it still require manual modifications to cover all the web components in SAP UI5. Would be nice to have something automatic and optimized

@raquo
Copy link
Owner

raquo commented Nov 10, 2023

Hm, I've only used UI5 components for the laminar demo myself, but I was under the impression that those bindings cover all of UI5 web components. Is that not the case?

Just looking at the list of components on UI5 website and in Antoine's Laminar-UI5 demo, it seems like it's the same list, counting more than 60 components, with matching names.

I haven't checked all of them them one by one, but if it's just a couple components missing, it will probably be easier to add them to the existing library than to set up generation for UI5, because generation will need to be configured to work for ALL of the components, even the ones that already work fine.

@elgca
Copy link

elgca commented Jun 22, 2024

@raquo I have attempted to provide an implementation of the 'aminar' binding for the MDUI web components library using the generator related code you provided. Thanks you.

After adaptation, it works well.

The custom-elements.json file contains ample information, and Scala offers comprehensive types descriptions for them. It focuses more on basic type mapping, where providing additional information suffices to generate code. For instance, only ControlledInput and csstype are required. If these are not provided, default values can be generated.

Currently, I have replaced handwritten CommonKeys with generated code.

like this , attr: alignment, type: 'start' | 'center' | 'end', auto supported now.
but like this, type : 1 | 2 | 3, not supported , will be generator HtmlAttr[Int], lost type limit.

https://github.com/elgca/laminar-mdui-components

@raquo
Copy link
Owner

raquo commented Jun 23, 2024

@elgca Looks great, nice work!

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

No branches or pull requests

4 participants