Hey all, just looking for some advice. I’d like to do a WASM application, just generally like a calendar + notes app. I’d like it to work on mobile and desktop through the browser. It’ll be served through Actix with Diesel for the backend. For the “frontend” I was thinking egui or leptos.

I’d like to avoid any JavaScript, so thought SSR might be the best approach.

Any thoughts/pitfalls? Should I look at something else for the frontend?

Its a lot of working parts for a calendar + notes app, but this will be a testing ground to see if I can get it all going :S

  • Hawk@lemmynsfw.com
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    5 days ago

    Id just use leptos. There will be a little bit of js to load the WASM but that would be it.

    If it’s a performance concern, i think solid-js had better performance than both egui and leptos anyway plus you get some niceties like codemirror (vim bindings), marked.js etc.

    Egui is really nice dx wise but you will be restricted to those widgets, immediate mode may not scale as well as signals/{slots, effects}.

    If it’s a general dislike of JavaScript, you may want to look at QML.

    I personally found QML to have really poor documentation around a lot of the widgets. Leptos is good, but I found SolidJS to have more of what I needed and the performance was good enough that I went without for my own personal stuff. But I also had different needs. I really needed something that could do charts, data tables, and your general GUI stuff as well.

    • Matty_r@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      4 days ago

      OK, I was hoping to have it usable with JS disabled entirely, but that sounds impossible based on what you and others are saying. At least I can level my expectations somewhat before diving in.

      • taladar@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        As someone who regularly disables JS on websites (or rather refuses to enable it for a lot of websites) I am very glad WASM does not work around that restriction.

      • Hawk@lemmynsfw.com
        link
        fedilink
        arrow-up
        1
        ·
        4 days ago

        Well you will write 0 js in leptos, however js is used to initialize the WASM.

        What is your goal and the reason against JS and maybe I could provide more recommendations.

        If it’s a personal choice against Js, leptos will be the best compromise. One could use Axum with minijinja but if you’re not careful about routes etc. performance will be shit.

        • Matty_r@programming.devOP
          link
          fedilink
          arrow-up
          1
          ·
          4 days ago

          The end goal is to try and have a web app that is usable on both desktop and mobile, I would use what I learn from this simple app to hopefully get something bigger going.

          I have nothing specifically against JS I just was (somewhat ignorantly) hoping I could avoid it altogether. I also don’t like having to double up on defining classes, one for backend and one for frontend. I tried React and it really felt like I was wasting my time redefining stuff that I had already defined in my backend.

          In my previous attempt, I basically had 3 definitions. The database definition, the Rust definition, then the frontend (JS).

          • Hawk@lemmynsfw.com
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            4 days ago

            Yeah, it’s funny because I’ve been doing the same thing with my wife on some personal projects like family wiki and event calendar and things where we wanted a web application that could be used on both desktop and mobile.

            Here’s what I found so far, Avoiding JavaScript entirely by using a templating language and a HTTP server like Axum Produces fairly sub-par results if you are hoping for interactivity ( Frequent page reloads mean that you can’t have big sodebars etc.)

            Qt/qml are OK, but no mobile.

            Leptos is what I was looking at, but in the end TypeScript with solid-js was simpler, more performant and more features (although I absolutely hope to revisit leptos down the line).

            What you get with solid is signals/slots for state, server side functions to avoid the need for an api, routing for template management, easy tailwind integration and of course any js you may want (eg full calendar io).

            I wouldn’t recommend egui if your focus was web.

            Oh, and finally, the other issue with Leptos over Solid is that it’s a bit more work to get into Electron from what I understand. Tauri Does not support Linux, so that’s not really an option for a cross-platform.