Fullstack GUI library for web, desktop, mobile, and more. In Rust using a HTML + CSS renderer built on top of Servo.

  • Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    2 months ago

    I wish we went the other way around: build for native and compile to HTML/CSS/WASM.

    For me the disadvantage of Electron is well, it doesn’t have any advantage or performance improvement over the browser version for 99% of use cases, and when you shove that on a mobile phone it performs as horribly as the web version.

    People already use higher level components that ends up shitting out HTML and CSS anyway, why not skip the middleman and just render the box optimally from the start? Web browsers have become good, but if you can skip parsing HTML and CSS entirely and also skip maintaining their state, that’s even better.

    I had the misfortune of developing a React Native app, and I’d say thinking in terms of rows and columns and boxes was nice. Most of RN’s problems are because they still run JS and so you have to bundle node and have the native messaging bridge, and of course that it’s tied to the turd that is React. But zero complains about the UI part when it doesn’t involve the bridge: very smooth and snappy, much more than the browser. And the browser version was no different than standard React in performance.

    I like that it’s not yet another Chromium one at least.

  • Oscar@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    Since people keep bringing up tauri, here’s the comparison made in the README:

    Dioxus vs Tauri

    Tauri is a framework for building desktop (and soon, mobile) apps where your frontend is written in a web-based framework like React, Vue, Svelte, etc. Whenever you need to do native work, you can write Rust functions and call them from your frontend.

    • Natively Rust: Tauri’s architecture limits your UI to either JavaScript or WebAssembly. With Dioxus, your Rust code is running natively on the user’s machine, letting you do things like spawning threads, accessing the filesystem, without any IPC bridge. This drastically simplifies your app’s architecture and makes it easier to build. You can build a Tauri app with Dioxus-Web as a frontend if you’d like.

    • Different scopes: Tauri needs to support JavaScript and its complex build tooling, limiting the scope of what you can do with it. Since Dioxus is exclusively focused on Rust, we’re able to provide extra utilities like Server Functions, advanced bundling, and a native renderer.

    • Shared DNA: While Tauri and Dioxus are separate projects, they do share libraries like Tao and Wry: windowing and webview libraries maintained by the Tauri team.

  • Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    IMO, I’d say Dioxus is more of a portable front end framework. If you’re looking for an electron alternative i.e, something to run web applications like they are native apps, I’d recommend Tauri.

    Also, this might be a bit out of date, but I believe Dioxus is using Tauri’s stuff under the hood. Although I heard this before the dev went full time on Dioxus, it could’ve changed, I know they have done a lot of work on it.

  • Ethan@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I seriously doubt that a dual-language platform is ever going to supplant Electron. Electron has the major advantage that the entire app is written in one language. And according to Stack Overflow’s 2023 developer survey, 66% of devs use JavaScript, 45% use Python, 43% use TypeScript, and 12% use Rust. More devs use Java, C#, C++, PHP, and C than Rust. So 2/3 of developers wouldn’t have to learn a new language to use Electron, and only a small fraction of the remainder knows Rust.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      It’s not a dual-language platform, though. You write the backend and the frontend in Rust. The frontend code is compiled to WASM to serve it to the browser.

        • rdri@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          The folks who only know JavaScript and refuse to learn more deserve to be blamed for electron’s (and similar) continued existence, and therefore for excessive resource usage.