chinedufn / percy

Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.
https://chinedufn.github.io/percy/
Apache License 2.0
2.27k stars 84 forks source link

Interpolate text into html! macro, remove text! macro #96

Closed chinedufn closed 5 years ago

chinedufn commented 5 years ago

What

This PR makes it much easier to interpolate text variables into your HTML.

Before (bad)

let my_text = "hello world";

html! { <div> { text!(my_text) } </div> }

After (good)

let my_text = "hello world";

html! { <div> { my_text } </div> }

Why

Needing a macro for such a common thing was a poor experience

chinedufn commented 5 years ago

Published!

virtual-dom-rs = "0.6.5"
dbrgn commented 5 years ago

Cool!