go-htmx
syn-rsx
go-htmx | syn-rsx | |
---|---|---|
1 | 3 | |
5 | 177 | |
- | - | |
10.0 | 0.0 | |
10 months ago | about 1 year ago | |
CSS | Rust | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
go-htmx
-
Hyper – A fast and correct HTTP implementation for Rust
Sure. They're called 'partials' sometimes. Useful if you want to rerender just part of a page. This is a pattern used by HTMX, a 'js framework' that accepts fragments of html in an http response and injects it into the page. This is good because it avoids the flash and state loss of a whole page reload. See the HTMX essay on template fragments for a more complete argument [0].
This is a go template for an interactive todos app [1] that I'm experimenting with. The html content of the entire page is present in one template definition which is split into 6 inline {{block}} definitions / "fragments". The page supports 5 interactions indicated by {{define}} definitions, each of which reuse various block fragments relevant to that interaction. I'm in the process of converting it to use embedded cozodb [2] queries which act as a server side data store. The idea here is that the entire 'app', including all html fragments, styles, http requests and responses, db schema, and queries are embedded into this single 100-line file.
[0]: https://htmx.org/essays/template-fragments/
[1]: https://github.com/infogulch/go-htmx/blob/master/templates/t...
[2]: https://github.com/cozodb/cozo
syn-rsx
-
Hyper – A fast and correct HTTP implementation for Rust
Any recommendations for rust template engines? I'd like something that can easily render labeled fragments of a template instead of requiring me to split a page into a dozen little files. Kinda like inline {{block}} definitions in Go's html/template. Speed is also nice.
From template-benchmark-rs [0] I found sailfish [1] (fast, but no fragments(?)). render-rs [2] and syn-rsx [3] (2022) both let you write html in rust macros which is cool (maybe that can substitute for fragments?). Then there's gtmpl-rust [4] which is just Go templates reimplemented in rust.
[0]: https://github.com/rosetta-rs/template-benchmarks-rs
[1]: https://github.com/rust-sailfish/sailfish
[2]: https://github.com/render-rs/render.rs last updated Jul 2020
[3]: https://github.com/stoically/syn-rsx last updated Nov 2022
[4]: https://github.com/fiji-flo/gtmpl-rust
-
Is there a library for manipulating HTML?
and this might be it: https://github.com/stoically/syn-rsx
-
Rust on the Front end and Back end
There are a few libraries that support this exactly:
https://github.com/stoically/syn-rsx
https://github.com/yewstack/yew
But there are others like Sauron, Maple, and Percy that have their own Elm-like approach which is probably almost just as good.
What are some alternatives?
maud - :pencil: Compile-time HTML templates for Rust
yew - Rust / Wasm framework for creating reliable and efficient web applications
template-benchmarks-rs - Collected benchmarks for templating crates written in Rust
sax-wasm - The first streamable, fixed memory XML, HTML, and JSX parser for WebAssembly.
render.rs - 🔏 A safe and simple template engine with the ergonomics of JSX
typed-html - Type checked JSX for Rust
gtmpl-rust - golang text/template for rust
derive_more - Some more derive(Trait) options
Rocket - A web framework for Rust.
alef-component - Alef Component for Modern Web Apps.
sea-orm - 🐚 An async & dynamic ORM for Rust
rust-bitfield - This crate provides macros to generate bitfield-like struct.