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

Custom element declarations #11

Open
lastmjs opened this issue Nov 21, 2018 · 4 comments
Open

Custom element declarations #11

lastmjs opened this issue Nov 21, 2018 · 4 comments

Comments

@lastmjs
Copy link

lastmjs commented Nov 21, 2018

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

@bodil
Copy link
Owner

bodil commented Nov 29, 2018

They're not right now, but it's very close to the top of my todo list.

@bodil bodil changed the title Web components Custom element declarations Nov 29, 2018
@jonathanKingston
Copy link
Contributor

@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.

@zkat
Copy link

zkat commented Oct 24, 2019

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

@bodil
Copy link
Owner

bodil commented Oct 24, 2019

@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.

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