-
How does this compare to Rocket (https://rocket.rs/) - I've just started using Rocket and it seems to provide everything that Hyper does and a lot more out of the box too
When would I use Hyper instead of Rocket?
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
-
If you want to build a backend in Rust, Axum (which uses hyper underneath) is pretty recommended these days, as it's all in the tokio ecosystem. Actix Web is good too, but it has its own ecosystem of libraries. I read the book Zero To Production in Rust [0] which was a great overview on not just Rust but scalable backend architectures as a whole.
Interestingly, Cloudflare wanted to use hyper but found that it was too correct, so they had to build their own [1].
[0] https://www.zero2prod.com
[1] https://blog.cloudflare.com/how-we-built-pingora-the-proxy-t...
-
Haven't used it myself, but https://github.com/SeaQL/sea-orm seems to be popular in some communities and async
-
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
-
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
-
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
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
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
-
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
-
-
I tried warp [0] and I am unimpressed so far. Pretty complex, limited documentation, buggy. The builder paradigm they used feels pretty constrained and, in my opinion, achieve the opposite of the simplicity it is supposed to bring. I was surprised it is so popular.
Maybe I need more time or a favorable comparison to another framework to appreciate it.
[0] https://github.com/seanmonstar/warp
-
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
-
cozo
A transactional, relational-graph-vector database that uses Datalog for query. The hippocampus for AI!
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