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

Passing properties to WebComponents #33

Open
Tracked by #74
ranaya-formant opened this issue Mar 24, 2023 · 4 comments
Open
Tracked by #74

Passing properties to WebComponents #33

ranaya-formant opened this issue Mar 24, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@ranaya-formant
Copy link

No description provided.

@maciejhirsz
Copy link
Owner

@ranaya-formant would you mind adding some context here, since it's actually unclear to me what this would entail exactly.

One thing would be using Web Components internally for performance (which may or may not be needed, benchmarks pending), another would be the ability to define Web Components in Kobold to use them outside of Kobold.

@9876691
Copy link

9876691 commented Mar 31, 2023

another would be the ability to define Web Components in Kobold to use them outside of Kobold.

That was probably the OP's intention.

There's some background on web components with bindgen rustwasm/wasm-bindgen#3119

@maciejhirsz maciejhirsz added the enhancement New feature or request label Apr 9, 2023
@ranaya-formant
Copy link
Author

ranaya-formant commented Apr 14, 2023

@maciejhirsz sorry for the delay.

What I mean is not being able to define web components, but rather being able to effectively pass down properties to a web component.

Right now react currently suffers from only being able to pass data to components by attribute.

lit-html and a planned improvement to React allow web components to receive data directly on properties exposed by the element ( to avoid the attribute string -> value conversion ).

I think this change would allow kobold to utilize web components from the ecosystem that exists today, and if kobold ever allows creating of web components one day, it would have an efficient way to pass it props too.

example:

let a = 42;

view! {

    <Greeter name="Richard" .age={a} />
}

@ranaya-formant ranaya-formant changed the title Consider adding support for view for WebComponents on roadmap Consider adding support for view passing values to properties of WebComponents on roadmap Apr 14, 2023
@maciejhirsz
Copy link
Owner

@ranaya-formant thanks for the explanation. This seems like a pretty modest ask and I don't see a reason why we shouldn't be able to do it one way or the other.

I'll organize a roadmap till 1.0 next week and plan this in somewhere.

@maciejhirsz maciejhirsz mentioned this issue Apr 25, 2023
10 tasks
@maciejhirsz maciejhirsz changed the title Consider adding support for view passing values to properties of WebComponents on roadmap Passing properties to WebComponents Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants