-
Notifications
You must be signed in to change notification settings - Fork 27
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
Allow users to declare custom html elements #259
Comments
Straw Man Plan
|
Nothing comes to mind right now, although I think your point about how to write
Would the user need to define their own event types for these, would we generate opaque event type wrappers for them? I like the basic direction of using a trait to define a custom element within moxie, and I agree we don't need to sort it out to be able to make use of existing web components :D. |
I was also thinking commas between elements, but no strong preference either way.
I was thinking the user would supply their own event type with a constructor that accepted a Javascript #[derive(Constructor)]
struct SelectedEvent{
// User can decide how they want to represent their event
}
impl SelectedEvent {
pub fn new(event: web_sys::CustomEvent) { ... }
// User can provide whatever methods they want.
} and we'd generate a call to |
What about requiring |
This would allow
moxie-dom
users to use third party web components. It looks like makinghtml_element
public would be a good direction to support this.html_element
had some warts that you'd like to consider before making it public. I found issue Support data attributes properly #240. Was there anything else?html_element
public.mox!
andhtml_element!
(issue Support names separated by dashes for tags and attributes #233)html_element
publicThe text was updated successfully, but these errors were encountered: