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

node!(<h1>"example"</h1>) syntax does not work on released version 0.32.4 #28

Closed
sesh22 opened this issue Oct 17, 2020 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sesh22
Copy link

sesh22 commented Oct 17, 2020

Compiling the minimal macro syntax example fails if Cargo.toml has sauron = "0.32.4", but succeeds when using the relative path (sauron = { path = "../../"}) or the tagged version directly from Git (sauron = { git = "https://github.com/ivanceras/sauron", tag = "0.32.4" }).

Build error:

node! {
    <main>
        <h1>"Minimal example"</h1>
        <div class="some-class" id="some-id" {attr("data-id", 1)}>

    </main>
}
^ expected struct `sauron::Text`, found struct `std::string::String`

I narrowed this down to the string literal in the h1 tag: node!(<h1>"example"</h1>).
Using the full node!(<h1>{text("example")}</h1>) works with no problem.

I haven't been able to find a root cause, but I think it has to do with the latest sauron-node-macro version (0.32.0) being released before the fixes in e27c30b. If this is true then releasing a new version with bumped versions should resolve the problem.

@ivanceras ivanceras self-assigned this Oct 18, 2020
@ivanceras ivanceras added the bug Something isn't working label Oct 18, 2020
@ivanceras
Copy link
Owner

@sesh22 thank you for reporting, I was able to reproduce the error.

@ivanceras
Copy link
Owner

@sesh22 I bump up sauron-node-macro and it fixed the minimal example using the node macro syntax. Thank you for catching this error.

@sesh22
Copy link
Author

sesh22 commented Oct 18, 2020

@ivanceras Thanks! After running cargo update on my project sauron = "0.32.4" works again.

@sesh22 sesh22 closed this as completed Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants