home.social

#handlebars_rs — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #handlebars_rs, aggregated by home.social.

fetched live
  1. Good video "The hard truth about tech stacks"
    youtu.be/RTLSSGPoASU

    Although it wasn't the point of the video it did reinforce that I'm very happy with the combination of #RustLang with #Handlebars_rs templating plus #Htmx

    It looks like I'm going to be able to skip the crazy (imho) diversion into thick JavaScript front end clients.

  2. Been playing a lot with #SurrealDB on #RustLang with #Axum and #Handlebars_rs
    My #PrayerOfHannah app on #CodeBerg at codeberg.org/Dave42W/PrayerOfH now has working #CRUD for SongBooks and Authors using the embedded file db engine which is #RocksDB under the covers.
    Starting to get to a more productive place.

  3. I keep putting off doing docs and tests 😉
    But I now have full CRUD for my first table.
    I had some difficulties using the PATCH method on my edit form, it wasn't routing as I expected, so updates use POST to a different route.
    I need
    - some better passing db errors to the user
    - a delete confirmation
    - checking for multi-user db changes
    - transactions
    - after insert/update/delete I should redirect to the list not simply call the method as the url is wrong.
    #RustLang #Axum #SeaOrm #Handlebars_rs

  4. Very excited. I have the parts working together for an incredibly, basic #RustLang web app. Using #Axum #Handlebars_rs #SeaOrm with #Sqlite all on #CodeBerg at codeberg.org/Dave42W/daves_das
    I've tidied the code and massively simplified it.
    Getting to the point where I have a working environment to start building #PrayerOfHannah .
    I do want to add doc strings, and tests so this becomes the simplest possible example of all the connections for a CRUD web app.

  5. Close but struggling to connect #SeaOrm entities to #Axum handlers, I want get Json from the entity for rendering html with #Handlebars_rs ) and I want to get extracted form into entity struct so I can insert into database.
    Caught in a mismatch of types and traits and funding the docs & examples either don't work or very confusing.
    #RustLang learning curve is steep again.

  6. Made good #RustLang progress this evening, no longer spending hours trying to understand compiler errors 😊
    Working on my learning project "Daves Dashboard" code on #CodeBerg at codeberg.org/Dave42W/daves_das
    I've got #Axum #Handlebars_rs (including first partial template) and #SeaOrm working together neatly. Was a lot of setup for migrations but now also have autogenerated entity.
    Next connect my model to the database using entity.

  7. I've realised that my #RustLang problem isn't #Handlebars_rs but that I need to work with #Axum to set the Response content type. So that is leading me to both Axum State and intoResponse.
    Starting to dream about exciting projects that #Rust is going to be great for.
    While the strict compiler, types and syntax give a steep learning curve I like the feeling of confidence that they give once you get past them. Fewer runtime surprises.

  8. Happy progress on my #RustLang learning project using #Axum #Handlebars_rs and now #dotenvy
    on #GitHub at github.com/dave42w/daves_dashb

    I now have my first template file being rendered with nice, clean model and view implementations.

    Three issues of which two will be solved by learning #Closures

    details of those in the thread.

  9. Stuck on #Rust #json #Handlebars_rs

    // I want this to get the data as JSON, then render using a template into a String
    pub fn sys_info_template(j: Json<SysInfo>) -> String {
    let hbr = Handlebars::new();
    let source = "system_name {{system_name}}";
    hbr.register_template_string("t1", source);
    hbr.render("t1", &j).unwrap()
    }

    The &j is giving Serialize is not satisfied. Json<SysInfo> is in next post.
    I didn't think I needed a custom serializer for a struct of Strings

  10. Got my first #JSON appearing in a web browser. Still a huge amount to understand about #RustLang scoping and types.
    Next step is #Handlebars_rs templating :-)

  11. A little #RustLang update.
    1. I'm now Dave42W on GitHub to match everywhere else.
    2. My learning project "daves-dashboard" is at github.com/dave42w/daves_dashb
    3. I've started an #Axum branch for the web framework
    4. I'll be using #Handlebars_rs for templating (it works with Rust inside the browser too)
    5. Some cool new #VSCode extensions #Crates #Better_TOML #Error_Lens #Thunder_Client should help with #Rust complexities
    6. I want to look at #YEW for the client end in the future