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

Extract implementation of yew-macro in it's own crate #2950

Open
hamza1311 opened this issue Nov 6, 2022 · 1 comment
Open

Extract implementation of yew-macro in it's own crate #2950

hamza1311 opened this issue Nov 6, 2022 · 1 comment
Labels
A-yew-macro Area: The yew-macro crate

Comments

@hamza1311
Copy link
Member

Problem

yew-macro crate currently contains the parser and implementation of html! and other macros. It is a proc-macro crate which means it can't be added as a dependency (or unit tested)

Solution

Create a new crate that is not a proc-macro crate that exports the parsing and implementation details of the macros. yew-macro depends on it and uses it to expand the macros.
This also allows the playground to expand html! macro and show it's output without invoking rustc.
This crate may also expanded to become an alternative to syn-rsx

Drawbacks

It is an additional crate to publish.

@hamza1311 hamza1311 added the A-yew-macro Area: The yew-macro crate label Nov 6, 2022
@filipdutescu
Copy link

I could really use this separation, since I would like to add some default properties to my components, which currently require a bunch of copy pasting. Hopefully having access to the html! macro inners would make it much more pleasant to do. Is there any progress on this, by any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew-macro Area: The yew-macro crate
Projects
None yet
Development

No branches or pull requests

2 participants