← All news

Smarter HTML Generation

v0.8.0-rc.1 is the first release candidate on the road to v0.8.0. It focuses on eliminating unnecessary runtime work by moving string concatenation to compile time.

Compile-time string concatenation

Tidos now merges adjacent static HTML segments at compile time. Previously, every HTML tag and text node was concatenated at runtime using String::push_str calls. Now, consecutive static strings are folded into a single string literal by the macro, so the generated code produces fewer allocations and runs faster.

This is a purely internal improvement — your component code does not change. Pages with many static elements will see the most benefit.

Breaking change: text must be wrapped in curly bracesBreaking

To enable compile-time safety and the new optimisation, all text content inside view! must now be explicitly wrapped in curly braces. Raw text between tags is no longer allowed:

1// Before (no longer compiles)
2view! { <p>Hello world</p> }
3
4// After
5view! { <p>{"Hello world"}</p> }

The macro panics at compile time if it encounters unwrapped text, so migration errors are caught immediately. The fix is always mechanical: wrap the text in double-quoted curly braces.

If you have variables or expressions, keep using the expression form:

1view! {
2 <p>{"Hello {}", name}</p> // formatted
3 <p>{name}</p> // expression
4}

Upgrading

Update your Cargo.toml to use the release candidate:

1[dependencies]
2tidos = "0.8.0-rc.1"

Then search your codebase for raw text between HTML tags and wrap each occurrence in curly braces. Most editors can do this with a regex find-and-replace.