Open lastmjs opened 6 years ago
They're not right now, but it's very close to the top of my todo list.
@bodil did you have ideas of implementation here?
For example all custom elements have a -
in them which should allow a branch in the code around into_token_stream
however I'm not sure how the code might pick up elements that the user has registered.
So I'm trying to clone ink, and I was hoping to use typed-html as the jsx-ish implementation, but without the ability to inject custom elements, I can't really do that. Is there any way I can help out with this issue? I haven't written a Rust macro in my life but I'm down to learn what I need to help <3
@zkat But Ink doesn't actually use HTML at all, does it? I think what you're looking for is something that lets you declare components and subcomponents using JSX syntax, but not HTML, so typed-html is out of scope for what you're trying to do. What you might do is adapt the parser and the proc macro stuff from typed-html to suit your own ends, but strip out all the HTML related stuff and replace it with your own codegen. Alternatively, look at what I'm doing with vgtk, which has an actual component model, but which also has a lot of extraneous stuff for declaring Gtk widgets, and also the parser is currently terrible.
As for how to implement support for a component model in typed-html, I've had no good ideas since I left it on my todo list. It's too tied up in general to the implementation details, I suspect.
So, I imagine custom elements are not supported? I think it would be very beneficial to be able to define custom elements and have those type checked as well